Skip to content
Merged
Show file tree
Hide file tree
Changes from 164 commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
eb700be
add timeout to make sure the node is saved before starting it
odeimaiz Jul 24, 2025
7cbed89
remove intervals
odeimaiz Jul 24, 2025
18d423a
updateStudyDocument with data and remove restartAutoSaveTimer
odeimaiz Jul 24, 2025
c7b1efe
listenToStudyChanges
odeimaiz Jul 24, 2025
13ec4e5
Merge branch 'master' into feature/event-driven-patches
odeimaiz Jul 24, 2025
889afcb
Merge branch 'feature/event-driven-patches' of github.com:odeimaiz/os…
odeimaiz Jul 24, 2025
dfc7a78
listenToChanges Node
odeimaiz Jul 24, 2025
ac4c7e6
minor
odeimaiz Jul 24, 2025
2fb6663
listenToChanges Node
odeimaiz Jul 24, 2025
0dd19a0
don't duplicate
odeimaiz Jul 24, 2025
d4d0fca
comment
odeimaiz Jul 24, 2025
c84ee62
unused
odeimaiz Jul 24, 2025
e220eac
serialize nodeUI
odeimaiz Jul 24, 2025
d4b0756
bring back old way
odeimaiz Jul 24, 2025
f65be44
minor
odeimaiz Jul 24, 2025
ec4b52b
marker and position
odeimaiz Jul 24, 2025
f71c76c
eventDrivenPatch
odeimaiz Jul 24, 2025
4d3e3ef
minor
odeimaiz Jul 24, 2025
6d7dbb3
minor
odeimaiz Jul 24, 2025
3586b91
fixes
odeimaiz Jul 24, 2025
e1f2e9c
Merge branch 'master' into feature/event-driven-patches
odeimaiz Jul 24, 2025
d40ea33
Merge branch 'feature/event-driven-patches' of github.com:odeimaiz/os…
odeimaiz Jul 24, 2025
fb8dfff
minor
odeimaiz Jul 24, 2025
8a221f1
multi move
odeimaiz Jul 24, 2025
72db3f8
marker under control
odeimaiz Jul 24, 2025
505baec
minor
odeimaiz Jul 24, 2025
ba8df3e
minor
odeimaiz Jul 24, 2025
9533368
unused
odeimaiz Jul 25, 2025
c877e74
IgnoreChangesProps
odeimaiz Jul 25, 2025
8c31960
refactor
odeimaiz Jul 25, 2025
e53d908
more refactor
odeimaiz Jul 25, 2025
59c25df
ListenChangesProps
odeimaiz Jul 25, 2025
7718fb1
ListenChangesProps
odeimaiz Jul 25, 2025
962bc7d
refactor
odeimaiz Jul 25, 2025
44131ab
minor
odeimaiz Jul 25, 2025
41e0b1a
isRTCEnabled
odeimaiz Jul 25, 2025
2d0d539
fix
odeimaiz Jul 25, 2025
233d5f4
minor
odeimaiz Jul 25, 2025
a3ab0e8
remove clean from serialize
odeimaiz Jul 25, 2025
486f563
minor
odeimaiz Jul 25, 2025
6fbb97d
inputs
odeimaiz Jul 25, 2025
3d82744
listen to inputs changes
odeimaiz Jul 25, 2025
e308bbb
unitChanged event
odeimaiz Jul 25, 2025
308df6b
inputsUnits
odeimaiz Jul 25, 2025
93f7a85
deprecate inputAccess
odeimaiz Jul 25, 2025
f6e1805
inputNodes
odeimaiz Jul 25, 2025
df3814c
inputsRequired
odeimaiz Jul 25, 2025
97a3df9
inputsRequired minor
odeimaiz Jul 25, 2025
18a9131
better
odeimaiz Jul 25, 2025
269bc25
progress
odeimaiz Jul 25, 2025
9562f76
refactor
odeimaiz Jul 25, 2025
253a67c
outputs
odeimaiz Jul 25, 2025
3cd2584
don't fire twice
odeimaiz Jul 25, 2025
f3fcab7
type is immutable
odeimaiz Jul 25, 2025
a17fdbb
minor
odeimaiz Jul 25, 2025
e299116
listenToChanges studyUI
odeimaiz Jul 25, 2025
d060ac5
minor
odeimaiz Jul 25, 2025
a003be2
Merge branch 'master' into feature/event-driven-patches
odeimaiz Jul 26, 2025
cd09172
Merge branch 'feature/event-driven-patches' of github.com:odeimaiz/os…
odeimaiz Jul 26, 2025
8b45ad4
rename and refactor
odeimaiz Jul 26, 2025
e50485d
changeData
odeimaiz Jul 26, 2025
d555f7b
undoings
odeimaiz Jul 26, 2025
5d321bd
minor
odeimaiz Jul 26, 2025
bfeaabe
comment
odeimaiz Jul 26, 2025
7d93215
throttling patch
odeimaiz Jul 26, 2025
e6e3840
it is needed
odeimaiz Jul 26, 2025
bcb62ec
listen to annotationChanged
odeimaiz Jul 26, 2025
29cb7ec
setSavePending
odeimaiz Jul 26, 2025
db78411
simpler
odeimaiz Jul 26, 2025
c861ddb
minor
odeimaiz Jul 26, 2025
95dfa66
minor
odeimaiz Jul 26, 2025
81c3722
annotations
odeimaiz Jul 26, 2025
5aa8152
changeSlideshow
odeimaiz Jul 26, 2025
3eb1d70
fix
odeimaiz Jul 26, 2025
eacee48
__listenToProjectDocument
odeimaiz Jul 26, 2025
ece3121
projectDocument doesn't contain the following properties
odeimaiz Jul 26, 2025
5b04404
minor
odeimaiz Jul 26, 2025
f217b21
nullable thumbnail
odeimaiz Jul 26, 2025
a09d586
init annotations to null
odeimaiz Jul 26, 2025
fabcc07
some progress
odeimaiz Jul 26, 2025
94f2359
curate comparison documents
odeimaiz Jul 26, 2025
f4073e1
it's clean now
odeimaiz Jul 26, 2025
19bf573
fix
odeimaiz Jul 26, 2025
a37efa3
init and null values
odeimaiz Jul 26, 2025
52939af
fix
odeimaiz Jul 26, 2025
5309948
renaming
odeimaiz Jul 26, 2025
b6a63b3
changePosition event
odeimaiz Jul 26, 2025
d3602f9
it moves
odeimaiz Jul 26, 2025
cc7dfdd
support markers
odeimaiz Jul 26, 2025
57ab431
refactor
odeimaiz Jul 27, 2025
7fe56f8
keep version
odeimaiz Jul 27, 2025
a3b5130
version out
odeimaiz Jul 27, 2025
94e3cb3
__setLastSyncedProjectDocument after projectDocument:updated
odeimaiz Jul 27, 2025
d5bbf2a
minor
odeimaiz Jul 27, 2025
cb2ab7c
rename
odeimaiz Jul 27, 2025
97ce73b
renaming
odeimaiz Jul 27, 2025
08d695a
__isEchoLoop
odeimaiz Jul 27, 2025
9d33d12
disable echo lop check
odeimaiz Jul 27, 2025
902eb3e
simple blocker
odeimaiz Jul 27, 2025
0c1b7b9
minor
odeimaiz Jul 27, 2025
2fd7335
annotation added and removed
odeimaiz Jul 27, 2025
80007d6
__updateAnnotationPositionFromDiff
odeimaiz Jul 27, 2025
63d09ef
minor
odeimaiz Jul 27, 2025
586f62a
minor
odeimaiz Jul 27, 2025
5f6f8e8
annotations done
odeimaiz Jul 27, 2025
ea09cf6
setFontSize
odeimaiz Jul 27, 2025
c201b47
setText
odeimaiz Jul 27, 2025
1a403bf
more properties
odeimaiz Jul 27, 2025
a51dc9a
minor
odeimaiz Jul 27, 2025
744e34a
Merge branch 'master' into feature/listenToProjectDocumentWS
odeimaiz Jul 28, 2025
7642cdc
Merge branch 'feature/listenToProjectDocumentWS' of github.com:odeima…
odeimaiz Jul 28, 2025
2bfb1c9
deltaToJsonPatch
odeimaiz Jul 28, 2025
a8c3631
serialize color for all annotations
odeimaiz Jul 28, 2025
8d2be37
comments
odeimaiz Jul 28, 2025
c1a91a3
jsondiffpatch 0.7.3
odeimaiz Jul 28, 2025
29b60d2
deltaToJsonPatch
odeimaiz Jul 28, 2025
ca636d5
include formatters
odeimaiz Jul 28, 2025
8118f32
refactor
odeimaiz Jul 28, 2025
cad8c87
rename
odeimaiz Jul 28, 2025
eee7ade
minors
odeimaiz Jul 28, 2025
fdf0f24
__deltaToPatch
odeimaiz Jul 28, 2025
8ea747b
updateStudyFromPatches
odeimaiz Jul 28, 2025
7f2dadf
position and marker
odeimaiz Jul 28, 2025
a1b95ad
position and marker
odeimaiz Jul 28, 2025
ba84dda
minor
odeimaiz Jul 28, 2025
f3f5fa8
Ignoring my own projectDocument:updated event
odeimaiz Jul 28, 2025
b5986df
minor
odeimaiz Jul 28, 2025
4305445
update attributes working
odeimaiz Jul 28, 2025
0cca4c4
cleanup studyid
odeimaiz Jul 28, 2025
5281574
updateWorkbenchFromPatches
odeimaiz Jul 28, 2025
b82035e
updateNodeFromPatch
odeimaiz Jul 28, 2025
547c0d1
update inputs working
odeimaiz Jul 28, 2025
11e3c2a
minor
odeimaiz Jul 28, 2025
a706ec1
support remove node
odeimaiz Jul 28, 2025
d362405
minor
odeimaiz Jul 28, 2025
4d6f1f8
minor fix
odeimaiz Jul 28, 2025
6f86a08
minor
odeimaiz Jul 28, 2025
5085238
minors
odeimaiz Jul 28, 2025
af18867
minor
odeimaiz Jul 28, 2025
4585ae4
Merge branch 'master' into feature/listenToProjectDocumentWS
odeimaiz Jul 28, 2025
641ddb4
Merge branch 'master' into feature/listenToProjectDocumentWS
odeimaiz Jul 29, 2025
6463064
Merge branch 'feature/listenToProjectDocumentWS' of github.com:odeima…
odeimaiz Jul 29, 2025
11bb378
show Flash Message
odeimaiz Jul 29, 2025
b01ecba
fix
odeimaiz Jul 29, 2025
8ee52fa
minor
odeimaiz Jul 29, 2025
4ce38d1
FP progress and outputs
odeimaiz Jul 29, 2025
67327d3
update workbench sequentially
odeimaiz Jul 29, 2025
88af3aa
safety measures
odeimaiz Jul 29, 2025
da8b70d
delete the node "add" from the workbenchPatchesByNode
odeimaiz Jul 29, 2025
c7071b8
extra check
odeimaiz Jul 29, 2025
e266b6f
Merge branch 'master' into feature/listenToProjectDocumentWS
odeimaiz Jul 30, 2025
7cf736d
Merge branch 'feature/listenToProjectDocumentWS' of github.com:odeima…
odeimaiz Jul 30, 2025
24694d3
logout
odeimaiz Jul 30, 2025
7fb1ed0
X-Client-Session-Id
odeimaiz Jul 30, 2025
1a5e44c
ignore old updates
odeimaiz Jul 30, 2025
f67f3d6
clientSessionId
odeimaiz Jul 30, 2025
ddc1986
minor
odeimaiz Jul 30, 2025
66bc345
ignore my own updates
odeimaiz Jul 30, 2025
c35ccc4
fix
odeimaiz Jul 30, 2025
0ca3f0f
refactor
odeimaiz Jul 30, 2025
2dfbdb6
createEdge
odeimaiz Jul 30, 2025
5383213
remove edge
odeimaiz Jul 30, 2025
05136ac
minor
odeimaiz Jul 30, 2025
2d5ebae
remove logs
odeimaiz Jul 30, 2025
1d4abf7
not needed
odeimaiz Jul 30, 2025
cf6281c
minor
odeimaiz Jul 30, 2025
4544620
the first (add) or last (remove) annotation
odeimaiz Jul 30, 2025
656da92
Merge branch 'master' into feature/listenToProjectDocumentWS
odeimaiz Jul 30, 2025
448b7dc
@matusdrobuliak66 was faster
odeimaiz Jul 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ qx.Class.define("osparc.data.model.Node", {
"reloadModel": "qx.event.type.Event",
"retrieveInputs": "qx.event.type.Data",
"keyChanged": "qx.event.type.Event",
"changePosition": "qx.event.type.Data",
"createEdge": "qx.event.type.Data",
"removeEdge": "qx.event.type.Data",
"fileRequested": "qx.event.type.Data",
"parameterRequested": "qx.event.type.Data",
"filePickerRequested": "qx.event.type.Data",
Expand Down Expand Up @@ -237,6 +240,10 @@ qx.Class.define("osparc.data.model.Node", {
"progress", // !! not a property but goes into the model
],

getProperties: function() {
return Object.keys(qx.util.PropertyUtil.getProperties(osparc.data.model.Node));
},

isFrontend: function(metadata) {
return (metadata && metadata.key && metadata.key.includes("/frontend/"));
},
Expand Down Expand Up @@ -524,7 +531,7 @@ qx.Class.define("osparc.data.model.Node", {
this.setPosition(nodeUIData.position);
}
if ("marker" in nodeUIData) {
this.__addMarker(nodeUIData.marker);
this.addMarker(nodeUIData.marker);
}
},

Expand Down Expand Up @@ -682,11 +689,11 @@ qx.Class.define("osparc.data.model.Node", {
if (this.getMarker()) {
this.__removeMarker();
} else {
this.__addMarker();
this.addMarker();
}
},

__addMarker: function(marker) {
addMarker: function(marker) {
if (marker === undefined) {
marker = {
color: osparc.utils.Utils.getRandomColor()
Expand Down Expand Up @@ -922,13 +929,14 @@ qx.Class.define("osparc.data.model.Node", {

removeInputNode: function(inputNodeId) {
const index = this.__inputNodes.indexOf(inputNodeId);
if (index > -1) {
// remove node connection
this.__inputNodes.splice(index, 1);
this.fireEvent("changeInputNodes");
return true;
// make sure index is valid
if (index < 0 || index >= this.__inputNodes.length) {
return false;
}
return false;
// remove node connection
this.__inputNodes.splice(index, 1);
this.fireEvent("changeInputNodes");
return true;
},

isInputNode: function(inputNodeId) {
Expand Down Expand Up @@ -1198,7 +1206,7 @@ qx.Class.define("osparc.data.model.Node", {
this.__deleteInBackend()
.then(() => {
resolve(true);
this.removeIFrame();
this.nodeRemoved();
})
.catch(err => {
console.error(err);
Expand All @@ -1207,6 +1215,10 @@ qx.Class.define("osparc.data.model.Node", {
});
},

nodeRemoved: function() {
this.removeIFrame();
},

__deleteInBackend: function() {
// remove node in the backend
const params = {
Expand Down Expand Up @@ -1250,6 +1262,11 @@ qx.Class.define("osparc.data.model.Node", {
},
"osparc-resource": "ui",
});

this.fireDataEvent("changePosition", {
x: this.__posX,
y: this.__posY
});
},

getPosition: function() {
Expand Down Expand Up @@ -1300,7 +1317,7 @@ qx.Class.define("osparc.data.model.Node", {

listenToChanges: function() {
const nodeId = this.getNodeId();
const propertyKeys = Object.keys(qx.util.PropertyUtil.getProperties(osparc.data.model.Node));
const nodePropertyKeys = this.self().getProperties();
this.self().ListenChangesProps.forEach(key => {
switch (key) {
case "inputs":
Expand Down Expand Up @@ -1394,7 +1411,7 @@ qx.Class.define("osparc.data.model.Node", {
}
break;
default:
if (propertyKeys.includes(key)) {
if (nodePropertyKeys.includes(key)) {
this.addListener("change" + qx.lang.String.firstUp(key), e => {
const data = e.getData();
this.fireDataEvent("projectDocumentChanged", {
Expand All @@ -1412,14 +1429,87 @@ qx.Class.define("osparc.data.model.Node", {
});
},

updateNodeFromPatch: function(nodePatches) {
const nodePropertyKeys = this.self().getProperties();
nodePatches.forEach(patch => {
const op = patch.op;
const path = patch.path;
const value = patch.value;
const nodeProperty = path.split("/")[3];
switch (nodeProperty) {
case "inputs": {
const updatedPortKey = path.split("/")[4];
const currentInputs = this.__getInputData();
currentInputs[updatedPortKey] = value;
this.__setInputData(currentInputs);
break;
}
case "inputsUnits": {
// this is never transmitted by the frontend
const updatedPortKey = path.split("/")[4];
const currentInputUnits = this.__getInputUnits();
currentInputUnits[updatedPortKey] = value;
this.__setInputUnits(currentInputUnits);
break;
}
case "inputNodes":
if (op === "add") {
const inputNodeId = value;
this.fireDataEvent("createEdge", {
nodeId1: inputNodeId,
nodeId2: this.getNodeId(),
});
} else if (op === "remove") {
// we don't have more information about the input node, so we just remove it by index
const index = path.split("/")[4];
// make sure index is valid
if (index >= 0 && index < this.__inputNodes.length) {
this.fireDataEvent("removeEdge", {
nodeId1: this.__inputNodes[index],
nodeId2: this.getNodeId(),
});
}
}
break;
case "inputsRequired":
console.warn(`To be implemented: patching ${nodeProperty} is not supported yet`);
break;
case "outputs": {
const updatedPortKey = path.split("/")[4];
const currentOutputs = this.isFilePicker() ? osparc.file.FilePicker.serializeOutput(this.getOutputs()) : this.__getOutputsData();
currentOutputs[updatedPortKey] = value;
this.setOutputData(currentOutputs);
break;
}
case "progress":
if (this.isFilePicker()) {
this.getStatus().setProgress(value);
} else {
console.warn(`To be implemented: patching ${nodeProperty} is not supported yet`);
}
break;
default:
if (nodePropertyKeys.includes(nodeProperty)) {
const setter = "set" + qx.lang.String.firstUp(nodeProperty);
if (this[setter]) {
this[setter](value);
} else {
console.warn(`Property "${nodeProperty}" does not have a setter in osparc.data.model.Node`);
}
}
break;
}
});
},

serialize: function() {
// node generic
let nodeEntry = {
key: this.getKey(),
version: this.getVersion(),
label: this.getLabel(),
inputs: this.__getInputData(),
inputsUnits: this.__getInputUnits(),
inputsUnits: this.__getInputUnits(), // this is not working
inputNodes: this.getInputNodes(),
inputsRequired: this.getInputsRequired(),
bootOptions: this.getBootOptions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ qx.Class.define("osparc.data.model.Study", {

this.set({
uuid: studyData.uuid || this.getUuid(),
workspaceId: studyData.workspaceId || null,
folderId: studyData.folderId || null,
workspaceId: studyData.workspaceId || this.getWorkspaceId(),
folderId: studyData.folderId || this.getFolderId(),
name: studyData.name || this.getName(),
description: studyData.description || this.getDescription(),
thumbnail: studyData.thumbnail || this.getThumbnail(),
Expand All @@ -60,9 +60,9 @@ qx.Class.define("osparc.data.model.Study", {
permalink: studyData.permalink || this.getPermalink(),
dev: studyData.dev || this.getDev(),
trashedAt: studyData.trashedAt ? new Date(studyData.trashedAt) : this.getTrashedAt(),
trashedBy: studyData.trashedBy || null,
type: studyData.type,
templateType: studyData.templateType,
trashedBy: studyData.trashedBy || this.getTrashedBy(),
type: studyData.type || this.getType(),
templateType: studyData.templateType || this.getTemplateType(),
});

const wbData = studyData.workbench || this.getWorkbench();
Expand Down Expand Up @@ -143,7 +143,7 @@ qx.Class.define("osparc.data.model.Study", {

thumbnail: {
check: "String",
nullable: false,
nullable: true,
event: "changeThumbnail",
init: ""
},
Expand Down Expand Up @@ -747,23 +747,23 @@ qx.Class.define("osparc.data.model.Study", {
* @param studyDiffs {Object} Diff Object coming from the JsonDiffPatch lib. Use only the keys, not the changes.
* @param studySource {Object} Study object that was used to check the diffs on the frontend.
*/
patchStudyDelayed: function(studyDiffs, studySource) {
patchStudyDiffs: function(studyDiffs, studySource) {
const promises = [];
if ("workbench" in studyDiffs) {
promises.push(this.getWorkbench().patchWorkbenchDelayed(studyDiffs["workbench"], studySource["workbench"]));
promises.push(this.getWorkbench().patchWorkbenchDiffs(studyDiffs["workbench"], studySource["workbench"]));
delete studyDiffs["workbench"];
}
const fieldKeys = Object.keys(studyDiffs);
if (fieldKeys.length) {
fieldKeys.forEach(fieldKey => {
const changedFields = Object.keys(studyDiffs);
if (changedFields.length) {
changedFields.forEach(changedField => {
// OM: can this be called all together?
const patchData = {};
if (fieldKey === "ui") {
patchData[fieldKey] = this.getUi().serialize();
if (changedField === "ui") {
patchData[changedField] = this.getUi().serialize();
} else {
const upKey = qx.lang.String.firstUp(fieldKey);
const upKey = qx.lang.String.firstUp(changedField);
const getter = "get" + upKey;
patchData[fieldKey] = this[getter](studyDiffs[fieldKey]);
patchData[changedField] = this[getter](studyDiffs[changedField]);
}
promises.push(osparc.store.Study.getInstance().patchStudy(this.getUuid(), patchData))
});
Expand All @@ -772,6 +772,53 @@ qx.Class.define("osparc.data.model.Study", {
.then(() => {
return studySource;
});
}
},

// unused in favor of updateStudyFromPatches
updateStudyFromDiff: function(studyDiffs) {
const studyPropertyKeys = this.self().getProperties();
studyPropertyKeys.forEach(studyPropertyKey => {
if (studyPropertyKey in studyDiffs) {
const newValue = studyDiffs[studyPropertyKey][1];
if ("lastChangeDate" === studyPropertyKey) {
this.setLastChangeDate(new Date(newValue));
} else {
const upKey = qx.lang.String.firstUp(studyPropertyKey);
const setter = "set" + upKey;
this[setter](newValue);
}
delete studyDiffs[studyPropertyKey];
}
});
},

// json PATCHES
updateStudyFromPatches: function(studyPatches) {
const studyPropertyKeys = this.self().getProperties();
studyPatches.forEach(patch => {
const op = patch.op;
const path = patch.path;
const value = patch.value;
switch (op) {
case "replace":
const studyProperty = path.substring(1); // remove the leading "/"
if (studyPropertyKeys.includes(studyProperty)) {
if (path === "/lastChangeDate") {
this.setLastChangeDate(new Date(value));
} else {
const setter = "set" + qx.lang.String.firstUp(studyProperty);
if (this[setter]) {
this[setter](value);
} else {
console.warn(`Property "${studyProperty}" does not have a setter in osparc.data.model.Study`);
}
}
}
break;
default:
console.warn(`Unhandled patch operation "${op}" for path "${path}" with value "${value}"`);
}
});
},
}
});
Loading
Loading