Skip to content

Commit 6588f3b

Browse files
odeimaizmrnicegyu11
authored andcommitted
πŸ› [Frontend] Move grouped nodes (ITISFoundation#6486)
1 parent 68c6aef commit 6588f3b

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

β€Žservices/static-webserver/client/source/class/osparc/workbench/BaseNodeUI.jsβ€Ž

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
8787
appearance: {
8888
init: "window-small-cap",
8989
refine: true
90+
},
91+
92+
isMovable: {
93+
check: "Boolean",
94+
init: true,
95+
nullable: false
9096
}
9197
},
9298

@@ -272,7 +278,7 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
272278
// override qx.ui.core.MMovable
273279
_onMovePointerMove: function(e) {
274280
// Only react when dragging is active
275-
if (!this.hasState("move")) {
281+
if (!this.hasState("move") || !this.getIsMovable()) {
276282
return;
277283
}
278284
e.stopPropagation();
@@ -290,7 +296,7 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
290296
}
291297

292298
// Only react when dragging is active
293-
if (!this.hasState("move")) {
299+
if (!this.hasState("move") || !this.getIsMovable()) {
294300
return;
295301
}
296302

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ qx.Class.define("osparc.workbench.NodeUI", {
619619
// override qx.ui.core.MMovable
620620
_onMovePointerMove: function(e) {
621621
// Only react when dragging is active
622-
if (!this.hasState("move")) {
622+
if (!this.hasState("move") || !this.getIsMovable()) {
623623
return;
624624
}
625625
const coords = this._setPositionFromEvent(e);

β€Žservices/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.jsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
496496
nodeUI.addListener("requestOpenLogger", () => this.fireDataEvent("requestOpenLogger", nodeUI.getNodeId()), this);
497497

498498
nodeUI.addListener("nodeMovingStart", () => {
499-
this.__selectNode(nodeUI);
499+
if (!this.getSelectedNodeIDs().includes(nodeUI.getNodeId())) {
500+
this.__selectNode(nodeUI);
501+
}
500502
this.__itemStartedMoving();
501503
}, this);
502504

β€Žservices/static-webserver/client/source/class/osparc/workbench/WorkbenchUIPreview.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ qx.Class.define("osparc.workbench.WorkbenchUIPreview", {
6060
for (const nodeId in nodes) {
6161
const node = nodes[nodeId];
6262
const nodeUI = this._createNodeUI(nodeId);
63+
nodeUI.setIsMovable(false);
6364
this._addNodeUIToWorkbench(nodeUI, node.getPosition());
6465
}
6566
qx.ui.core.queue.Layout.flush();

0 commit comments

Comments
Β (0)