Skip to content

Commit 306cd88

Browse files
authored
UI improvements (ITISFoundation#2357)
* higher contrast for colorbars * Cancel newOrg * Create warning next to "disable confirmations for disabling study deletion" * Fixed NodeViewer for guests
1 parent 9254ae5 commit 306cd88

File tree

6 files changed

+58
-11
lines changed

6 files changed

+58
-11
lines changed

services/web/client/source/class/osparc/desktop/preferences/pages/ConfirmationsPage.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,39 @@ qx.Class.define("osparc.desktop.preferences.pages.ConfirmationsPage", {
103103
const cbConfirmDeleteStudy = new qx.ui.form.CheckBox(this.tr("Delete a Study"));
104104
preferencesSettings.bind("confirmDeleteStudy", cbConfirmDeleteStudy, "value");
105105
cbConfirmDeleteStudy.bind("value", preferencesSettings, "confirmDeleteStudy");
106+
cbConfirmDeleteStudy.addListener("changeValue", e => {
107+
if (!e.getData()) {
108+
const msg = this.tr("Warning: deleting a study cannot be undone");
109+
const win = new osparc.ui.window.Confirmation(msg);
110+
win.getConfirmButton().setLabel(this.tr("OK"));
111+
win.center();
112+
win.open();
113+
win.addListener("close", () => {
114+
if (!win.getConfirmed()) {
115+
cbConfirmDeleteStudy.setValue(true);
116+
}
117+
}, this);
118+
}
119+
}, this);
106120
box.add(cbConfirmDeleteStudy);
107121

108122
const cbConfirmDeleteNode = new qx.ui.form.CheckBox(this.tr("Delete a Node"));
109123
preferencesSettings.bind("confirmDeleteNode", cbConfirmDeleteNode, "value");
110124
cbConfirmDeleteNode.bind("value", preferencesSettings, "confirmDeleteNode");
125+
cbConfirmDeleteNode.addListener("changeValue", e => {
126+
if (!e.getData()) {
127+
const msg = this.tr("Warning: deleting a node cannot be undone");
128+
const win = new osparc.ui.window.Confirmation(msg);
129+
win.getConfirmButton().setLabel(this.tr("OK"));
130+
win.center();
131+
win.open();
132+
win.addListener("close", () => {
133+
if (!win.getConfirmed()) {
134+
cbConfirmDeleteNode.setValue(true);
135+
}
136+
}, this);
137+
}
138+
}, this);
111139
box.add(cbConfirmDeleteNode);
112140

113141
const cbConfirmWindowSize = new qx.ui.form.CheckBox(this.tr("Window size check"));

services/web/client/source/class/osparc/desktop/preferences/pages/OrganizationsPage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ qx.Class.define("osparc.desktop.preferences.pages.OrganizationsPage", {
5757
orgEditor.addListener("createOrg", () => {
5858
this.__createOrganization(win, orgEditor.getChildControl("create"), orgEditor);
5959
});
60+
orgEditor.addListener("cancel", () => win.close());
6061
}, this);
6162
return createOrgBtn;
6263
},
@@ -279,6 +280,7 @@ qx.Class.define("osparc.desktop.preferences.pages.OrganizationsPage", {
279280
orgEditor.addListener("updateOrg", () => {
280281
this.__updateOrganization(win, orgEditor.getChildControl("save"), orgEditor);
281282
});
283+
orgEditor.addListener("cancel", () => win.close());
282284
},
283285

284286
__deleteOrganization: function(orgKey) {

services/web/client/source/class/osparc/desktop/preferences/window/APIKeyBase.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ qx.Class.define("osparc.desktop.preferences.window.APIKeyBase", {
2626
modal: true,
2727
showMaximize: false,
2828
showMinimize: false,
29+
contentPadding: 0,
2930
width: 350,
3031
clickAwayClose: true
3132
});
@@ -38,7 +39,8 @@ qx.Class.define("osparc.desktop.preferences.window.APIKeyBase", {
3839
members: {
3940
__addInfoText: function(infoText) {
4041
const introLabel = new qx.ui.basic.Label(infoText).set({
41-
padding: 5,
42+
paddingLeft: 5,
43+
paddingRight: 5,
4244
rich: true
4345
});
4446
this._add(introLabel);

services/web/client/source/class/osparc/theme/ColorDark.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ qx.Theme.define("osparc.theme.ColorDark", {
2424
"loading-page-text": "#FFFFFF",
2525
"loading-page-spinner": "#DDDDDD",
2626

27-
"scrollbar-passive": "contrasted-background",
28-
"scrollbar-active": "contrasted-background+"
27+
"contrasted-background++": "#666",
28+
"scrollbar-passive": "contrasted-background+",
29+
"scrollbar-active": "contrasted-background++"
2930
}
3031
});

services/web/client/source/class/osparc/ui/window/Dialog.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,24 @@ qx.Class.define("osparc.ui.window.Dialog", {
4545

4646
members: {
4747
__messageLabel: null,
48-
__btnToolbar: null,
48+
49+
_createChildControlImpl: function(id) {
50+
let control;
51+
switch (id) {
52+
case "buttons-toolbar":
53+
control = new qx.ui.toolbar.ToolBar();
54+
control.addSpacer();
55+
this.add(control);
56+
break;
57+
case "cancel-button": {
58+
const btnToolbar = this.getChildControl("buttons-toolbar");
59+
control = new qx.ui.toolbar.Button(this.tr("Cancel"));
60+
btnToolbar.add(control);
61+
break;
62+
}
63+
}
64+
return control || this.base(arguments, id);
65+
},
4966

5067
__buildLayout: function() {
5168
this.__messageLabel = new qx.ui.basic.Label().set({
@@ -55,9 +72,7 @@ qx.Class.define("osparc.ui.window.Dialog", {
5572
this.add(this.__messageLabel, {
5673
flex: 1
5774
});
58-
this.__btnToolbar = new qx.ui.toolbar.ToolBar();
59-
this.__btnToolbar.addSpacer();
60-
this.add(this.__btnToolbar);
75+
this.getChildControl("buttons-toolbar");
6176
},
6277

6378
_applyMessage: function(message) {
@@ -69,16 +84,16 @@ qx.Class.define("osparc.ui.window.Dialog", {
6984
* @param {qx.ui.toolbar.Button} button Button that will be added to the bottom bar of the dialog.
7085
*/
7186
addButton: function(button) {
72-
this.__btnToolbar.add(button);
87+
const btnToolbar = this.getChildControl("buttons-toolbar");
88+
btnToolbar.add(button);
7389
},
7490

7591
/**
7692
* Adds a default cancel button to the dialog.
7793
*/
7894
addCancelButton: function() {
79-
const cancelButton = new qx.ui.toolbar.Button(this.tr("Cancel"));
95+
const cancelButton = this.getChildControl("cancel-button");
8096
cancelButton.addListener("execute", () => this.close(), this);
81-
this.addButton(cancelButton);
8297
}
8398
}
8499
});

services/web/client/source/class/osparc/viewer/NodeViewer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ qx.Class.define("osparc.viewer.NodeViewer", {
8686
this.__initLoadingPage();
8787

8888
const iframe = new osparc.component.widget.PersistentIframe().set({
89-
showActionButton: false,
9089
showRestartButton: false
9190
});
9291
this.setIFrame(iframe);

0 commit comments

Comments
 (0)