Skip to content

Commit aa42917

Browse files
authored
Fix (un)grouping (#1919)
- nodes-group service is "frontend" type - PropsForm Visibility fixed in GroupNodeView - Do not destroy (together with the window) the propsFormEditor when editAccessLevel - e2e: Once the dynamic service is responsive, wait 3" for the iframe - Guided mode: Enable/Disable Previous/Next buttons - Guided mode: Switch visible/hide buttons - Guided mode: Positions for groups and its children fixed - Refactoring
1 parent 720072a commit aa42917

File tree

22 files changed

+196
-137
lines changed

22 files changed

+196
-137
lines changed

api/specs/common/schemas/node-meta-v0.0.1-converted.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ properties:
3434
type: string
3535
description: service type
3636
enum:
37+
- frontend
3738
- computational
3839
- dynamic
3940
example: computational

api/specs/common/schemas/node-meta-v0.0.1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"type": "string",
4747
"description": "service type",
4848
"enum": [
49+
"frontend",
4950
"computational",
5051
"dynamic"
5152
],

packages/models-library/src/models_library/services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
class ServiceType(str, Enum):
27+
frontend = "frontend"
2728
computational = "computational"
2829
dynamic = "dynamic"
2930

services/catalog/src/simcore_service_catalog/services/frontend_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _node_group_service() -> ServiceDockerData:
2828
return ServiceDockerData(
2929
key="simcore/services/frontend/nodes-group",
3030
version="1.0.0",
31-
type="dynamic",
31+
type="frontend",
3232
name="Group",
3333
description="Group of nodes",
3434
authors=[{"name": "Odei Maiz", "email": "[email protected]"}],

services/director/src/simcore_service_director/api/v0/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ paths:
175175
type: string
176176
description: service type
177177
enum:
178+
- frontend
178179
- computational
179180
- dynamic
180181
example: computational
@@ -559,6 +560,7 @@ paths:
559560
type: string
560561
description: service type
561562
enum:
563+
- frontend
562564
- computational
563565
- dynamic
564566
example: computational
@@ -2157,6 +2159,7 @@ components:
21572159
type: string
21582160
description: service type
21592161
enum:
2162+
- frontend
21602163
- computational
21612164
- dynamic
21622165
example: computational

services/director/src/simcore_service_director/api/v0/schemas/node-meta-v0.0.1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"type": "string",
4747
"description": "service type",
4848
"enum": [
49+
"frontend",
4950
"computational",
5051
"dynamic"
5152
],

services/storage/src/simcore_service_storage/api/v0/schemas/node-meta-v0.0.1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"type": "string",
4747
"description": "service type",
4848
"enum": [
49+
"frontend",
4950
"computational",
5051
"dynamic"
5152
],

services/web/client/source/class/osparc/component/export/ExportDAG.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ qx.Class.define("osparc.component.export.ExportDAG", {
171171
const nodes = Object.values(innerNodes);
172172
for (const node of nodes) {
173173
const nodeEntry = nodesGroupService["workbench"][node.getNodeId()];
174-
for (let [portId, portValue] of Object.entries(node.getInputEditorValues())) {
175-
nodeEntry.inputs[portId] = portValue;
174+
if (node.isPropertyInitialized("propsFormEditor") && node.getPropsFormEditor()) {
175+
const editorValues = node.getPropsFormEditor().getValues();
176+
for (let [portId, portValue] of Object.entries(editorValues)) {
177+
nodeEntry.inputs[portId] = portValue;
178+
}
176179
}
177180
}
178181
osparc.data.Resources.fetch("dags", "post", {data: nodesGroupService})

services/web/client/source/class/osparc/component/node/GroupNodeView.js

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ qx.Class.define("osparc.component.node.GroupNodeView", {
5151
}
5252
});
5353
return settingsEditorLayout;
54+
},
55+
56+
isSettingsGroupShowable: function(innerNodes) {
57+
const innerNodesArray = Object.values(innerNodes);
58+
for (let i=0; i<innerNodesArray.length; i++) {
59+
const innerNode = innerNodesArray[i];
60+
if (osparc.component.node.NodeView.isPropsFormShowable(innerNode)) {
61+
return true;
62+
}
63+
}
64+
return false;
5465
}
5566
},
5667

@@ -66,8 +77,14 @@ qx.Class.define("osparc.component.node.GroupNodeView", {
6677
const innerSettings = osparc.component.node.BaseNodeView.createSettingsGroupBox();
6778
innerNode.bind("label", innerSettings, "legend");
6879
innerSettings.add(propsForm);
80+
propsForm.addListener("changeChildVisibility", () => {
81+
const isSettingsGroupShowable = osparc.component.node.NodeView.isPropsFormShowable(innerNode);
82+
innerSettings.setVisibility(isSettingsGroupShowable ? "visible" : "excluded");
83+
this.__checkSettingsVisibility();
84+
}, this);
6985
this._settingsLayout.add(innerSettings);
7086
}
87+
this.__checkSettingsVisibility();
7188
const mapper = innerNode.getInputsMapper();
7289
if (mapper) {
7390
this._mapperLayout.add(mapper, {
@@ -82,20 +99,14 @@ qx.Class.define("osparc.component.node.GroupNodeView", {
8299
});
83100
},
84101

102+
__checkSettingsVisibility: function() {
103+
const isSettingsGroupShowable = this.isSettingsGroupShowable();
104+
this._settingsLayout.setVisibility(isSettingsGroupShowable ? "visible" : "excluded");
105+
},
106+
85107
isSettingsGroupShowable: function() {
86-
let anyVisible = false;
87108
const innerNodes = this.getNode().getInnerNodes(true);
88-
const innerNodesArray = Object.values(innerNodes);
89-
for (let i=0; i<innerNodesArray.length && !anyVisible; i++) {
90-
const innerNode = innerNodesArray[i];
91-
const propsForm = innerNode.getPropsForm();
92-
if (propsForm) {
93-
anyVisible = propsForm.hasVisibleInputs();
94-
} else {
95-
anyVisible = false;
96-
}
97-
}
98-
return anyVisible;
109+
return this.self().isSettingsGroupShowable(innerNodes);
99110
},
100111

101112
__iFrameChanged: function(innerNode, tabPage) {
@@ -167,7 +178,9 @@ qx.Class.define("osparc.component.node.GroupNodeView", {
167178
_openEditAccessLevel: function() {
168179
const settingsEditorLayout = this.self().getSettingsEditorLayout(this.getNode().getInnerNodes());
169180
const title = this.getNode().getLabel();
170-
osparc.ui.window.Window.popUpInWindow(settingsEditorLayout, title, 800, 600);
181+
osparc.ui.window.Window.popUpInWindow(settingsEditorLayout, title, 800, 600).set({
182+
autoDestroy: false
183+
});
171184
},
172185

173186
_applyNode: function(node) {

services/web/client/source/class/osparc/component/node/NodeView.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@
3737
qx.Class.define("osparc.component.node.NodeView", {
3838
extend: osparc.component.node.BaseNodeView,
3939

40-
construct: function() {
41-
this.base(arguments);
40+
statics: {
41+
isPropsFormShowable: function(node) {
42+
if (node && ("getPropsForm" in node) && node.getPropsForm()) {
43+
return node.getPropsForm().hasVisibleInputs();
44+
}
45+
return false;
46+
}
4247
},
4348

4449
members: {
@@ -75,10 +80,7 @@ qx.Class.define("osparc.component.node.NodeView", {
7580

7681
isSettingsGroupShowable: function() {
7782
const node = this.getNode();
78-
if (node && ("getPropsForm" in node) && node.getPropsForm()) {
79-
return node.getPropsForm().hasVisibleInputs();
80-
}
81-
return false;
83+
return this.self().isPropsFormShowable(node);
8284
},
8385

8486
__iFrameChanged: function() {
@@ -133,9 +135,12 @@ qx.Class.define("osparc.component.node.NodeView", {
133135

134136
_openEditAccessLevel: function() {
135137
const settingsEditorLayout = osparc.component.node.BaseNodeView.createSettingsGroupBox(this.tr("Settings"));
136-
settingsEditorLayout.add(this.getNode().getPropsFormEditor());
138+
const propsFormEditor = this.getNode().getPropsFormEditor();
139+
settingsEditorLayout.add(propsFormEditor);
137140
const title = this.getNode().getLabel();
138-
osparc.ui.window.Window.popUpInWindow(settingsEditorLayout, title, 800, 600);
141+
osparc.ui.window.Window.popUpInWindow(settingsEditorLayout, title, 800, 600).set({
142+
autoDestroy: false
143+
});
139144
},
140145

141146
_applyNode: function(node) {

0 commit comments

Comments
 (0)