Skip to content

Commit 4699e19

Browse files
authored
🎨 [Frontend] TIP lite: add teaser button (#6359)
1 parent 5ebce8d commit 4699e19

File tree

4 files changed

+101
-9
lines changed

4 files changed

+101
-9
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
100100
},
101101

102102
members: {
103+
__dontShowTutorial: null,
103104
__currentRequest: null,
104105
__workspacesList: null,
105106
__foldersList: null,
@@ -240,7 +241,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
240241
const quickStartInfo = osparc.product.quickStart.Utils.getQuickStart();
241242
if (quickStartInfo) {
242243
const dontShow = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
243-
if (dontShow === "true") {
244+
if (dontShow === "true" || this.__dontShowTutorial) {
244245
return;
245246
}
246247
const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0;
@@ -252,6 +253,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
252253
const quickStartWindow = quickStartInfo.tutorial();
253254
quickStartWindow.center();
254255
quickStartWindow.open();
256+
quickStartWindow.addListener("close", () => {
257+
this.__dontShowTutorial = true;
258+
}, this);
255259
}
256260
}
257261
})

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ qx.Class.define("osparc.navigation.NavigationBar", {
133133
this.getChildControl("read-only-info");
134134

135135
// right-items
136+
if (osparc.product.Utils.isProduct("tiplite")) {
137+
this.getChildControl("tip-lite-button");
138+
}
136139
this.getChildControl("tasks-button");
137140
this.getChildControl("notifications-button");
138141
this.getChildControl("expiration-icon");
@@ -228,16 +231,14 @@ qx.Class.define("osparc.navigation.NavigationBar", {
228231
this.getChildControl("center-items").add(control);
229232
break;
230233
}
231-
case "credits-menu-button": {
232-
const currentUsage = new osparc.desktop.credits.CurrentUsage();
233-
control = new osparc.navigation.CreditsMenuButton().set({
234-
appearance: "fab-button",
235-
currentUsage,
236-
maxHeight: this.self().HEIGHT
234+
case "tip-lite-button":
235+
control = new qx.ui.form.Button(this.tr("Access TIP")).set({
236+
marginRight: 30,
237+
...this.self().BUTTON_OPTIONS,
237238
});
239+
control.addListener("execute", () => osparc.product.TIPTeaser.getInstance().open());
238240
this.getChildControl("right-items").add(control);
239241
break;
240-
}
241242
case "credits-button":
242243
control = new osparc.desktop.credits.CreditsIndicatorButton();
243244
this.getChildControl("right-items").add(control);
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2023 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
qx.Class.define("osparc.product.TIPTeaser", {
19+
extend: osparc.ui.window.Window,
20+
type: "singleton",
21+
22+
construct: function() {
23+
this.base(arguments, this.tr("Access TIP"));
24+
25+
this.set({
26+
layout: new qx.ui.layout.VBox(10),
27+
width: this.self().WIDTH,
28+
contentPadding: this.self().PADDING,
29+
showMaximize: false,
30+
showMinimize: false,
31+
resizable: true,
32+
centerOnAppear: true,
33+
clickAwayClose: true,
34+
modal: true
35+
});
36+
37+
this.getChildControl("teaser-text");
38+
},
39+
40+
statics: {
41+
WIDTH: 500,
42+
PADDING: 15
43+
},
44+
45+
members: {
46+
_createChildControlImpl: function(id) {
47+
let control;
48+
switch (id) {
49+
case "teaser-text": {
50+
const link1 = osparc.utils.Utils.createHTMLLink("Request Full TIP Access", "https://tip.science/");
51+
const link2 = osparc.utils.Utils.createHTMLLink("Learn More About EAP", "https://temporalinterference.com/");
52+
const text = this.tr(`
53+
Unlock the Full Potential of TI Research!<br>
54+
<br>
55+
Are you part of the TI Solutions Early Adopter Program (EAP)?<br>
56+
<br>
57+
If yes, you have free access to our complete TIP platform with advanced features for TI planning and simulations. Click here to request access.<br>
58+
<br>
59+
Not an EAP member yet? Join our cutting-edge research community:<br>
60+
• Use our investigational TIBS-R devices in your projects<br>
61+
• Contribute to advancing TI knowledge<br>
62+
• Shape the future of neurostimulation technology<br>
63+
<br>
64+
Click here to learn more about EAP and apply today!<br>
65+
<br>
66+
${link1}&nbsp&nbsp&nbsp${link2}
67+
`);
68+
control = new qx.ui.basic.Label(text).set({
69+
font: "text-14",
70+
wrap: true,
71+
rich: true,
72+
});
73+
this.add(control);
74+
break;
75+
}
76+
}
77+
return control || this.base(arguments, id);
78+
},
79+
}
80+
});

services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@ qx.Class.define("osparc.product.quickStart.tis.S4LPostPro", {
1919
extend: osparc.product.quickStart.SlideBase,
2020

2121
construct: function() {
22-
const title = this.tr("Sim4Life Post Processing");
22+
let title = "";
23+
if (osparc.product.Utils.isProduct("tiplite")) {
24+
title += "<i>" + this.tr("(Not available in TIP lite)") + "</i><br><br>";
25+
}
26+
title += this.tr("Sim4Life Post Processing");
2327
this.base(arguments, title);
2428
},
2529

2630
members: {
2731
_populateCard: function() {
32+
if (osparc.product.Utils.isProduct("tiplite")) {
33+
this.setEnabled(false);
34+
}
2835
const text1 = this.tr("\
2936
Finally, and optionally, exposure conditions-of-interest can be visualized and analyzed freely, using the web-version of the \
3037
Sim4Life (ZMT Zurich MedTech AG) computational life sciences platform.\

0 commit comments

Comments
 (0)