From 2dcf0b42a05722ff92e66bcab542168d3b4524ce Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 15:04:49 +0200 Subject: [PATCH 01/17] reset folders --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5fbc49b32f9..69a1c81ee35 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -178,7 +178,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { if (workspaceId === -1) { return; } - osparc.store.Folders.getInstance().fetchFolders(folderId, workspaceId) + this.__setFoldersToList([]); .then(folders => { this.__setFoldersToList(folders); }) From 40b1f0a10268481ab104fe37566c1cb59761c9c6 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 15:11:10 +0200 Subject: [PATCH 02/17] remove current request --- .../source/class/osparc/dashboard/StudyBrowser.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 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 69a1c81ee35..3ec51d75580 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -100,7 +100,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, members: { - __currentRequest: null, __workspacesList: null, __foldersList: null, @@ -179,7 +178,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { return; } this.__setFoldersToList([]); + const lastFoldersRequest = osparc.store.Folders.getInstance().fetchFolders(folderId, workspaceId) + lastFoldersRequest .then(folders => { + console.log("lastFoldersRequest", lastFoldersRequest); this.__setFoldersToList(folders); }) .catch(console.error); @@ -226,11 +228,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this._loadingResourcesBtn.setFetching(true); this._loadingResourcesBtn.setVisibility("visible"); - if (this.__currentRequest) { - // cancel currentRequest - } - const currentRequest = this.__currentRequest = this.__getNextStudiesRequest(); - currentRequest + this.__getNextStudiesRequest() .then(resp => { const studies = resp["data"]; this._resourcesContainer.getFlatList().nextRequest = resp["_links"]["next"]; @@ -257,7 +255,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }) .catch(err => console.error(err)) .finally(() => { - this.__currentRequest = null; this._loadingResourcesBtn.setFetching(false); this._loadingResourcesBtn.setVisibility(this._resourcesContainer.getFlatList().nextRequest === null ? "excluded" : "visible"); this._moreResourcesRequired(); From 16f4ff683fe6d81be73e2ff210909e024798c0f6 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 15:13:42 +0200 Subject: [PATCH 03/17] minor --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 4 +--- 1 file changed, 1 insertion(+), 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 3ec51d75580..3c2ce272742 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -178,10 +178,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { return; } this.__setFoldersToList([]); - const lastFoldersRequest = osparc.store.Folders.getInstance().fetchFolders(folderId, workspaceId) - lastFoldersRequest + osparc.store.Folders.getInstance().fetchFolders(folderId, workspaceId) .then(folders => { - console.log("lastFoldersRequest", lastFoldersRequest); this.__setFoldersToList(folders); }) .catch(console.error); From 367639aaca60a7ff870ea263472cbd6566e8be8c Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 16:02:31 +0200 Subject: [PATCH 04/17] if resolveWResponse, attach params --- .../client/source/class/osparc/data/Resources.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index 770b5b48d27..d4b5c86e6ac 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -1292,7 +1292,12 @@ qx.Class.define("osparc.data.Resources", { } } res.dispose(); - "resolveWResponse" in options && options.resolveWResponse ? resolve(response) : resolve(data); + if ("resolveWResponse" in options && options.resolveWResponse) { + response.params = params; + resolve(response); + } else { + resolve(data); + } }, this); res.addListenerOnce(endpoint + "Error", e => { From 64d12ae7521ed81a29ae6e2aa9041e8ad6143a70 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 16:04:35 +0200 Subject: [PATCH 05/17] lastParams --- .../class/osparc/dashboard/StudyBrowser.js | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 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 3c2ce272742..b3c18adb449 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -226,8 +226,19 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this._loadingResourcesBtn.setFetching(true); this._loadingResourcesBtn.setVisibility("visible"); - this.__getNextStudiesRequest() + const requestId = osparc.utils.Utils.uuidV4(); + const { + request, + params, + } = this.__getNextStudiesRequest(requestId); + const lastParams = params; + request .then(resp => { + if (resp["params"] !== lastParams) { + // another call has been made and this response can be ignored + return; + } + const studies = resp["data"]; this._resourcesContainer.getFlatList().nextRequest = resp["_links"]["next"]; this.__addStudiesToList(studies); @@ -654,12 +665,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { params.url.workspaceId = this.getCurrentWorkspaceId(); params.url.folderId = this.getCurrentFolderId(); + let request = null; if (params.url.orderBy) { - return osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); + request = osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); } else if (params.url.search) { - return osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options); + request = osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options); } - return osparc.data.Resources.fetch("studies", "getPage", params, undefined, options); + request = osparc.data.Resources.fetch("studies", "getPage", params, undefined, options); + return { + request, + params, + }; }, __getTextFilteredNextRequest: function(text) { From d0ee9654da1fba21cec538ffd874de503645ace7 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 17:16:03 +0200 Subject: [PATCH 06/17] rename file --- .../rowrenderer/{ExtendSelection.js => ExpandSelection.js} | 2 +- .../client/source/class/osparc/widget/logger/LoggerView.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/{ExtendSelection.js => ExpandSelection.js} (94%) diff --git a/services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExtendSelection.js b/services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExpandSelection.js similarity index 94% rename from services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExtendSelection.js rename to services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExpandSelection.js index b6ee1a62c17..60a0469c4c8 100644 --- a/services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExtendSelection.js +++ b/services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExpandSelection.js @@ -15,7 +15,7 @@ ************************************************************************ */ -qx.Class.define("osparc.ui.table.rowrenderer.ExtendSelection", { +qx.Class.define("osparc.ui.table.rowrenderer.ExpandSelection", { extend: qx.ui.table.rowrenderer.Default, members: { diff --git a/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js b/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js index b95a7434858..9b080b63c7e 100644 --- a/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js +++ b/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js @@ -286,7 +286,7 @@ qx.Class.define("osparc.widget.logger.LoggerView", { resizeBehavior.setWidth(this.self().POS.TIMESTAMP, 80); resizeBehavior.setWidth(this.self().POS.ORIGIN, 100); - table.setDataRowRenderer(new osparc.ui.table.rowrenderer.ExtendSelection(table)); + table.setDataRowRenderer(new osparc.ui.table.rowrenderer.ExpandSelection(table)); this.__applyFilters(); From 14774a0867e8b9732474b440fec7cdc6f658aa0d Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 13 Sep 2024 17:39:25 +0200 Subject: [PATCH 07/17] ignoring --- .../class/osparc/dashboard/StudyBrowser.js | 25 +++++++------------ 1 file changed, 9 insertions(+), 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 b3c18adb449..2e738bae89d 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -226,16 +226,14 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this._loadingResourcesBtn.setFetching(true); this._loadingResourcesBtn.setVisibility("visible"); - const requestId = osparc.utils.Utils.uuidV4(); - const { - request, - params, - } = this.__getNextStudiesRequest(requestId); - const lastParams = params; - request + this.__getNextStudiesRequest() .then(resp => { - if (resp["params"] !== lastParams) { + if ( + resp["params"]["url"].workspaceId !== this.getCurrentWorkspaceId() || + resp["params"]["url"].folderId !== this.getCurrentFolderId() + ) { // another call has been made and this response can be ignored + console.log("asdf ignore"); return; } @@ -665,17 +663,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { params.url.workspaceId = this.getCurrentWorkspaceId(); params.url.folderId = this.getCurrentFolderId(); - let request = null; if (params.url.orderBy) { - request = osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); + return osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); } else if (params.url.search) { - request = osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options); + return osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options); } - request = osparc.data.Resources.fetch("studies", "getPage", params, undefined, options); - return { - request, - params, - }; + return osparc.data.Resources.fetch("studies", "getPage", params, undefined, options); }, __getTextFilteredNextRequest: function(text) { From df95a3ff1734048c62eed650672fed1ed62786da Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 08:32:14 +0200 Subject: [PATCH 08/17] changeContext from Container Header --- .../class/osparc/dashboard/ContainerHeader.js | 31 +++++++++++++++---- .../class/osparc/dashboard/StudyBrowser.js | 8 +++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ContainerHeader.js b/services/static-webserver/client/source/class/osparc/dashboard/ContainerHeader.js index 6ae201b180f..339909c62bd 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ContainerHeader.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ContainerHeader.js @@ -31,12 +31,15 @@ qx.Class.define("osparc.dashboard.ContainerHeader", { })); }, + events: { + "changeContext": "qx.event.type.Data", + }, + properties: { currentWorkspaceId: { check: "Number", nullable: true, init: null, - event: "changeCurrentWorkspaceId", apply: "__buildBreadcrumbs" }, @@ -44,7 +47,6 @@ qx.Class.define("osparc.dashboard.ContainerHeader", { check: "Number", nullable: true, init: null, - event: "changeCurrentFolderId", apply: "__buildBreadcrumbs" } }, @@ -112,9 +114,16 @@ qx.Class.define("osparc.dashboard.ContainerHeader", { } else { rootButton = new qx.ui.form.Button(this.tr("My Workspace"), "@FontAwesome5Solid/home/14"); } - rootButton.addListener("execute", () => this.set({ - currentFolderId: null, - })); + rootButton.addListener("execute", () => { + const folderId = null; + this.set({ + currentFolderId: null, + }); + this.fireDataEvent("changeContext", { + workspaceId, + folderId, + }); + }); return rootButton; }, @@ -122,7 +131,17 @@ qx.Class.define("osparc.dashboard.ContainerHeader", { let folderButton = null; if (folder) { folderButton = new qx.ui.form.Button(folder.getName(), "@FontAwesome5Solid/folder/14"); - folderButton.addListener("execute", () => this.fireDataEvent("changeCurrentFolderId", folder ? folder.getFolderId() : null), this); + folderButton.addListener("execute", () => { + const workspaceId = this.getCurrentWorkspaceId(); + const folderId = folder ? folder.getFolderId() : null; + this.set({ + currentFolderId: folderId, + }); + this.fireDataEvent("changeContext", { + workspaceId, + folderId, + }); + }, this); } else { const workspaceId = this.getCurrentWorkspaceId(); folderButton = this.__createRootButton(workspaceId); 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 263e8fe37e5..6e81167ca8d 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -873,8 +873,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { onUpdate: () => containerHeader.setCurrentFolderId(null) }); this.bind("currentFolderId", containerHeader, "currentFolderId"); - containerHeader.bind("currentFolderId", this, "currentFolderId", { - onUpdate: () => this._changeContext(this.getCurrentWorkspaceId(), this.getCurrentFolderId()) + containerHeader.addListener("changeContext", e => { + const { + workspaceId, + folderId, + } = e.getData(); + this._changeContext(workspaceId, folderId); }); } const list = this._resourcesContainer.getFlatList(); From fd4a8cd2107d049e544bf4da63d4265cab643904 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 08:35:30 +0200 Subject: [PATCH 09/17] minor --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 3 +-- 1 file changed, 1 insertion(+), 2 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 6e81167ca8d..a27274deab8 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -449,13 +449,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { currentWorkspaceId: workspaceId, currentFolderId: folderId, }); + this.invalidateStudies(); this._resourcesContainer.setResourcesToList([]); - this._resourcesList = []; if (workspaceId === -1) { this.__reloadWorkspaces(); } else { - this.invalidateStudies(); this.__reloadFoldersAndStudies(); } } From 757332809884234b5cea01ed59662b81c6a3ecbf Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 09:03:59 +0200 Subject: [PATCH 10/17] minor fix --- .../client/source/class/osparc/dashboard/WorkspaceHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/WorkspaceHeader.js b/services/static-webserver/client/source/class/osparc/dashboard/WorkspaceHeader.js index 7f89b8ae4b3..6d584cc41b0 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/WorkspaceHeader.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/WorkspaceHeader.js @@ -260,7 +260,7 @@ qx.Class.define("osparc.dashboard.WorkspaceHeader", { menu.add(share); editButton.setMenu(menu); const val = value["read"] + value["write"] + value["delete"]; - roleText.setValue(osparc.data.Roles.STUDY[val].label); + roleText.setValue(osparc.data.Roles.WORKSPACE[val].label); roleText.show(); roleIcon.show(); this.__showSpacers(true); From 4c1b85528d888ec38f7fa7a8c38081f2e8d35bad Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 09:12:30 +0200 Subject: [PATCH 11/17] new folder button --- .../class/osparc/dashboard/StudyBrowser.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 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 a27274deab8..52691a93080 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -234,9 +234,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { resp["params"]["url"].folderId !== this.getCurrentFolderId() ) { // another call has been made and this response can be ignored - console.log("asdf ignore"); + console.log("studies ignore:", resp["params"]["url"].workspaceId, resp["params"]["url"].folderId); return; } + console.log("studies print:", resp["params"]["url"].workspaceId, resp["params"]["url"].folderId); const studies = resp["data"]; this._resourcesContainer.getFlatList().nextRequest = resp["_links"]["next"]; @@ -465,8 +466,16 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this._resourcesContainer.setFoldersToList(this.__foldersList); this._resourcesContainer.reloadFolders(); - const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId()) - if (currentFolder == null || currentFolder.getMyAccessRights()["write"]) { + this.__addNewFolderButton(); + }, + + __addNewFolderButton: function() { + if (this.getCurrentWorkspaceId()) { + const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId()); + if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) { + // If user can't write in folder, do not show plus button + return; + } const newFolderCard = new osparc.dashboard.FolderButtonNew(); newFolderCard.setCardKey("new-folder"); newFolderCard.subscribeToFilterGroup("searchBarFilter"); @@ -666,6 +675,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { params.url.workspaceId = this.getCurrentWorkspaceId(); params.url.folderId = this.getCurrentFolderId(); + console.log("studies request:", params.url.workspaceId, params.url.folderId); if (params.url.orderBy) { return osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); } else if (params.url.search) { @@ -725,14 +735,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, __addNewStudyButtons: function() { - if (this.getCurrentFolderId()) { - const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId()); - if (currentFolder) { - const ar = currentFolder.getMyAccessRights(); - if (!ar["write"]) { - // If user can't write in folder, do not show plus buttons - return; - } + if (this.getCurrentWorkspaceId()) { + const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId()); + if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) { + // If user can't write in folder, do not show plus buttons + return; } } From b4afa4da60b2aab6a1cc7ec58c3f131b654a50ac Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 09:21:16 +0200 Subject: [PATCH 12/17] remove console.logs --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 7 ++----- .../client/source/class/osparc/ui/markdown/Markdown.js | 1 - 2 files changed, 2 insertions(+), 6 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 52691a93080..ccc13ad7d72 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -234,10 +234,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { resp["params"]["url"].folderId !== this.getCurrentFolderId() ) { // another call has been made and this response can be ignored - console.log("studies ignore:", resp["params"]["url"].workspaceId, resp["params"]["url"].folderId); return; } - console.log("studies print:", resp["params"]["url"].workspaceId, resp["params"]["url"].folderId); const studies = resp["data"]; this._resourcesContainer.getFlatList().nextRequest = resp["_links"]["next"]; @@ -473,7 +471,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { if (this.getCurrentWorkspaceId()) { const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId()); if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) { - // If user can't write in folder, do not show plus button + // If user can't write in workspace, do not show plus button return; } const newFolderCard = new osparc.dashboard.FolderButtonNew(); @@ -675,7 +673,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { params.url.workspaceId = this.getCurrentWorkspaceId(); params.url.folderId = this.getCurrentFolderId(); - console.log("studies request:", params.url.workspaceId, params.url.folderId); if (params.url.orderBy) { return osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options); } else if (params.url.search) { @@ -738,7 +735,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { if (this.getCurrentWorkspaceId()) { const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId()); if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) { - // If user can't write in folder, do not show plus buttons + // If user can't write in workspace, do not show plus buttons return; } } diff --git a/services/static-webserver/client/source/class/osparc/ui/markdown/Markdown.js b/services/static-webserver/client/source/class/osparc/ui/markdown/Markdown.js index fefe6423015..8829944985b 100644 --- a/services/static-webserver/client/source/class/osparc/ui/markdown/Markdown.js +++ b/services/static-webserver/client/source/class/osparc/ui/markdown/Markdown.js @@ -153,7 +153,6 @@ qx.Class.define("osparc.ui.markdown.Markdown", { }); if (domElement && domElement.children) { const elemHeight = this.__getChildrenElementHeight(domElement.children); - console.log("resizeMe elemHeight", elemHeight); if (this.getMaxHeight() && elemHeight > this.getMaxHeight()) { this.setHeight(elemHeight); } else { From 4cd339e97ec6ceea878c7fee7d9ecc34a760b37e Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 09:58:49 +0200 Subject: [PATCH 13/17] rely on folder's selection --- .../osparc/dashboard/ResourceBrowserBase.js | 16 +++++++++------- .../osparc/dashboard/WorkspacesAndFoldersTree.js | 13 ------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js index 55df2db57a4..e15d65a32eb 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js @@ -374,13 +374,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", { if (this._resourceType === "study") { const workspacesAndFoldersTree = resourceFilter.getWorkspacesAndFoldersTree(); - workspacesAndFoldersTree.addListener("changeContext", e => { - const { - workspaceId, - folderId, - } = e.getData(); - this._changeContext(workspaceId, folderId); - }); + workspacesAndFoldersTree.getSelection().addListener("change", () => { + const selection = workspacesAndFoldersTree.getSelection(); + if (selection.getLength() > 0) { + const item = selection.getItem(0); + const workspaceId = item.getWorkspaceId(); + const folderId = item.getFolderId(); + this._changeContext(workspaceId, folderId); + } + }, this); this.bind("currentWorkspaceId", workspacesAndFoldersTree, "currentWorkspaceId"); this.bind("currentFolderId", workspacesAndFoldersTree, "currentFolderId"); } diff --git a/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js b/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js index 161471e3845..ca2cd75f855 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js @@ -75,7 +75,6 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", { }, events: { - "changeContext": "qx.event.type.Data", "openChanged": "qx.event.type.Event", }, @@ -118,18 +117,6 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", { }, item, id); }, configureItem: item => { - item.addListener("tap", () => { - const workspaceId = item.getModel().getWorkspaceId(); - const folderId = item.getModel().getFolderId(); - this.set({ - currentWorkspaceId: workspaceId, - currentFolderId: folderId, - }); - this.fireDataEvent("changeContext", { - workspaceId, - folderId, - }); - }, this); item.set({ indent: 12, // defaults to 19 }); From 300cdb2d9b4857e19efbfe0144b51d6b243f86ea Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 10:01:53 +0200 Subject: [PATCH 14/17] reset workspaces list --- .../source/class/osparc/dashboard/StudyBrowser.js | 12 +++++++++--- 1 file changed, 9 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 ccc13ad7d72..a341804f42f 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -163,11 +163,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, __reloadWorkspaces: function() { + // empty list + this.__setWorkspacesToList([]); osparc.store.Workspaces.getInstance().fetchWorkspaces() .then(workspaces => { - this.__workspacesList = workspaces; - workspaces.forEach(workspace => workspace["resourceType"] = "workspace"); - this.__reloadWorkspaceCards(); + this.__setWorkspacesToList(workspaces); }); }, @@ -376,6 +376,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this.__reloadFolderCards(); }, + __setWorkspacesToList: function(workspaces) { + this.__workspacesList = workspaces; + workspaces.forEach(workspace => workspace["resourceType"] = "workspace"); + this.__reloadWorkspaceCards(); + }, + _reloadCards: function() { const fetching = this._loadingResourcesBtn ? this._loadingResourcesBtn.getFetching() : false; const visibility = this._loadingResourcesBtn ? this._loadingResourcesBtn.getVisibility() : "excluded"; From 2c1d3fe151941c39be793885987a4492d958f6a2 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 10:04:41 +0200 Subject: [PATCH 15/17] comments --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 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 a341804f42f..f6b01ef25fb 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -163,7 +163,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, __reloadWorkspaces: function() { - // empty list this.__setWorkspacesToList([]); osparc.store.Workspaces.getInstance().fetchWorkspaces() .then(workspaces => { @@ -233,7 +232,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { resp["params"]["url"].workspaceId !== this.getCurrentWorkspaceId() || resp["params"]["url"].folderId !== this.getCurrentFolderId() ) { - // another call has been made and this response can be ignored + // Context might have been changed while waiting for the response. + // The new call is on the ways and this can be ignored. return; } From 664d5680fee17ffd391c110d1e259a541f0d9348 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 10:36:03 +0200 Subject: [PATCH 16/17] more consistent color scheme --- .../client/source/class/osparc/theme/ColorDark.js | 2 +- .../client/source/class/osparc/theme/ColorLight.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/theme/ColorDark.js b/services/static-webserver/client/source/class/osparc/theme/ColorDark.js index e46c25d4f02..99fc9b322c7 100644 --- a/services/static-webserver/client/source/class/osparc/theme/ColorDark.js +++ b/services/static-webserver/client/source/class/osparc/theme/ColorDark.js @@ -41,7 +41,6 @@ qx.Theme.define("osparc.theme.ColorDark", { "fab-background": "rgba(255, 255, 255, 0.2)", "input_background": "#213248", "input_background_disable": "rgba(113, 157, 181, 0.25)", - "window-popup-background": "rgba(66, 66, 66, 1)", "hint-background": "rgba(82, 82, 82, 1)", "transparent_overlay": "rgba(1, 18, 26, 0.1)", @@ -63,6 +62,7 @@ qx.Theme.define("osparc.theme.ColorDark", { "shadow": qx.core.Environment.get("css.rgba") ? "a-bit-transparent" : "bg-shadow", // window + "window-popup-background": "background-main-1", "window-caption-background": "background-main", "window-caption-background-active": "background-main-3", "window-caption-text": "text", diff --git a/services/static-webserver/client/source/class/osparc/theme/ColorLight.js b/services/static-webserver/client/source/class/osparc/theme/ColorLight.js index 16f6c8e3fd7..6e0ff3ddaca 100644 --- a/services/static-webserver/client/source/class/osparc/theme/ColorLight.js +++ b/services/static-webserver/client/source/class/osparc/theme/ColorLight.js @@ -41,7 +41,6 @@ qx.Theme.define("osparc.theme.ColorLight", { "fab-background": "rgba(255, 255, 255, 1)", "input_background": "rgba(209, 214, 218, 1)", "input_background_disable": "rgba(113, 157, 181, 0.04)", - "window-popup-background": "rgba(255, 255, 255, 1)", "hint-background": "rgba(201, 201, 201, 1)", "transparent_overlay": "rgba(1, 18, 26, 0.1)", @@ -63,6 +62,8 @@ qx.Theme.define("osparc.theme.ColorLight", { "shadow": qx.core.Environment.get("css.rgba") ? "a-bit-transparent" : "bg-shadow", // window + // "window-popup-background": "rgba(255, 255, 255, 1)", + "window-popup-background": "background-main-1", "window-caption-background": "background-main", "window-caption-background-active": "background-main-3", "window-caption-text": "text", From f7ab77341ed4c00db19d232e09bd6d1c324e235c Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 16 Sep 2024 10:40:19 +0200 Subject: [PATCH 17/17] undo coloring --- .../client/source/class/osparc/theme/ColorDark.js | 2 +- .../client/source/class/osparc/theme/ColorLight.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/theme/ColorDark.js b/services/static-webserver/client/source/class/osparc/theme/ColorDark.js index 99fc9b322c7..0e179de8059 100644 --- a/services/static-webserver/client/source/class/osparc/theme/ColorDark.js +++ b/services/static-webserver/client/source/class/osparc/theme/ColorDark.js @@ -62,7 +62,7 @@ qx.Theme.define("osparc.theme.ColorDark", { "shadow": qx.core.Environment.get("css.rgba") ? "a-bit-transparent" : "bg-shadow", // window - "window-popup-background": "background-main-1", + "window-popup-background": "rgba(66, 66, 66, 1)", "window-caption-background": "background-main", "window-caption-background-active": "background-main-3", "window-caption-text": "text", diff --git a/services/static-webserver/client/source/class/osparc/theme/ColorLight.js b/services/static-webserver/client/source/class/osparc/theme/ColorLight.js index 6e0ff3ddaca..4af8f46d180 100644 --- a/services/static-webserver/client/source/class/osparc/theme/ColorLight.js +++ b/services/static-webserver/client/source/class/osparc/theme/ColorLight.js @@ -62,8 +62,7 @@ qx.Theme.define("osparc.theme.ColorLight", { "shadow": qx.core.Environment.get("css.rgba") ? "a-bit-transparent" : "bg-shadow", // window - // "window-popup-background": "rgba(255, 255, 255, 1)", - "window-popup-background": "background-main-1", + "window-popup-background": "rgba(255, 255, 255, 1)", "window-caption-background": "background-main", "window-caption-background-active": "background-main-3", "window-caption-text": "text",