Skip to content

Commit d432c6c

Browse files
authored
🐛 [Frontend] Bugfix: App Mode was showing the settings (#7180)
1 parent cfe66a5 commit d432c6c

File tree

7 files changed

+50
-45
lines changed

7 files changed

+50
-45
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ qx.Class.define("osparc.data.model.Node", {
549549
return this.getIframeHandler() ? this.getIframeHandler().getLoadingPage() : null;
550550
},
551551

552-
__applyPropsForm: function() {
552+
__applyPropsForm: function(propsForm) {
553+
osparc.utils.Utils.setIdToWidget(propsForm, "settingsForm_" + this.getNodeId());
554+
553555
const checkIsPipelineRunning = () => {
554556
const isPipelineRunning = this.getStudy().isPipelineRunning();
555557
this.getPropsForm().setEnabled(!isPipelineRunning);

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
3838

3939
statics: {
4040
LOGGER_HEIGHT: 28,
41-
42-
isPropsFormShowable: function(node) {
43-
if (node && ("getPropsForm" in node) && node.getPropsForm()) {
44-
return node.getPropsForm().hasVisibleInputs();
45-
}
46-
return false;
47-
}
4841
},
4942

5043
members: {
@@ -135,8 +128,8 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
135128
},
136129

137130
isSettingsGroupShowable: function() {
138-
const node = this.getNode();
139-
return this.self().isPropsFormShowable(node);
131+
// do not show Settings in App Mode
132+
return false;
140133
},
141134

142135
__iFrameChanged: function() {

services/static-webserver/client/source/class/osparc/study/Utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ qx.Class.define("osparc.study.Utils", {
401401
// the was to guess the TI type is to check the boot mode of the ti-postpro in the pipeline
402402
const tiPostpro = Object.values(studyData["workbench"]).find(srv => srv.key.includes("ti-postpro"));
403403
if (tiPostpro && tiPostpro["bootOptions"]) {
404-
console.log(tiPostpro);
405404
switch (tiPostpro["bootOptions"]["boot_mode"]) {
406405
case "0":
407406
// classic TI

services/static-webserver/client/source/class/osparc/ui/basic/DateAndBy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
9696
const atom = this.getChildControl("last-touching");
9797
const myGroupId = osparc.auth.Data.getInstance().getGroupId();
9898
if (groupId === myGroupId) {
99-
atom.setLabel("by me");
99+
atom.set({
100+
label: "by me",
101+
icon: null,
102+
})
100103
} else {
101-
atom.setLabel("by");
104+
atom.setLabel("by ");
102105
osparc.dashboard.CardBase.addHintFromGids(atom, [groupId]);
103106
}
104107
}

services/static-webserver/client/source/class/osparc/vipMarket/AnatomicalModelDetails.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,29 +73,39 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
7373
}
7474
},
7575

76-
__createModelInfo: function(anatomicalModelsData) {
77-
const cardGrid = new qx.ui.layout.Grid(16, 16);
78-
const cardLayout = new qx.ui.container.Composite(cardGrid);
76+
__createModelInfo: function(anatomicalModelsDataSource) {
77+
const cardLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(16));
7978

80-
const description = anatomicalModelsData["description"] || "";
81-
description.split(" - ").forEach((desc, idx) => {
79+
const description = anatomicalModelsDataSource["description"] || "";
80+
const delimiter = " - ";
81+
let titleAndSubtitle = description.split(delimiter);
82+
if (titleAndSubtitle.length > 0) {
8283
const titleLabel = new qx.ui.basic.Label().set({
83-
value: desc,
84+
value: titleAndSubtitle[0],
8485
font: "text-16",
85-
alignX: "center",
8686
alignY: "middle",
8787
allowGrowX: true,
8888
allowGrowY: true,
8989
});
90-
cardLayout.add(titleLabel, {
91-
column: 0,
92-
row: idx,
93-
colSpan: 2,
90+
cardLayout.add(titleLabel);
91+
titleAndSubtitle.shift();
92+
}
93+
if (titleAndSubtitle.length > 0) {
94+
titleAndSubtitle = titleAndSubtitle.join(delimiter);
95+
const subtitleLabel = new qx.ui.basic.Label().set({
96+
value: titleAndSubtitle,
97+
font: "text-16",
98+
alignY: "middle",
99+
allowGrowX: true,
100+
allowGrowY: true,
94101
});
95-
});
102+
cardLayout.add(subtitleLabel);
103+
}
104+
96105

106+
const middleLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(16));
97107
const thumbnail = new qx.ui.basic.Image().set({
98-
source: anatomicalModelsData["thumbnail"],
108+
source: anatomicalModelsDataSource["thumbnail"],
99109
alignY: "middle",
100110
scale: true,
101111
allowGrowX: true,
@@ -105,12 +115,9 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
105115
maxWidth: 256,
106116
maxHeight: 256,
107117
});
108-
cardLayout.add(thumbnail, {
109-
column: 0,
110-
row: 2,
111-
});
118+
middleLayout.add(thumbnail);
112119

113-
const features = anatomicalModelsData["features"];
120+
const features = anatomicalModelsDataSource["features"];
114121
const featuresGrid = new qx.ui.layout.Grid(8, 8);
115122
const featuresLayout = new qx.ui.container.Composite(featuresGrid);
116123
let idx = 0;
@@ -176,15 +183,14 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
176183
}
177184
return doiLabel;
178185
};
179-
featuresLayout.add(doiToLink(anatomicalModelsData["doi"]), {
186+
featuresLayout.add(doiToLink(anatomicalModelsDataSource["doi"]), {
180187
column: 1,
181188
row: idx,
182189
});
183190

184-
cardLayout.add(featuresLayout, {
185-
column: 1,
186-
row: 2,
187-
});
191+
middleLayout.add(featuresLayout);
192+
193+
cardLayout.add(middleLayout);
188194

189195
return cardLayout;
190196
},

services/static-webserver/client/source/class/osparc/vipMarket/VipMarket.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,15 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
182182
this.__anatomicalModels = [];
183183
licensedItems.forEach(licensedItem => {
184184
const anatomicalModel = osparc.utils.Utils.deepCloneObject(licensedItem);
185-
anatomicalModel["modelId"] = anatomicalModel["licensedResourceData"]["source"]["id"];
185+
const anatomicalModelDataSource = anatomicalModel["licensedResourceData"]["source"];
186+
anatomicalModel["modelId"] = anatomicalModelDataSource["id"];
186187
anatomicalModel["thumbnail"] = "";
187188
anatomicalModel["date"] = null;
188-
if (anatomicalModel["licensedResourceData"] && anatomicalModel["licensedResourceData"]["source"]) {
189-
const anatomicalModelSource = anatomicalModel["licensedResourceData"]["source"];
190-
if (anatomicalModelSource["thumbnail"]) {
191-
anatomicalModel["thumbnail"] = anatomicalModelSource["thumbnail"];
192-
}
193-
if (anatomicalModelSource["features"] && anatomicalModelSource["features"]["date"]) {
194-
anatomicalModel["date"] = new Date(anatomicalModelSource["features"]["date"]);
195-
}
189+
if (anatomicalModelDataSource["thumbnail"]) {
190+
anatomicalModel["thumbnail"] = anatomicalModelDataSource["thumbnail"];
191+
}
192+
if (anatomicalModelDataSource["features"] && anatomicalModelDataSource["features"]["date"]) {
193+
anatomicalModel["date"] = new Date(anatomicalModelDataSource["features"]["date"]);
196194
}
197195
// attach license data
198196
anatomicalModel["licensedItemId"] = licensedItem["licensedItemId"];

tests/e2e-playwright/tests/tip/test_ti_plan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ def test_classic_ti_plan( # noqa: PLR0915
152152
page.wait_for_timeout(_ELECTRODE_SELECTOR_FLICKERING_WAIT_TIME)
153153

154154
with log_context(logging.INFO, "Configure selector"):
155+
assert (
156+
page.get_by_test_id("settingsForm_" + node_ids[0]).count() == 0
157+
), "service settings should not be visible"
158+
155159
electrode_selector_iframe.get_by_test_id("TargetStructure_Selector").click()
156160
electrode_selector_iframe.get_by_test_id(
157161
"TargetStructure_Target_(Targets_combined) Hypothalamus"

0 commit comments

Comments
 (0)