diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceFilter.js index 2b35fcad22d..a2a69c32940 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceFilter.js @@ -419,8 +419,8 @@ qx.Class.define("osparc.dashboard.ResourceFilter", { appearance: "filter-toggle-button" }); editTagsButton.addListener("execute", () => { - const preferencesWindow = osparc.desktop.preferences.PreferencesWindow.openWindow(); - preferencesWindow.openTags(); + const myAccountWindow = osparc.desktop.account.MyAccountWindow.openWindow(); + myAccountWindow.openTags(); }); layout.add(editTagsButton); diff --git a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js index 05d2c4d2bb0..a77f891f328 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js +++ b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js @@ -28,8 +28,20 @@ qx.Class.define("osparc.desktop.account.MyAccount", { this.__profilePage = this.__addProfilePage(); - if (osparc.data.Permissions.getInstance().canDo("usage.all.read")) { - this.__usagePage = this.__addUsagePage(); + // show Usage in My Account if wallets are not enabled. If they are enabled it will be in the BIlling Center + if (!osparc.desktop.credits.Utils.areWalletsEnabled()) { + if (osparc.data.Permissions.getInstance().canDo("usage.all.read")) { + this.__usagePage = this.__addUsagePage(); + } + } + + this.__addGeneralSettings(); + this.__addConfirmationSettings(); + if (osparc.product.Utils.showPreferencesTokens()) { + this.__addTokensPage(); + } + if (osparc.data.Permissions.getInstance().canDo("user.tag")) { + this.__addTagsPage(); } }, @@ -96,6 +108,7 @@ qx.Class.define("osparc.desktop.account.MyAccount", { members: { __profilePage: null, __usagePage: null, + __tagsPage: null, __addProfilePage: function() { const title = this.tr("Profile"); @@ -112,10 +125,39 @@ qx.Class.define("osparc.desktop.account.MyAccount", { const page = this.addTab(title, iconSrc, usageOverview); return page; }, + __addGeneralSettings: function() { + const title = this.tr("Settings"); + const iconSrc = "@FontAwesome5Solid/cogs/22"; + const generalPage = new osparc.desktop.preferences.pages.GeneralPage(); + this.addTab(title, iconSrc, generalPage); + }, - openProfile: function() { - this._openPage(this.__profilePage); - return true; - } + __addConfirmationSettings: function() { + const title = this.tr("Confirmations"); + const iconSrc = "@FontAwesome5Solid/question-circle/22"; + const confirmPage = new osparc.desktop.preferences.pages.ConfirmationsPage(); + this.addTab(title, iconSrc, confirmPage); + }, + + __addTokensPage: function() { + const title = this.tr("API Keys/Tokens"); + const iconSrc = "@FontAwesome5Solid/exchange-alt/22"; + const tokensPage = new osparc.desktop.preferences.pages.TokensPage(); + this.addTab(title, iconSrc, tokensPage); + }, + + __addTagsPage: function() { + const title = this.tr("Create/Edit Tags"); + const iconSrc = "@FontAwesome5Solid/tags/22"; + const tagsPage = new osparc.desktop.preferences.pages.TagsPage(); + const page = this.__tagsPage = this.addTab(title, iconSrc, tagsPage); + osparc.utils.Utils.setIdToWidget(page.getChildControl("button"), "preferencesTagsTabBtn"); + }, + + openTags: function() { + if (this.__tagsPage) { + this._openPage(this.__tagsPage); + } + }, } }); diff --git a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccountWindow.js b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccountWindow.js index a86eeeb9507..3dcaefa8160 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccountWindow.js +++ b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccountWindow.js @@ -21,7 +21,7 @@ qx.Class.define("osparc.desktop.account.MyAccountWindow", { construct: function() { this.base(arguments, "credits", this.tr("My Account")); - const width = 900; + const width = 990; const height = 700; const maxHeight = 700; this.set({ @@ -46,8 +46,8 @@ qx.Class.define("osparc.desktop.account.MyAccountWindow", { members: { __myAccount: null, - openProfile: function() { - return this.__myAccount.openProfile(); - } + openTags: function() { + this.__myAccount.openTags(); + }, } }); diff --git a/services/static-webserver/client/source/class/osparc/desktop/preferences/Preferences.js b/services/static-webserver/client/source/class/osparc/desktop/preferences/Preferences.js deleted file mode 100644 index 31f8de5590b..00000000000 --- a/services/static-webserver/client/source/class/osparc/desktop/preferences/Preferences.js +++ /dev/null @@ -1,73 +0,0 @@ -/* ************************************************************************ - - osparc - the simcore frontend - - https://osparc.io - - Copyright: - 2018 IT'IS Foundation, https://itis.swiss - - License: - MIT: https://opensource.org/licenses/MIT - - Authors: - * Odei Maiz (odeimaiz) - -************************************************************************ */ - -qx.Class.define("osparc.desktop.preferences.Preferences", { - extend: osparc.ui.window.TabbedView, - - construct: function() { - this.base(arguments); - - this.__addGeneralSettings(); - this.__addConfirmationSettings(); - if (osparc.product.Utils.showPreferencesTokens()) { - this.__addTokensPage(); - } - if (osparc.data.Permissions.getInstance().canDo("user.tag")) { - this.__addTagsPage(); - } - }, - - members: { - __tagsPage: null, - - __addGeneralSettings: function() { - const title = this.tr("General Settings"); - const iconSrc = "@FontAwesome5Solid/cogs/22"; - const generalPage = new osparc.desktop.preferences.pages.GeneralPage(); - this.addTab(title, iconSrc, generalPage); - }, - - __addConfirmationSettings: function() { - const title = this.tr("Confirmation Settings"); - const iconSrc = "@FontAwesome5Solid/question-circle/22"; - const confirmPage = new osparc.desktop.preferences.pages.ConfirmationsPage(); - this.addTab(title, iconSrc, confirmPage); - }, - - __addTokensPage: function() { - const title = this.tr("API Keys/Tokens"); - const iconSrc = "@FontAwesome5Solid/exchange-alt/22"; - const tokensPage = new osparc.desktop.preferences.pages.TokensPage(); - this.addTab(title, iconSrc, tokensPage); - }, - - __addTagsPage: function() { - const title = this.tr("Create/Edit Tags"); - const iconSrc = "@FontAwesome5Solid/tags/22"; - const tagsPage = new osparc.desktop.preferences.pages.TagsPage(); - const page = this.__tagsPage = this.addTab(title, iconSrc, tagsPage); - osparc.utils.Utils.setIdToWidget(page.getChildControl("button"), "preferencesTagsTabBtn"); - }, - - openTags: function() { - if (this.__tagsPage) { - this._openPage(this.__tagsPage); - return true; - } - }, - } -}); diff --git a/services/static-webserver/client/source/class/osparc/desktop/preferences/PreferencesWindow.js b/services/static-webserver/client/source/class/osparc/desktop/preferences/PreferencesWindow.js deleted file mode 100644 index 889a1e54c2e..00000000000 --- a/services/static-webserver/client/source/class/osparc/desktop/preferences/PreferencesWindow.js +++ /dev/null @@ -1,54 +0,0 @@ -/* ************************************************************************ - - osparc - the simcore frontend - - https://osparc.io - - Copyright: - 2018 IT'IS Foundation, https://itis.swiss - - License: - MIT: https://opensource.org/licenses/MIT - - Authors: - * Pedro Crespo (pcrespov) - -************************************************************************ */ - -qx.Class.define("osparc.desktop.preferences.PreferencesWindow", { - extend: osparc.ui.window.TabbedWindow, - - construct: function() { - this.base(arguments, "preferences", this.tr("Preferences")); - - const closeBtn = this.getChildControl("close-button"); - osparc.utils.Utils.setIdToWidget(closeBtn, "preferencesWindowCloseBtn"); - - const width = 750; - const height = 660; - this.set({ - width, - height - }); - - const preferences = this.__preferences = new osparc.desktop.preferences.Preferences(); - this._setTabbedView(preferences); - }, - - statics: { - openWindow: function() { - const preferencesWindow = new osparc.desktop.preferences.PreferencesWindow(); - preferencesWindow.center(); - preferencesWindow.open(); - return preferencesWindow; - } - }, - - members: { - __preferences: null, - - openTags: function() { - return this.__preferences.openTags(); - } - } -}); 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 b96841de7d9..a3369119b3e 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js +++ b/services/static-webserver/client/source/class/osparc/navigation/UserMenu.js @@ -77,12 +77,6 @@ qx.Class.define("osparc.navigation.UserMenu", { }, this); this.add(control); break; - case "preferences": - control = new qx.ui.menu.Button(this.tr("Preferences")); - control.addListener("execute", () => osparc.navigation.UserMenuButton.openPreferences(), this); - osparc.utils.Utils.setIdToWidget(control, "userMenuPreferencesBtn"); - this.add(control); - break; case "organizations": control = new qx.ui.menu.Button(this.tr("Organizations")).set({ visibility: osparc.data.Permissions.getInstance().canDo("user.organizations.create") ? "visible" :"excluded" @@ -162,7 +156,6 @@ qx.Class.define("osparc.navigation.UserMenu", { if (osparc.desktop.credits.Utils.areWalletsEnabled()) { this.getChildControl("billing-center"); } - this.getChildControl("preferences"); this.getChildControl("organizations"); } this.addSeparator(); @@ -217,7 +210,6 @@ qx.Class.define("osparc.navigation.UserMenu", { if (osparc.desktop.credits.Utils.areWalletsEnabled()) { this.getChildControl("billing-center"); } - this.getChildControl("preferences"); this.getChildControl("organizations"); } this.addSeparator(); diff --git a/services/static-webserver/client/source/class/osparc/navigation/UserMenuButton.js b/services/static-webserver/client/source/class/osparc/navigation/UserMenuButton.js index e1726533215..777834d2739 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/UserMenuButton.js +++ b/services/static-webserver/client/source/class/osparc/navigation/UserMenuButton.js @@ -70,13 +70,6 @@ qx.Class.define("osparc.navigation.UserMenuButton", { }); }, - statics: { - openPreferences: function() { - const preferencesWindow = osparc.desktop.preferences.PreferencesWindow.openWindow(); - return preferencesWindow; - } - }, - members: { __forceNullColor: null,