Skip to content

Commit

Permalink
🎨 [Frontend] TIP lite: add teaser button (#6359)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Sep 13, 2024
1 parent 5ebce8d commit 4699e19
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
},

members: {
__dontShowTutorial: null,
__currentRequest: null,
__workspacesList: null,
__foldersList: null,
Expand Down Expand Up @@ -240,7 +241,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
const quickStartInfo = osparc.product.quickStart.Utils.getQuickStart();
if (quickStartInfo) {
const dontShow = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
if (dontShow === "true") {
if (dontShow === "true" || this.__dontShowTutorial) {
return;
}
const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0;
Expand All @@ -252,6 +253,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
const quickStartWindow = quickStartInfo.tutorial();
quickStartWindow.center();
quickStartWindow.open();
quickStartWindow.addListener("close", () => {
this.__dontShowTutorial = true;
}, this);
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ qx.Class.define("osparc.navigation.NavigationBar", {
this.getChildControl("read-only-info");

// right-items
if (osparc.product.Utils.isProduct("tiplite")) {
this.getChildControl("tip-lite-button");
}
this.getChildControl("tasks-button");
this.getChildControl("notifications-button");
this.getChildControl("expiration-icon");
Expand Down Expand Up @@ -228,16 +231,14 @@ qx.Class.define("osparc.navigation.NavigationBar", {
this.getChildControl("center-items").add(control);
break;
}
case "credits-menu-button": {
const currentUsage = new osparc.desktop.credits.CurrentUsage();
control = new osparc.navigation.CreditsMenuButton().set({
appearance: "fab-button",
currentUsage,
maxHeight: this.self().HEIGHT
case "tip-lite-button":
control = new qx.ui.form.Button(this.tr("Access TIP")).set({
marginRight: 30,
...this.self().BUTTON_OPTIONS,
});
control.addListener("execute", () => osparc.product.TIPTeaser.getInstance().open());
this.getChildControl("right-items").add(control);
break;
}
case "credits-button":
control = new osparc.desktop.credits.CreditsIndicatorButton();
this.getChildControl("right-items").add(control);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* ************************************************************************
osparc - the simcore frontend
https://osparc.io
Copyright:
2023 IT'IS Foundation, https://itis.swiss
License:
MIT: https://opensource.org/licenses/MIT
Authors:
* Odei Maiz (odeimaiz)
************************************************************************ */

qx.Class.define("osparc.product.TIPTeaser", {
extend: osparc.ui.window.Window,
type: "singleton",

construct: function() {
this.base(arguments, this.tr("Access TIP"));

this.set({
layout: new qx.ui.layout.VBox(10),
width: this.self().WIDTH,
contentPadding: this.self().PADDING,
showMaximize: false,
showMinimize: false,
resizable: true,
centerOnAppear: true,
clickAwayClose: true,
modal: true
});

this.getChildControl("teaser-text");
},

statics: {
WIDTH: 500,
PADDING: 15
},

members: {
_createChildControlImpl: function(id) {
let control;
switch (id) {
case "teaser-text": {
const link1 = osparc.utils.Utils.createHTMLLink("Request Full TIP Access", "https://tip.science/");
const link2 = osparc.utils.Utils.createHTMLLink("Learn More About EAP", "https://temporalinterference.com/");
const text = this.tr(`
Unlock the Full Potential of TI Research!<br>
<br>
Are you part of the TI Solutions Early Adopter Program (EAP)?<br>
<br>
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>
<br>
Not an EAP member yet? Join our cutting-edge research community:<br>
• Use our investigational TIBS-R devices in your projects<br>
• Contribute to advancing TI knowledge<br>
• Shape the future of neurostimulation technology<br>
<br>
Click here to learn more about EAP and apply today!<br>
<br>
${link1}&nbsp&nbsp&nbsp${link2}
`);
control = new qx.ui.basic.Label(text).set({
font: "text-14",
wrap: true,
rich: true,
});
this.add(control);
break;
}
}
return control || this.base(arguments, id);
},
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ qx.Class.define("osparc.product.quickStart.tis.S4LPostPro", {
extend: osparc.product.quickStart.SlideBase,

construct: function() {
const title = this.tr("Sim4Life Post Processing");
let title = "";
if (osparc.product.Utils.isProduct("tiplite")) {
title += "<i>" + this.tr("(Not available in TIP lite)") + "</i><br><br>";
}
title += this.tr("Sim4Life Post Processing");
this.base(arguments, title);
},

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

0 comments on commit 4699e19

Please sign in to comment.