Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show "please wait" message when Nature services are starting #2801

Merged
merged 3 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions services/web/client/source/class/osparc/data/model/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,19 @@ qx.Class.define("osparc.data.model.Node", {
return this.tr("Starting ") + label;
},

__getExtraMessages: function() {
if (this.getKey() && this.getKey().includes("pub-nat-med")) {
return [
this.tr("This might take a couple of minutes")
];
}
return [];
},

__initLoadingIPage: function() {
const loadingPage = new osparc.ui.message.Loading(this.__getLoadingPageHeader(), [], true);
this.addListener("changeLabel", e => {
loadingPage.setHeader(this.__getLoadingPageHeader());
}, this);
this.getStatus().addListener("changeInteractive", e => {
loadingPage.setHeader(this.__getLoadingPageHeader());
}, this);
const loadingPage = new osparc.ui.message.Loading(this.__getLoadingPageHeader(), this.__getExtraMessages(), true);
this.addListener("changeLabel", () => loadingPage.setHeader(this.__getLoadingPageHeader()), this);
this.getStatus().addListener("changeInteractive", () => loadingPage.setHeader(this.__getLoadingPageHeader()), this);
this.setLoadingPage(loadingPage);
},

Expand Down
25 changes: 15 additions & 10 deletions services/web/client/source/class/osparc/ui/message/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ qx.Class.define("osparc.ui.message.Loading", {
this.base(arguments);
this._setLayout(new qx.ui.layout.HBox());

this.set({
alignX: "center"
});
this.__buildLayout(showMaximize);

this.setHeader(header);
this.setMessages(messages);
if (header) {
this.setHeader(header);
}
if (messages.length) {
this.setMessages(messages);
}
},

properties: {
Expand Down Expand Up @@ -84,26 +91,24 @@ qx.Class.define("osparc.ui.message.Loading", {
icon: "@FontAwesome5Solid/circle-notch/32",
font: "nav-bar-label",
alignX: "center",
gap: 15
gap: 15,
allowGrowX: false
});
atom.getChildControl("icon").getContentElement().addClass("rotate");

const messages = this.__messages = new qx.ui.container.Composite(new qx.ui.layout.VBox(10)).set({
const messages = this.__messages = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({
alignX: "center"
})).set({
padding: 20
});

const loadingWidget = new qx.ui.container.Composite(new qx.ui.layout.VBox().set({
alignX: "center",
alignY: "middle"
}));
loadingWidget.add(new qx.ui.core.Widget(), {
flex: 1
});
loadingWidget.add(image);
loadingWidget.add(atom);
loadingWidget.add(messages);
loadingWidget.add(new qx.ui.core.Widget(), {
flex: 1
});

this._add(new qx.ui.core.Widget(), {
flex: 1
Expand Down