Skip to content

Commit 5281574

Browse files
committed
updateWorkbenchFromPatches
1 parent 0cca4c4 commit 5281574

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

services/static-webserver/client/source/class/osparc/data/model/Workbench.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,20 @@ qx.Class.define("osparc.data.model.Workbench", {
827827
}
828828
})
829829
return Promise.all(promises);
830-
}
830+
},
831+
832+
updateWorkbenchFromPatches: function(workbenchPatches) {
833+
console.log(workbenchPatches);
834+
// group the patches by nodeId
835+
const workbenchPatchesByNode = {};
836+
workbenchPatches.forEach(workbenchPatch => {
837+
const nodeId = workbenchPatch.path.split("/")[2];
838+
if (!(nodeId in workbenchPatchesByNode)) {
839+
workbenchPatchesByNode[nodeId] = [];
840+
}
841+
workbenchPatchesByNode[nodeId].push(workbenchPatch);
842+
});
843+
console.log(workbenchPatchesByNode);
844+
},
831845
}
832846
});

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
364364
}
365365
}
366366
if (workbenchPatches.length > 0) {
367-
// OM todo
368-
// this.getStudy().getWorkbench().updateWorkbenchFromDiff(delta["workbench"]);
369-
// delete delta["workbench"];
370-
// this.getStudy().getWorkbench().updateWorkbenchFromPatches(workbenchPatches);
367+
this.getStudy().getWorkbench().updateWorkbenchFromPatches(workbenchPatches);
371368
}
372369
if (uiPatches.length > 0) {
373370
this.getStudy().getUi().updateUiFromPatches(uiPatches);

0 commit comments

Comments
 (0)