Skip to content

Commit 1e71c7b

Browse files
committed
[skip ci] categories
1 parent fc6fc09 commit 1e71c7b

File tree

6 files changed

+39
-23
lines changed

6 files changed

+39
-23
lines changed

services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
2727
position: "bottom-left",
2828
padding: 10,
2929
allowGrowX: true,
30+
minWidth: 300,
3031
});
3132

3233
this.__addItems();
@@ -39,7 +40,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
3940
},
4041

4142
statics: {
42-
createMenuButton: function(label, icon) {
43+
createMenuButton: function(label, icon, description) {
4344
const menuButton = new qx.ui.menu.Button().set({
4445
label,
4546
icon: icon || null,
@@ -48,16 +49,35 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
4849
});
4950
menuButton.getChildControl("label").set({
5051
rich: true,
52+
allowGrowX: true,
53+
minWidth: 300,
54+
wrap: false,
5155
});
5256
menuButton.getChildControl("icon").set({
5357
scale: true,
5458
maxHeight: 20,
5559
maxWidth: 20,
56-
allowShrinkX: true,
57-
allowShrinkY: true,
5860
});
61+
if (description) {
62+
const infoHint = new osparc.ui.hint.InfoHint(description).set({
63+
source: osparc.ui.hint.InfoHint.INFO_ICON + "/16",
64+
alignY: "middle",
65+
});
66+
// where the shortcut is supposed to go
67+
// eslint-disable-next-line no-underscore-dangle
68+
menuButton._add(infoHint, {column:2});
69+
}
5970
return menuButton;
6071
},
72+
73+
createHeader: function(label, icon, description) {
74+
const headerLabel = `--- ${label} ---`;
75+
return this.createMenuButton(headerLabel, icon, description).set({
76+
anonymous: true,
77+
cursor: "default",
78+
font: "text-16",
79+
});
80+
},
6181
},
6282

6383
members: {
@@ -122,7 +142,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
122142
const newStudiesData = values[0];
123143
const templates = values[1];
124144
if (newStudiesData["categories"]) {
125-
// this.__addCategories(newStudiesData["categories"]);
145+
this.__addCategories(newStudiesData["categories"]);
126146
}
127147
if (newStudiesData["linkedResource"] === "templates") {
128148
newStudiesData["resources"].forEach(templateData => {
@@ -134,13 +154,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
134154

135155
__addCategories: function(categories) {
136156
categories.forEach(category => {
137-
const categoryHeader = new qx.ui.basic.Label().set({
138-
value: category["label"],
139-
font: "text-16",
140-
rich: true,
141-
wrap: true,
142-
});
143-
categoryHeader.id = category["id"];
157+
const categoryHeader = this.self().createHeader(category["title"], null, category["description"]);
144158
this.add(categoryHeader);
145159
});
146160
},

services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ qx.Class.define("osparc.dashboard.NewStudies", {
8282
this._add(noGroupContainer);
8383

8484
Array.from(this.__groups).forEach(group => {
85-
const groupContainer = this.__createGroupContainer(group.id, group.label, "transparent");
85+
const groupContainer = this.__createGroupContainer(group.id, group.title, "transparent");
8686
this._add(groupContainer);
8787
});
8888
} else {

services/static-webserver/client/source/class/osparc/form/PortInfoHint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ qx.Class.define("osparc.form.PortInfoHint", {
4040
}
4141
this.setHintText(text);
4242
this.set({
43-
source: errorMsg ? this.self().ERROR_ICON : osparc.ui.hint.InfoHint.INFO_ICON,
43+
source: errorMsg ? this.self().ERROR_ICON : osparc.ui.hint.InfoHint.INFO_ICON + "/14",
4444
textColor: errorMsg ? "failed-red" : "text"
4545
});
4646
}

services/static-webserver/client/source/class/osparc/ui/hint/InfoHint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ qx.Class.define("osparc.ui.hint.InfoHint", {
2525
* @extends osparc.ui.basic.IconButton
2626
*/
2727
construct: function(hintText) {
28-
this.base(arguments, this.self().INFO_ICON);
28+
this.base(arguments, this.self().INFO_ICON + "/14");
2929

3030
this.__createHint();
3131

@@ -39,7 +39,7 @@ qx.Class.define("osparc.ui.hint.InfoHint", {
3939
},
4040

4141
statics: {
42-
INFO_ICON: "@MaterialIcons/info_outline/14"
42+
INFO_ICON: "@MaterialIcons/info_outline"
4343
},
4444

4545
properties: {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ qx.Class.define("osparc.utils.Utils", {
8989
}
9090
},
9191

92-
FLOATING_Z_INDEX: 110000,
92+
FLOATING_Z_INDEX: 1000001 + 1,
9393

9494
updateTabName: function(name) {
9595
document.title = name;
@@ -958,10 +958,10 @@ qx.Class.define("osparc.utils.Utils", {
958958
},
959959

960960
cookie: {
961-
setCookie: (cname, cvalue, exdays) => {
962-
if (exdays) {
961+
setCookie: (cname, cvalue, expDays) => {
962+
if (expDays) {
963963
const d = new Date();
964-
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
964+
d.setTime(d.getTime() + (expDays * 24 * 60 * 60 * 1000));
965965
document.cookie = cname + "=" + cvalue + ";Expires=" + d.toUTCString() + ";path=/";
966966
} else {
967967
document.cookie = cname + "=" + cvalue + ";path=/";

services/static-webserver/client/source/resource/osparc/new_studies.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@
4949
}],
5050
"categories": [{
5151
"id": "precomputed",
52-
"label": "Precomputed"
52+
"title": "Precomputed"
5353
}, {
5454
"id": "personalized",
55-
"label": "Personalized: In the process, TIP will launch simulations on AWS.<br>The associated resource costs will be deduced from your Credits."
55+
"title": "Personalized",
56+
"description": "In the process, TIP will launch simulations on AWS.<br>The associated resource costs will be deduced from your Credits."
5657
}]
5758
},
5859
"tiplite": {
@@ -110,10 +111,11 @@
110111
}],
111112
"categories": [{
112113
"id": "precomputed",
113-
"label": "Precomputed"
114+
"title": "Precomputed"
114115
}, {
115116
"id": "personalized",
116-
"label": "Personalized: In the process, TIP will launch simulations on AWS.<br>The associated resource costs will be deduced from your Credits."
117+
"title": "Personalized",
118+
"description": "In the process, TIP will launch simulations on AWS.<br>The associated resource costs will be deduced from your Credits."
117119
}]
118120
},
119121
"s4l": {

0 commit comments

Comments
 (0)