Skip to content

Commit a3bf017

Browse files
ignapassanderegg
authored andcommitted
is759/PO requests + Add button bug (#837)
* Equalized background colors in the study browser. * Added double click hint in empty workbench. Corrected but with the Add button in the Workbench. * Small code fix. * Removed unecessary translation. * Reduced the number of calls to updateHint. * Corrected bug where dynamic services are not started.
1 parent ee3f3a3 commit a3bf017

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ qx.Class.define("qxapp.component.workbench.WorkbenchUI", {
8888
bottom: 0
8989
});
9090

91+
this.__startHint = new qx.ui.basic.Label(this.tr("Double click on this area to start")).set({
92+
font: "workbench-start-hint",
93+
textColor: "workbench-start-hint",
94+
visibility: "excluded"
95+
});
96+
this.__desktopCanvas.add(this.__startHint);
97+
9198
this.__svgWidget = new qxapp.component.workbench.SvgWidget("SvgWidgetLayer");
9299
// this gets fired once the widget has appeared and the library has been loaded
93100
// due to the qx rendering, this will always happen after setup, so we are
@@ -291,6 +298,8 @@ qx.Class.define("qxapp.component.workbench.WorkbenchUI", {
291298
}, this);
292299

293300
qx.ui.core.queue.Layout.flush();
301+
302+
this.__updateHint();
294303
},
295304

296305
__createNodeUI: function(nodeId) {
@@ -719,6 +728,7 @@ qx.Class.define("qxapp.component.workbench.WorkbenchUI", {
719728
if (index > -1) {
720729
this.__nodesUI.splice(index, 1);
721730
}
731+
this.__updateHint();
722732
},
723733

724734
__clearAllNodes: function() {
@@ -876,6 +886,21 @@ qx.Class.define("qxapp.component.workbench.WorkbenchUI", {
876886
let srvCat = this.__createServicesCatalogue(pos);
877887
srvCat.open();
878888
}, this);
889+
890+
this.__desktopCanvas.addListener("resize", () => this.__updateHint(), this);
891+
},
892+
893+
__updateHint: function() {
894+
const isEmptyWorkspace = Object.keys(this.getWorkbench().getNodes()).length === 0;
895+
this.__startHint.setVisibility(isEmptyWorkspace ? "visible" : "excluded");
896+
if (isEmptyWorkspace) {
897+
const hintBounds = this.__startHint.getBounds() || this.__startHint.getSizeHint();
898+
const {height, width} = this.__desktopCanvas.getBounds();
899+
this.__startHint.setLayoutProperties({
900+
top: Math.round((height - hintBounds.height) / 2),
901+
left: Math.round((width - hintBounds.width) / 2)
902+
});
903+
}
879904
}
880905
}
881906
});

services/web/client/source/class/qxapp/component/workbench/servicesCatalogue/ServicesCatalogue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ qx.Class.define("qxapp.component.workbench.servicesCatalogue.ServicesCatalogue",
173173
const addBtn = this.__addBtn = new qx.ui.toolbar.Button("Add").set({
174174
enabled: false
175175
});
176-
addBtn.addListener("execute", this.__onAddService, this);
176+
addBtn.addListener("execute", () => this.__onAddService(), this);
177177
addBtn.setAllowGrowX(false);
178178
buttonsPart.add(addBtn);
179179
const cancelBtn = new qx.ui.toolbar.Button("Cancel");
@@ -246,7 +246,7 @@ qx.Class.define("qxapp.component.workbench.servicesCatalogue.ServicesCatalogue",
246246
selectBox.removeAll();
247247
if (serviceKey in this.__allServicesObj) {
248248
let versions = qxapp.utils.Services.getVersions(this.__allServicesObj, serviceKey);
249-
const latest = new qx.ui.form.ListItem(this.tr(this.self(arguments).LATEST));
249+
const latest = new qx.ui.form.ListItem(this.self(arguments).LATEST);
250250
selectBox.add(latest);
251251
for (let i = versions.length; i--;) {
252252
selectBox.add(new qx.ui.form.ListItem(versions[i]));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ qx.Class.define("qxapp.data.model.Node", {
237237
},
238238

239239
isRealService: function() {
240-
return (this.isInKey("simcore/service/dynamic") || this.isInKey("simcore/service/comp"));
240+
return (this.isInKey("simcore/services/dynamic") || this.isInKey("simcore/services/comp"));
241241
},
242242

243243
getMetaData: function() {

services/web/client/source/class/qxapp/theme/Color.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ qx.Theme.define("qxapp.theme.Color", {
3030
"background-main-lighter": "#2D2D2D",
3131
"background-main-lighter+": "#373737",
3232
"text-placeholder": "text-disabled",
33-
"text-darker": "text-disabled"
33+
"text-darker": "text-disabled",
34+
"tabview-pane-background": "background-main",
35+
"workbench-start-hint": "#505050"
3436
}
3537
});

services/web/client/source/class/qxapp/theme/Font.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ qx.Theme.define("qxapp.theme.Font", {
8484
family: ["Roboto"],
8585
color: "text",
8686
italic: true
87+
},
88+
89+
"workbench-start-hint": {
90+
size: 20,
91+
family: ["Roboto"],
92+
color: "workbench-start-hint",
93+
bold: true
8794
}
8895
}
8996
});

0 commit comments

Comments
 (0)