Skip to content

Commit 3262514

Browse files
committed
user lock_state
1 parent a42bfd1 commit 3262514

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ qx.Class.define("osparc.data.model.NodeStatus", {
151151
const progressSequence = new osparc.data.model.NodeProgressSequence();
152152
this.setProgressSequence(progressSequence);
153153
}
154-
if (node.isComputational() || node.isDynamic()) {
155-
const lockState = new osparc.data.model.NodeLockState();
156-
this.setLockState(lockState);
157-
}
154+
155+
const lockState = new osparc.data.model.NodeLockState();
156+
this.setLockState(lockState);
158157
};
159158

160159
if (node.getMetadata()) {
@@ -228,7 +227,6 @@ qx.Class.define("osparc.data.model.NodeStatus", {
228227
this.setModified(null);
229228
}
230229
}
231-
console.log("NodeStatus.lock_state", state["lock_state"]);
232230
if ("lock_state" in state) {
233231
this.getLockState().stateReceived(state.lock_state);
234232
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
357357
alignX: "center",
358358
marginLeft: 10
359359
});
360+
// do not allow modifying the pipeline
360361
this.getStudy().bind("pipelineRunning", addNewNodeBtn, "enabled", {
361362
converter: running => !running
362363
});
@@ -804,8 +805,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
804805
}
805806

806807
if (node instanceof osparc.data.model.Node) {
807-
node.getStudy().bind("pipelineRunning", this.__serviceOptionsPage, "enabled", {
808-
converter: pipelineRunning => !pipelineRunning
808+
node.getLockState().bind("locked", this.__serviceOptionsPage, "enabled", {
809+
converter: nodeLocked => !nodeLocked
809810
});
810811
}
811812
},

services/static-webserver/client/source/class/osparc/node/slideshow/NodeView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
6161
const showSettings = node.isComputational();
6262
this._settingsLayout.setVisibility(showSettings ? "visible" : "excluded");
6363

64-
node.getStudy().bind("pipelineRunning", this._settingsLayout, "enabled", {
65-
converter: pipelineRunning => !pipelineRunning
64+
node.getLockState().bind("locked", this._settingsLayout, "enabled", {
65+
converter: nodeLocked => !nodeLocked
6666
});
6767

6868
this._mainView.add(this._settingsLayout);

services/static-webserver/client/source/class/osparc/widget/NodeTreeItem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ qx.Class.define("osparc.widget.NodeTreeItem", {
149149
updateMarker();
150150

151151
const deleteBtn = this.getChildControl("delete-button");
152+
// do not allow modifying the pipeline
152153
node.getStudy().bind("pipelineRunning", deleteBtn, "enabled", {
153154
converter: running => !running
154155
});

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ qx.Class.define("osparc.workbench.NodeUI", {
398398
}
399399

400400
const lock = this.getChildControl("lock");
401-
node.getStudy().bind("pipelineRunning", lock, "visibility", {
402-
converter: pipelineRunning => pipelineRunning ? "visible" : "excluded"
401+
node.getLockState().bind("locked", lock, "visibility", {
402+
converter: nodeLocked => nodeLocked ? "visible" : "excluded"
403403
});
404404

405405
this.__markerBtn.show();
@@ -420,6 +420,7 @@ qx.Class.define("osparc.workbench.NodeUI", {
420420
node.addListener("changeMarker", () => updateMarker());
421421
updateMarker();
422422

423+
// do not allow modifying the pipeline
423424
node.getStudy().bind("pipelineRunning", this.__deleteBtn, "enabled", {
424425
converter: running => !running
425426
});

0 commit comments

Comments
 (0)