Skip to content

Commit f3f151f

Browse files
committed
minor
1 parent b304017 commit f3f151f

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,15 @@ qx.Class.define("osparc.data.model.Node", {
483483
return Object.keys(this.getOutputs()).length;
484484
},
485485

486-
fetchAndPopulateWithMetadata: function() {
486+
fetchMetadataAndPopulate: function(nodeData, nodeUiData) {
487487
this.getService(this.getKey(), this.getVersion())
488488
.then(serviceMetadata => {
489489
this.populateWithMetadata(serviceMetadata);
490+
this.populateNodeData(nodeData);
491+
// old place to store the position
492+
this.populateNodeUIData(nodeData);
493+
// new place to store the position and marker
494+
this.populateNodeUIData(nodeUiData);
490495
});
491496
},
492497

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,23 @@ qx.Class.define("osparc.data.model.Workbench", {
292292
return node;
293293
},
294294

295-
deserializeNode: function() {
296-
// OM here
295+
__deserializeNode: function(key, version, nodeId, nodeData, nodeUiData) {
296+
const node = osparc.data.model.Node(this.getStudy(), key, version, nodeId);
297+
node.fetchMetadataAndPopulate(nodeData, nodeUiData);
298+
if (osparc.utils.Utils.eventDrivenPatch()) {
299+
node.listenToChanges();
300+
node.addListener("projectDocumentChanged", e => this.fireDataEvent("projectDocumentChanged", e.getData()), this);
301+
}
302+
node.addListener("keyChanged", () => this.fireEvent("reloadModel"), this);
303+
node.addListener("changeInputNodes", () => this.fireDataEvent("pipelineChanged"), this);
304+
node.addListener("reloadModel", () => this.fireEvent("reloadModel"), this);
305+
node.addListener("updateStudyDocument", () => this.fireEvent("updateStudyDocument"), this);
306+
osparc.utils.Utils.localCache.serviceToFavs(metadata.key);
307+
308+
this.__initNodeSignals(node);
309+
this.__addNode(node);
310+
311+
return node;
297312
},
298313

299314
createUnknownNode: function(nodeId) {
@@ -695,11 +710,12 @@ qx.Class.define("osparc.data.model.Workbench", {
695710
this.getNode(nodeId).populateNodeData(nodeData);
696711

697712
if ("position" in nodeData) {
698-
// old way for storing the position
713+
// old place to store the position
699714
this.getNode(nodeId).populateNodeUIData(nodeData);
700715
}
701-
if (workbenchUIData && "workbench" in workbenchUIData && nodeId in workbenchUIData.workbench) {
702-
this.getNode(nodeId).populateNodeUIData(workbenchUIData.workbench[nodeId]);
716+
if (workbenchUIData && "workbench" in workbenchUIData && nodeId in workbenchUIData["workbench"]) {
717+
// new place to store the position and marker
718+
this.getNode(nodeId).populateNodeUIData(workbenchUIData["workbench"][nodeId]);
703719
}
704720
});
705721
},

0 commit comments

Comments
 (0)