Skip to content

Commit 82b6e8c

Browse files
authored
Changes for ISAN (#957)
Removed progress bars from studies in the Dashboard. Info buttons for hints now show at all times. Solved bug with long study titles in Dashboard. Settings hidden if node has no inputs Added service version in ServiceInfo view Added link to manual in NavBar Added error status for nodes that fail loading Help button inside user menu now links to new docs. Not showing dashboard for anonymous users.
1 parent e1174f8 commit 82b6e8c

File tree

16 files changed

+85
-61
lines changed

16 files changed

+85
-61
lines changed

services/web/client/package-lock.json

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/web/client/source/class/qxapp/Application.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ qx.Class.define("qxapp.Application", {
7373
},
7474

7575
__initRouting: function() {
76-
// TODO: PC -> IP consider regex for uuid, i.e. /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/ ???
7776
const urlFragment = qxapp.utils.Utils.parseURLFragment();
7877
if (urlFragment.nav && urlFragment.nav.length) {
7978
if (urlFragment.nav[0] === "study" && urlFragment.nav.length > 1) {
@@ -114,7 +113,14 @@ qx.Class.define("qxapp.Application", {
114113
if (isLogged) {
115114
this.__loadMainPage();
116115
} else {
117-
qxapp.auth.Manager.getInstance().validateToken(this.__loadMainPage, this.__loadLoginPage, this);
116+
qxapp.auth.Manager.getInstance().validateToken(data => {
117+
if (data.role === "Guest") {
118+
// Logout a guest trying to access the Dashboard
119+
qxapp.auth.Manager.getInstance().logout();
120+
} else {
121+
this.__loadMainPage();
122+
}
123+
}, this.__loadLoginPage, this);
118124
}
119125
},
120126

services/web/client/source/class/qxapp/auth/Manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ qx.Class.define("qxapp.auth.Manager", {
7070
errorCb.call(ctx);
7171
} else {
7272
this.__loginUser(e.getTarget().getResponse().data.login);
73-
successCb.call(ctx);
73+
successCb.call(ctx, e.getTarget().getResponse().data);
7474
}
7575
});
7676
request.addListener("statusError", e => {

services/web/client/source/class/qxapp/component/form/FieldWHint.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ qx.Class.define("qxapp.component.form.FieldWHint", {
3838
if (value) {
3939
this.__field.setValue(value);
4040
}
41+
this.__field.setPaddingRight(18);
4142
this.getContentElement().addClass("hint-input");
4243
this.__field.getContentElement().addClass("hint-field");
4344
this._add(this.__field, {
@@ -78,8 +79,6 @@ qx.Class.define("qxapp.component.form.FieldWHint", {
7879

7980
__attachEventHandlers: function() {
8081
if (this.__hintText) {
81-
this.addListener("mouseover", () => this.__field.setPaddingRight(18), this);
82-
this.addListener("mouseout", () => this.__field.resetPaddingRight(), this);
8382
this.__infoButton.addListener("mouseover", () => this.__hint = new qxapp.ui.hint.Hint(this.__infoButton, this.__hintText), this);
8483
this.__infoButton.addListener("mouseout", () => this.__hint.destroy(), this);
8584

services/web/client/source/class/qxapp/component/metadata/ServiceInfo.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ qx.Class.define("qxapp.component.metadata.ServiceInfo", {
4848
alignY: "middle"
4949
}));
5050

51+
const titleContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
5152
const title = new qx.ui.basic.Label(this.__metadata.name).set({
5253
font: "title-16",
5354
rich: true
5455
});
55-
container.add(title);
56+
const version = new qx.ui.basic.Label("v" + this.__metadata.version).set({
57+
rich: true
58+
});
59+
titleContainer.add(title);
60+
titleContainer.add(version);
61+
container.add(titleContainer);
5662

5763
const description = new qx.ui.basic.Label(this.__metadata.description).set({
5864
rich: true

services/web/client/source/class/qxapp/component/service/NodeStatus.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,37 @@ qx.Class.define("qxapp.component.service.NodeStatus", {
5353
},
5454

5555
__setupInteractive: function() {
56-
this.__node.bind("serviceUrl", this.__label, "value", {
57-
converter: url => {
58-
if (url) {
56+
this.__node.bind("interactiveStatus", this.__label, "value", {
57+
converter: status => {
58+
if (status === "ready") {
5959
return this.tr("Ready");
60+
} else if (status === "failed") {
61+
return this.tr("Error");
62+
} else if (status === "starting") {
63+
return this.tr("Starting...");
6064
}
61-
return this.tr("Loading...");
65+
return this.tr("Idle");
6266
}
6367
});
6468

65-
this.__node.bind("serviceUrl", this.__icon, "source", {
66-
converter: url => {
67-
if (url) {
69+
this.__node.bind("interactiveStatus", this.__icon, "source", {
70+
converter: status => {
71+
if (status === "ready") {
6872
return "@FontAwesome5Solid/check/12";
73+
} else if (status === "failed") {
74+
return "@FontAwesome5Solid/exclamation-circle/12";
75+
} else if (status === "starting") {
76+
return "@FontAwesome5Solid/circle-notch/12";
6977
}
70-
return "@FontAwesome5Solid/circle-notch/12";
78+
return "@FontAwesome5Solid/check/12";
7179
},
7280
onUpdate: (source, target) => {
73-
if (source.getServiceUrl()) {
81+
if (source.getInteractiveStatus() === "ready") {
7482
this.__removeClass(this.__icon.getContentElement(), "rotate");
7583
target.setTextColor("ready-green");
84+
} else if (source.getInteractiveStatus() === "failed") {
85+
this.__removeClass(this.__icon.getContentElement(), "rotate");
86+
target.setTextColor("failed-red");
7687
} else {
7788
this.__addClass(this.__icon.getContentElement(), "rotate");
7889
target.resetTextColor();

services/web/client/source/class/qxapp/component/widget/NodeView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ qx.Class.define("qxapp.component.widget.NodeView", {
187187
__addSettings: function() {
188188
const propsWidget = this.getNode().getPropsWidget();
189189
this.__settingsLayout.removeAll();
190-
if (propsWidget) {
190+
if (propsWidget && Object.keys(this.getNode().getInputs()).length) {
191191
this.__settingsLayout.add(propsWidget);
192192
this.__mainLayout.add(this.__settingsLayout);
193193
} else if (qx.ui.core.Widget.contains(this.__mainLayout, this.__settingsLayout)) {

services/web/client/source/class/qxapp/component/workbench/NodeUI.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ qx.Class.define("qxapp.component.workbench.NodeUI", {
255255
const chipContainer = this.__chipContainer = new qx.ui.container.Composite(new qx.ui.layout.Flow(3, 3)).set({
256256
margin: [3, 4]
257257
});
258-
const category = qxapp.statics.NodeStatics.getCategory(this.getNode().getMetaData().category);
259-
const type = qxapp.statics.NodeStatics.getType(this.getNode().getMetaData().type);
258+
const category = this.getNode().isContainer() ? null : qxapp.statics.NodeStatics.getCategory(this.getNode().getMetaData().category);
259+
const nodeType = this.getNode().isContainer() ? "container" : this.getNode().getMetaData().type;
260+
const type = qxapp.statics.NodeStatics.getType(nodeType);
260261
if (type) {
261262
chipContainer.add(new qxapp.ui.basic.Chip(type.label, type.icon + "12"));
262263
}

services/web/client/source/class/qxapp/data/model/Node.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ qx.Class.define("qxapp.data.model.Node", {
179179
check: "String",
180180
nullable: true,
181181
init: ""
182+
},
183+
184+
interactiveStatus: {
185+
check: "String",
186+
nullable: true,
187+
event: "changeInteractiveStatus"
182188
}
183189
},
184190

@@ -739,6 +745,7 @@ qx.Class.define("qxapp.data.model.Node", {
739745
this.fireDataEvent("showInLogger", msgData);
740746

741747
this.setProgress(0);
748+
this.setInteractiveStatus("starting");
742749

743750
const prjId = this.getWorkbench().getStudy()
744751
.getUuid();
@@ -763,13 +770,15 @@ qx.Class.define("qxapp.data.model.Node", {
763770
msg: errorMsg
764771
};
765772
this.fireDataEvent("showInLogger", errorMsgData);
773+
this.setInteractiveStatus("failed");
766774
}, this);
767775
request.addListener("fail", e => {
768776
const failMsg = "Failed starting " + metaData.key + ":" + metaData.version + ": " + e.getTarget().getResponse()["error"];
769777
const failMsgData = {
770778
nodeId: this.getNodeId(),
771779
msg: failMsg
772780
};
781+
this.setInteractiveStatus("failed");
773782
this.fireDataEvent("showInLogger", failMsgData);
774783
}, this);
775784
request.send();
@@ -787,6 +796,7 @@ qx.Class.define("qxapp.data.model.Node", {
787796
nodeId: this.getNodeId(),
788797
msg: msg
789798
};
799+
this.setInteractiveStatus("failed");
790800
this.fireDataEvent("showInLogger", msgData);
791801
return;
792802
}
@@ -811,6 +821,7 @@ qx.Class.define("qxapp.data.model.Node", {
811821

812822
__serviceReadyIn: function(srvUrl) {
813823
this.setServiceUrl(srvUrl);
824+
this.setInteractiveStatus("ready");
814825
const msg = "Service ready on " + srvUrl;
815826
const msgData = {
816827
nodeId: this.getNodeId(),

services/web/client/source/class/qxapp/desktop/NavigationBar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ qx.Class.define("qxapp.desktop.NavigationBar", {
8787
flex: 1
8888
});
8989

90+
this._add(new qxapp.ui.form.LinkButton(this.tr("Docs"), "https://docs.osparc.io").set({
91+
appearance: "link-button"
92+
}));
93+
9094
this._add(new qxapp.ui.form.LinkButton(this.tr("Give us feedback"), this.self().FEEDBACK_FORM_URL).set({
9195
appearance: "link-button"
9296
}));
@@ -192,7 +196,7 @@ qx.Class.define("qxapp.desktop.NavigationBar", {
192196
menu.addSeparator();
193197

194198
const helpBtn = new qx.ui.menu.Button(this.tr("Help"));
195-
helpBtn.addListener("execute", () => window.open("https://itisfoundation.github.io"));
199+
helpBtn.addListener("execute", () => window.open("https://docs.osparc.io"));
196200
menu.add(helpBtn);
197201

198202
const newIssueBtn = new qx.ui.menu.Button(this.tr("Open issue in GitHub"));

0 commit comments

Comments
 (0)