From cd8a2b8e95048d2ec62843679c9ac8cdba797ebe Mon Sep 17 00:00:00 2001 From: Odei Maiz <33152403+odeimaiz@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:19:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[Frontend]=20Access=20Full=20TIP?= =?UTF-8?q?=20(#6423)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class/osparc/dashboard/StudyBrowser.js | 3 +-- .../class/osparc/navigation/NavigationBar.js | 19 ++++++--------- .../class/osparc/navigation/UserMenu.js | 24 ++++++++++++++----- .../source/class/osparc/product/TIPTeaser.js | 2 +- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js index 97c5638abd2..e6702256934 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -794,8 +794,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { if (product in newStudiesData) { const mode = this._resourcesContainer.getMode(); const title = this.tr("New Plan"); - const desc = this.tr("Choose Plan in pop-up"); - const newStudyBtn = (mode === "grid") ? new osparc.dashboard.GridButtonNew(title, desc) : new osparc.dashboard.ListButtonNew(title, desc); + const newStudyBtn = (mode === "grid") ? new osparc.dashboard.GridButtonNew(title) : new osparc.dashboard.ListButtonNew(title); newStudyBtn.setCardKey("new-study"); newStudyBtn.subscribeToFilterGroup("searchBarFilter"); osparc.utils.Utils.setIdToWidget(newStudyBtn, "newStudyBtn"); diff --git a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js index 4353cd497f0..f926f95b6e0 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js +++ b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js @@ -133,9 +133,6 @@ 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"); @@ -186,6 +183,13 @@ qx.Class.define("osparc.navigation.NavigationBar", { width: osparc.product.Utils.isS4LProduct() ? 150 : 100, height: osparc.navigation.NavigationBar.HEIGHT }); + if (osparc.product.Utils.isProduct("tiplite")) { + control.set({ + cursor: "pointer", + toolTipText: this.tr("This is TIP.lite, a light version of TIP.
Request access to TIP.") + }); + control.addListener("tap", () => osparc.product.TIPTeaser.getInstance().open()); + } this.getChildControl("left-items").add(control); break; case "logo-powered": @@ -231,15 +235,6 @@ qx.Class.define("osparc.navigation.NavigationBar", { this.getChildControl("center-items").add(control); break; } - case "tip-lite-button": - control = new qx.ui.form.Button(this.tr("Access TIP")).set({ - marginRight: 30, - ...this.self().BUTTON_OPTIONS, - }); - osparc.utils.Utils.setIdToWidget(control, "accessTIPBtn"); - 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); diff --git a/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js b/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js index b226a949ae3..3c92dae0659 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js +++ b/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js @@ -95,12 +95,6 @@ qx.Class.define("osparc.navigation.UserMenu", { control.addListener("execute", () => osparc.cluster.Utils.popUpClustersDetails(), this); this.add(control); break; - case "license": - control = new qx.ui.menu.Button(this.tr("License")); - osparc.store.Support.getLicenseURL() - .then(licenseURL => control.addListener("execute", () => window.open(licenseURL))); - this.add(control); - break; case "about": control = new qx.ui.menu.Button(this.tr("About oSPARC")); control.addListener("execute", () => osparc.About.getInstance().open()); @@ -116,6 +110,18 @@ qx.Class.define("osparc.navigation.UserMenu", { this.add(control); break; } + case "license": + control = new qx.ui.menu.Button(this.tr("License")); + osparc.store.Support.getLicenseURL() + .then(licenseURL => control.addListener("execute", () => window.open(licenseURL))); + this.add(control); + break; + case "tip-lite-button": + control = new qx.ui.menu.Button(this.tr("Access Full TIP")); + osparc.utils.Utils.setIdToWidget(control, "userMenuAccessTIPBtn"); + control.addListener("execute", () => osparc.product.TIPTeaser.getInstance().open()); + this.add(control); + break; case "log-out": { const authData = osparc.auth.Data.getInstance(); control = new qx.ui.menu.Button(authData.isGuest() ? this.tr("Exit") : this.tr("Log out")); @@ -167,6 +173,9 @@ qx.Class.define("osparc.navigation.UserMenu", { this.getChildControl("about-product"); } this.getChildControl("license"); + if (osparc.product.Utils.isProduct("tiplite")) { + this.getChildControl("tip-lite-button"); + } this.addSeparator(); this.getChildControl("log-out"); @@ -220,6 +229,9 @@ qx.Class.define("osparc.navigation.UserMenu", { this.getChildControl("about-product"); } this.getChildControl("license"); + if (osparc.product.Utils.isProduct("tiplite")) { + this.getChildControl("tip-lite-button"); + } this.addSeparator(); this.getChildControl("log-out"); diff --git a/services/static-webserver/client/source/class/osparc/product/TIPTeaser.js b/services/static-webserver/client/source/class/osparc/product/TIPTeaser.js index aac97d48eeb..d71ac819f3b 100644 --- a/services/static-webserver/client/source/class/osparc/product/TIPTeaser.js +++ b/services/static-webserver/client/source/class/osparc/product/TIPTeaser.js @@ -20,7 +20,7 @@ qx.Class.define("osparc.product.TIPTeaser", { type: "singleton", construct: function() { - this.base(arguments, this.tr("Access TIP")); + this.base(arguments, this.tr("Access Full TIP")); this.set({ layout: new qx.ui.layout.VBox(10),