From 0120211dd503c762314d65fc3a3e6c2fbc88ffb8 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 29 Oct 2024 09:55:54 +0100 Subject: [PATCH 1/3] OpenLocationMenuButton --- .../source/class/osparc/dashboard/StudyBrowser.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 91499e44ce7..4244b24d5ca 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -1276,6 +1276,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { menu.add(openButton); } + if (this.getCurrentContext() === "search") { + const renameStudyButton = this.__getOpenLocationMenuButton(studyData); + menu.add(renameStudyButton); + } + if (writeAccess) { const renameStudyButton = this.__getRenameStudyMenuButton(studyData); menu.add(renameStudyButton); @@ -1339,6 +1344,14 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { card.evaluateMenuButtons(); }, + __getOpenLocationMenuButton: function(studyData) { + const openLocationButton = new qx.ui.menu.Button(this.tr("Open location"), "@FontAwesome5Solid/external-link-alt/12"); + openLocationButton.addListener("execute", () => { + this.__changeContext("studiesAndFolders", studyData["workspaceId"], studyData["folderId"]); + }, this); + return openLocationButton; + }, + __getRenameStudyMenuButton: function(studyData) { const renameButton = new qx.ui.menu.Button(this.tr("Rename..."), "@FontAwesome5Solid/pencil-alt/12"); renameButton.addListener("execute", () => { From 11861e0bac6d62bbd811301473ff4e64c51ce39c Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 29 Oct 2024 10:14:18 +0100 Subject: [PATCH 2/3] unused --- .../class/osparc/dashboard/StudyBrowser.js | 16 ---------------- 1 file changed, 16 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 4244b24d5ca..07a45bf745b 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -90,22 +90,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { } }, - statics: { - sortFoldersList: function(foldersList, propKey) { - const sortByProperty = prop => { - return function(a, b) { - const upKey = qx.lang.String.firstUp(prop); - const getter = "get" + upKey; - if (getter in a && getter in b) { - return b[getter]() - a[getter](); - } - return 0; - }; - }; - foldersList.sort(sortByProperty(propKey || "lastModified")); - } - }, - members: { __dontShowTutorial: null, __header: null, From 7e2e085311dcfc5065a6a2158d972fda67ce442f Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 29 Oct 2024 10:17:11 +0100 Subject: [PATCH 3/3] Don't show new folders in search context --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 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 07a45bf745b..7f79e02f3b1 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -405,11 +405,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, __addNewFolderButton: function() { + if (this.getCurrentContext() !== "studiesAndFolders") { + return; + } const currentWorkspaceId = this.getCurrentWorkspaceId(); if (currentWorkspaceId) { - if (this.getCurrentContext() !== "studiesAndFolders") { - return; - } const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId()); if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) { // If user can't write in workspace, do not show plus button