Skip to content

Commit 5c50c4e

Browse files
committed
move up
1 parent 1a7c45d commit 5c50c4e

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
236236
});
237237
const textField = searchBarFilter.getChildControl("text-field");
238238
osparc.utils.Utils.setIdToWidget(textField, "searchBarFilter-textField-"+this._resourceType);
239+
240+
if (this._resourceType === "study") {
241+
this._searchBarFilter.addListener("filterChanged", e => {
242+
const filterData = e.getData();
243+
if (filterData.text) {
244+
this._changeContext(-2, null);
245+
} else {
246+
// Back to My Workspace
247+
this._changeContext(null, null);
248+
}
249+
});
250+
}
251+
239252
this._addToLayout(searchBarFilter);
240253
},
241254

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
658658
}
659659

660660
if (params.url.text) {
661+
delete params.url.orderBy;
661662
return osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options);
662663
} else if (params.url.orderBy) {
663664
return osparc.data.Resources.fetch("studies", "getPageSortBy", params, undefined, options);
@@ -672,8 +673,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
672673
},
673674

674675
__addNewStudyButtons: function() {
675-
if (this.getCurrentWorkspaceId()) {
676-
const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(this.getCurrentWorkspaceId());
676+
const currentWorkspaceId = this.getCurrentWorkspaceId();
677+
if (currentWorkspaceId) {
678+
if (currentWorkspaceId === -2) {
679+
return;
680+
}
681+
const currentWorkspace = osparc.store.Workspaces.getInstance().getWorkspace(currentWorkspaceId);
677682
if (currentWorkspace && !currentWorkspace.getMyAccessRights()["write"]) {
678683
// If user can't write in workspace, do not show plus buttons
679684
return;
@@ -790,15 +795,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
790795
// LAYOUT //
791796
_createLayout: function() {
792797
this._createSearchBar();
793-
this._searchBarFilter.addListener("filterChanged", e => {
794-
const filterData = e.getData();
795-
if (filterData.text) {
796-
this._changeContext(-2, null);
797-
} else {
798-
this.__reloadFolders();
799-
this.__reloadStudies();
800-
}
801-
});
802798

803799
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
804800
const workspaceHeader = new osparc.dashboard.WorkspaceHeader();
@@ -1023,6 +1019,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10231019
}))
10241020
});
10251021
this.bind("multiSelection", selectButton, "value");
1022+
this.bind("currentWorkspaceId", selectButton, "visibility", {
1023+
converter: currentWorkspaceId => [-2, -1].includes(currentWorkspaceId) ? "excluded" : "visible"
1024+
});
10261025
return selectButton;
10271026
},
10281027

0 commit comments

Comments
 (0)