Skip to content

Commit 2fb6663

Browse files
committed
listenToChanges Node
1 parent ac4c7e6 commit 2fb6663

File tree

2 files changed

+27
-12
lines changed
  • services/static-webserver/client/source/class/osparc/data/model

2 files changed

+27
-12
lines changed

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

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,20 @@ qx.Class.define("osparc.data.model.Node", {
213213
},
214214

215215
statics: {
216+
IgnoreSerializationProps: [
217+
"study",
218+
"nodeId",
219+
"dynamicV2",
220+
"serviceUrl",
221+
"errors",
222+
"propsForm",
223+
"outputsForm",
224+
"marker",
225+
"inputConnected",
226+
"outputConnected",
227+
"logger",
228+
],
229+
216230
isFrontend: function(metadata) {
217231
return (metadata && metadata.key && metadata.key.includes("/frontend/"));
218232
},
@@ -1242,20 +1256,20 @@ qx.Class.define("osparc.data.model.Node", {
12421256
},
12431257

12441258
listenToChanges: function() {
1245-
const propertyKeys = Object.keys(qx.util.PropertyUtil.getProperties(osparc.data.model.Node))
1259+
const propertyKeys = Object.keys(qx.util.PropertyUtil.getProperties(osparc.data.model.Node));
12461260
propertyKeys.forEach(key => {
1247-
this.addListener("change" + qx.lang.String.firstUp(key), e => {
1248-
const nodeId = this.getNodeId();
1249-
const data = e.getData();
1250-
this.fireDataEvent("updateStudyDocument", {
1251-
"op": "replace",
1252-
"path": `/workbench/${nodeId}/` + key,
1253-
"value": data
1254-
});
1255-
}, this);
1261+
if (!this.self().IgnoreSerializationProps.includes(key)) {
1262+
this.addListener("change" + qx.lang.String.firstUp(key), e => {
1263+
const nodeId = this.getNodeId();
1264+
const data = e.getData();
1265+
this.fireDataEvent("updateStudyDocument", {
1266+
"op": "replace",
1267+
"path": `/workbench/${nodeId}/` + key,
1268+
"value": data
1269+
});
1270+
}, this);
1271+
}
12561272
});
1257-
1258-
this.getWorkbench().addListener("updateStudyDocument", e => this.fireDataEvent("updateStudyDocument", e.getData()), this);
12591273
},
12601274

12611275
serialize: function(clean = true) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ qx.Class.define("osparc.data.model.Study", {
395395
});
396396

397397
this.getWorkbench().addListener("updateStudyDocument", e => this.fireDataEvent("updateStudyDocument", e.getData()), this);
398+
this.getUi().addListener("updateStudyDocument", e => this.fireDataEvent("updateStudyDocument", e.getData()), this);
398399
},
399400

400401
serialize: function(clean = true) {

0 commit comments

Comments
 (0)