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 e8914ca6166..533c90c4643 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/WorkspacesAndFoldersTree.js @@ -228,6 +228,9 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", { const sharedWorkspaceModel = this.__getModel(-1, null); sharedWorkspaceModel.getChildren().append(workspaceModel); + sharedWorkspaceModel.getChildren().sort(((a, b) => { + return a.getLabel().localeCompare(b.getLabel()); + })); // load next level too this.__populateFolder(workspaceModel, workspace.getWorkspaceId(), null); @@ -262,7 +265,10 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", { const folderModel = qx.data.marshal.Json.createModel(folderData, true); this.__models.push(folderModel); folder.bind("name", folderModel, "label"); - parentModel.getChildren().push(folderModel); + parentModel.getChildren().append(folderModel); + parentModel.getChildren().sort(((a, b) => { + return a.getLabel().localeCompare(b.getLabel()); + })); return folderModel; }, diff --git a/services/static-webserver/client/source/class/osparc/study/StudyOptions.js b/services/static-webserver/client/source/class/osparc/study/StudyOptions.js index 0ceef6fde4e..70576fa6c79 100644 --- a/services/static-webserver/client/source/class/osparc/study/StudyOptions.js +++ b/services/static-webserver/client/source/class/osparc/study/StudyOptions.js @@ -232,7 +232,6 @@ qx.Class.define("osparc.study.StudyOptions", { center: true, enabled: false, }); - osparc.utils.Utils.setIdToWidget(control, "openWithResources"); this.getChildControl("buttons-layout").addAt(control, 1); break; } @@ -284,7 +283,13 @@ qx.Class.define("osparc.study.StudyOptions", { __evaluateOpenButton: function() { const hasTitle = Boolean(this.getChildControl("title-field").getValue()); const walletSelected = Boolean(this.getChildControl("wallet-selector").getSelection().length); - this.getChildControl("open-button").setEnabled(hasTitle && walletSelected); + const openButton = this.getChildControl("open-button"); + openButton.setEnabled(hasTitle && walletSelected); + if (hasTitle && walletSelected) { + osparc.utils.Utils.setIdToWidget(openButton, "openWithResources"); + } else { + osparc.utils.Utils.removeIdAttribute(openButton); + } }, __buildLayout: function() { diff --git a/services/static-webserver/client/source/class/osparc/utils/Utils.js b/services/static-webserver/client/source/class/osparc/utils/Utils.js index b095d95eee2..b5140e3713a 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Utils.js +++ b/services/static-webserver/client/source/class/osparc/utils/Utils.js @@ -1034,6 +1034,13 @@ qx.Class.define("osparc.utils.Utils", { return null; }, + removeIdAttribute: qWidget => { + if (qWidget.getContentElement && qWidget.getContentElement()) { + return qWidget.getContentElement().removeAttribute("osparc-test-id"); + } + return null; + }, + setKeyToWidget: (qWidget, id) => { if (qWidget.getContentElement && qWidget.getContentElement()) { qWidget.getContentElement().setAttribute("osparc-test-key", id);