Skip to content

Commit 21f2405

Browse files
authored
🎨 [Frontend] Guided Tours: update to latest frontend (ITISFoundation#7311)
1 parent 6835b03 commit 21f2405

File tree

12 files changed

+216
-93
lines changed

12 files changed

+216
-93
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
7070
spacingX: 20,
7171
});
7272

73+
osparc.utils.Utils.setIdToWidget(this, "newPlusMenu");
74+
7375
this.getContentElement().setStyles({
7476
"border-color": qx.theme.manager.Color.getInstance().resolve("strong-main"),
7577
});
@@ -207,17 +209,9 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
207209
__addIcon: function(menuButton, resourceInfo, resourceMetadata) {
208210
let source = null;
209211
if (resourceInfo && resourceInfo["icon"]) {
210-
// first the one set in the ui_config
211212
source = resourceInfo["icon"];
212-
} else if (resourceMetadata && resourceMetadata["icon"]) {
213-
// second the icon from the resource
214-
source = resourceMetadata["icon"];
215-
} else if (resourceMetadata && resourceMetadata["thumbnail"]) {
216-
// third the thumbnail from the resource
217-
source = resourceMetadata["thumbnail"];
218213
} else {
219-
// finally product icon
220-
source = osparc.dashboard.CardBase.PRODUCT_ICON;
214+
source = osparc.utils.Utils.getIconFromResource(resourceMetadata);
221215
}
222216

223217
if (source) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,13 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
188188
});
189189
win.center();
190190
win.open();
191-
win.addListenerOnce("close", () => {
191+
win.addListener("changeConfirmed", e => {
192192
if (win.getConfirmed()) {
193193
this.openUpdateServices();
194194
} else {
195195
this.__openResource();
196196
}
197+
win.close();
197198
});
198199
},
199200

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ qx.Class.define("osparc.dashboard.ResourceUpgradeHelper", {
3737
this.bind("secondaryText", secondaryButton, "label");
3838
secondaryButton.addListener("execute", () => {
3939
this.setConfirmed(false);
40-
this.close(1);
4140
}, this);
4241
this.addButton(secondaryButton);
4342

@@ -50,7 +49,6 @@ qx.Class.define("osparc.dashboard.ResourceUpgradeHelper", {
5049
this.bind("primaryText", primaryButton, "label");
5150
primaryButton.addListener("execute", () => {
5251
this.setConfirmed(true);
53-
this.close(1);
5452
}, this);
5553
const command = new qx.ui.command.Command("Enter");
5654
primaryButton.setCommand(command);
@@ -86,7 +84,8 @@ qx.Class.define("osparc.dashboard.ResourceUpgradeHelper", {
8684

8785
confirmed: {
8886
check: "Boolean",
89-
init: false
87+
init: null,
88+
event: "changeConfirmed"
9089
}
9190
},
9291

‎services/static-webserver/client/source/class/osparc/desktop/credits/CreditsServiceListItem.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ qx.Class.define("osparc.desktop.credits.CreditsServiceListItem", {
3333
const name = this.getChildControl("title");
3434
const serviceMetadata = osparc.service.Utils.getLatest(serviceKey);
3535
if (serviceMetadata) {
36-
icon.setSource(serviceMetadata["thumbnail"] ? serviceMetadata["thumbnail"] : osparc.dashboard.CardBase.PRODUCT_THUMBNAIL);
36+
const source = osparc.utils.Utils.getIconFromResource(serviceMetadata);
37+
icon.setSource(source);
3738
name.setValue(serviceMetadata["name"]);
3839
} else {
3940
icon.setSource(osparc.dashboard.CardBase.PRODUCT_THUMBNAIL);

‎services/static-webserver/client/source/class/osparc/product/tours/Tours.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ qx.Class.define("osparc.product.tours.Tours", {
2626

2727
statics: {
2828
TOURS: {
29-
"s4llite": {
30-
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/s4llite_tours.json")
29+
"osparc": {
30+
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/osparc_tours.json")
3131
},
3232
"s4l": {
3333
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/s4l_tours.json")
3434
},
35+
"s4lacad": {
36+
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/s4l_tours.json")
37+
},
38+
"s4llite": {
39+
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/s4llite_tours.json")
40+
},
3541
"tis": {
3642
fetchTours: () => osparc.product.tours.Tours.fetchTours("/resource/osparc/tours/tis_tours.json")
3743
},

‎services/static-webserver/client/source/class/osparc/service/StatusUI.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ qx.Class.define("osparc.service.StatusUI", {
235235
const chip = new osparc.ui.basic.Chip().set({
236236
label: osparc.service.Utils.DEPRECATED_SERVICE_TEXT,
237237
icon: osparc.service.StatusUI.getIconSource("deprecated"),
238-
textColor: "contrasted-text-dark",
238+
textColor: "text-on-warning",
239239
backgroundColor: osparc.service.StatusUI.getColor("deprecated"),
240240
allowGrowX: false
241241
});
@@ -246,7 +246,7 @@ qx.Class.define("osparc.service.StatusUI", {
246246
const chip = new osparc.ui.basic.Chip().set({
247247
label: osparc.service.Utils.RETIRED_SERVICE_TEXT,
248248
icon: osparc.service.StatusUI.getIconSource("retired"),
249-
textColor: "contrasted-text-dark",
249+
textColor: "text-on-warning",
250250
backgroundColor: osparc.service.StatusUI.getColor("retired"),
251251
allowGrowX: false
252252
});

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,25 @@ qx.Class.define("osparc.service.Utils", {
234234
},
235235

236236
isDeprecated: function(metadata) {
237-
if (metadata && "deprecated" in metadata && ![null, undefined].includes(metadata["deprecated"])) {
238-
const deprecationTime = new Date(metadata["deprecated"]);
237+
if (metadata && "retired" in metadata && ![null, undefined].includes(metadata["retired"])) {
238+
const deprecationTime = new Date(metadata["retired"]);
239239
const now = new Date();
240240
return deprecationTime.getTime() > now.getTime();
241241
}
242242
return false;
243243
},
244244

245245
isRetired: function(metadata) {
246-
if (metadata && "deprecated" in metadata && ![null, undefined].includes(metadata["deprecated"])) {
247-
const deprecationTime = new Date(metadata["deprecated"]);
246+
if (metadata && "retired" in metadata && ![null, undefined].includes(metadata["retired"])) {
247+
const deprecationTime = new Date(metadata["retired"]);
248248
const now = new Date();
249249
return deprecationTime.getTime() < now.getTime();
250250
}
251251
return false;
252252
},
253253

254254
getDeprecationDateText: function(metadata) {
255-
const deprecationTime = new Date(metadata["deprecated"]);
255+
const deprecationTime = new Date(metadata["retired"]);
256256
return qx.locale.Manager.tr("It will be Retired: ") + osparc.utils.Utils.formatDate(deprecationTime);
257257
},
258258

‎services/static-webserver/client/source/class/osparc/tours/Manager.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ qx.Class.define("osparc.tours.Manager", {
6666
switch (id) {
6767
case "intro-text":
6868
control = new qx.ui.basic.Label().set({
69-
value: this.tr("This collection of Guided Tours will show you how to use the framework:"),
69+
value: this.tr("This collection of Guided Tours will show you how to use the platform:"),
7070
rich: true,
7171
wrap: true,
7272
font: "text-14"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ qx.Class.define("osparc.utils.Utils", {
111111
return newName;
112112
},
113113

114+
getIconFromResource: function(resourceMetadata) {
115+
if (resourceMetadata) {
116+
if (resourceMetadata["icon"]) {
117+
return resourceMetadata["icon"];
118+
}
119+
if (resourceMetadata["thumbnail"]) {
120+
return resourceMetadata["thumbnail"];
121+
}
122+
}
123+
return osparc.dashboard.CardBase.PRODUCT_ICON;
124+
},
125+
114126
isEmail: function(value) {
115127
const reg = /^([A-Za-z0-9_\-.+])+@([A-Za-z0-9_\-.])+\.([A-Za-z]{2,})$/;
116128
return reg.test(value);
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"studies": {
3+
"id": "studies",
4+
"name": "Studies",
5+
"description": "All you need to know about Study handling",
6+
"context": "osparc-test-id=newPlusBtn",
7+
"steps": [{
8+
"beforeClick": {
9+
"selector": "osparc-test-id=newPlusBtn",
10+
"action": "open"
11+
},
12+
"anchorEl": "osparc-test-id=newPlusMenu",
13+
"title": "Create Studies",
14+
"text": "Clicking on the (+) New button, allows you to create new Studies or new Folders to organize the studies",
15+
"placement": "right"
16+
}, {
17+
"anchorEl": "osparc-test-id=searchBarFilter-textField-study",
18+
"title": "Filter and Search",
19+
"text": "This tool allows you to search Studies, Tutorials and Services.<br>You can search and filter by:<br>- Title, description, owner, id...<br>- Tags<br>- Shared with",
20+
"placement": "bottom"
21+
}, {
22+
"beforeClick": {
23+
"selector": "osparc-test-id=studyItemMenuButton",
24+
"action": "open"
25+
},
26+
"anchorEl": "osparc-test-id=studyItemMenuMenu",
27+
"title": "More options button",
28+
"text": "On the Study card, you can use the three dots button to access more information and operation on the Study.",
29+
"placement": "left"
30+
}, {
31+
"anchorEl": "osparc-test-id=updateStudyBtn",
32+
"title": "Update Services",
33+
"text": "On the Study card, you can use the Update button to update the corresponding service to the latest version.",
34+
"placement": "bottom"
35+
}]
36+
},
37+
"dashboard": {
38+
"id": "dashboard",
39+
"name": "Dashboard",
40+
"description": "Introduction to the Dashboard tabs",
41+
"context": "osparc-test-id=dashboardTabs",
42+
"steps": [{
43+
"anchorEl": "osparc-test-id=dashboardTabs",
44+
"title": "Dashboard Menu",
45+
"text": "The menu tabs give you quick access to a set of core elements of the platform, namely Studies, Templates, Services and Data.",
46+
"placement": "bottom"
47+
}, {
48+
"beforeClick": {
49+
"selector": "osparc-test-id=studiesTabBtn"
50+
},
51+
"anchorEl": "osparc-test-id=studiesTabBtn",
52+
"text": "Any Study is accessible via the Dashboard. The Studies, which belong to or are shared with you, can be found here. You can also create Folders to help you organize the Studies",
53+
"placement": "bottom"
54+
}, {
55+
"beforeClick": {
56+
"selector": "osparc-test-id=templatesTabBtn"
57+
},
58+
"anchorEl": "osparc-test-id=templatesTabBtn",
59+
"text": "Clicking on a Template will create a copy of that Study, which will appear in your own Studies tab with the same name as the Template. Any changes you make to this copy will not affect the original Template.",
60+
"placement": "bottom"
61+
}, {
62+
"beforeClick": {
63+
"selector": "osparc-test-id=servicesTabBtn"
64+
},
65+
"anchorEl": "osparc-test-id=servicesTabBtn",
66+
"text": "Every Study in oSparc is composed of so-called Services.<br>These are building blocks for Studies and can provide data/files, visualize results (2D, 3D), implement code in Jupyter notebooks or perform computations to execute simulations within a Study.",
67+
"placement": "bottom"
68+
}, {
69+
"beforeClick": {
70+
"selector": "osparc-test-id=dataTabBtn"
71+
},
72+
"anchorEl": "osparc-test-id=dataTabBtn",
73+
"text": "All the Data of the Studies you have access to can bre explored here.",
74+
"placement": "bottom"
75+
}]
76+
},
77+
"navbar": {
78+
"id": "navbar",
79+
"name": "Navigation Bar",
80+
"description": "Introduction to the Navigation Bar",
81+
"context": "osparc-test-id=navigationBar",
82+
"steps": [{
83+
"beforeClick": {
84+
"selector": "osparc-test-id=notificationsButton",
85+
"event": "tap"
86+
},
87+
"anchorEl": "osparc-test-id=notificationsContainer",
88+
"text": "By clicking on the Bell, you will you see notifications about which Studies, Templates and Organizations have been shared with you.",
89+
"placement": "bottom"
90+
}, {
91+
"beforeClick": {
92+
"selector": "osparc-test-id=helpNavigationBtn",
93+
"action": "open"
94+
},
95+
"anchorEl": "osparc-test-id=helpNavigationMenu",
96+
"text": "Under the question mark, you will find Manuals, Support and ways to give us Feedback. It also provides quick access to other Guided Tours.",
97+
"placement": "left"
98+
}, {
99+
"beforeClick": {
100+
"selector": "osparc-test-id=userMenuBtn",
101+
"action": "open"
102+
},
103+
"anchorEl": "osparc-test-id=userMenuMenu",
104+
"text": "The User Menu gives you access to Your Account, Organizations and more.",
105+
"placement": "left"
106+
}]
107+
}
108+
}

0 commit comments

Comments
 (0)