Skip to content

Commit 3a01065

Browse files
committed
more progress
1 parent eb4b938 commit 3a01065

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
220220
this.__getNextStudiesRequest()
221221
.then(resp => {
222222
if (
223-
resp["params"]["url"].workspaceId !== this.getCurrentWorkspaceId() ||
224-
resp["params"]["url"].folderId !== this.getCurrentFolderId()
223+
"workspaceId" in resp["params"]["url"] &&
224+
(
225+
resp["params"]["url"].workspaceId !== this.getCurrentWorkspaceId() ||
226+
resp["params"]["url"].folderId !== this.getCurrentFolderId()
227+
)
225228
) {
226229
// Context might have been changed while waiting for the response.
227230
// The new call is on the ways and this can be ignored.
@@ -636,10 +639,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
636639
orderBy: JSON.stringify(this.getOrderBy()),
637640
}
638641
};
639-
const filterData = this._searchBarFilter.getFilterData();
640-
if (filterData.text) {
641-
params.url["text"] = filterData.text; // name, description and uuid
642-
}
643642

644643
const nextRequestParams = this.__getNextRequestParams();
645644
if (nextRequestParams) {
@@ -650,8 +649,14 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
650649
resolveWResponse: true
651650
};
652651

653-
params.url.workspaceId = this.getCurrentWorkspaceId();
654-
params.url.folderId = this.getCurrentFolderId();
652+
const filterData = this._searchBarFilter.getFilterData();
653+
if (filterData.text) {
654+
params.url.text = filterData.text; // name, description and uuid
655+
} else {
656+
params.url.workspaceId = this.getCurrentWorkspaceId();
657+
params.url.folderId = this.getCurrentFolderId();
658+
}
659+
655660
if (params.url.text) {
656661
return osparc.data.Resources.fetch("studies", "getPageSearch", params, undefined, options);
657662
} else if (params.url.orderBy) {

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ qx.Class.define("osparc.data.Resources", {
122122
method: "GET",
123123
url: statics.API + "/projects?type=user&offset={offset}&limit={limit}&workspace_id={workspaceId}&folder_id={folderId}"
124124
},
125-
getPageSearch: {
125+
getPageSortBy: {
126126
useCache: false,
127127
method: "GET",
128-
url: statics.API + "/projects?type=user&offset={offset}&limit={limit}&workspace_id={workspaceId}&folder_id={folderId}&search={text}"
128+
url: statics.API + "/projects?type=user&offset={offset}&limit={limit}&workspace_id={workspaceId}&folder_id={folderId}&order_by={orderBy}"
129129
},
130-
getPageSortBy: {
130+
getPageSearch: {
131131
useCache: false,
132132
method: "GET",
133-
url: statics.API + "/projects?type=user&offset={offset}&limit={limit}&workspace_id={workspaceId}&folder_id={folderId}&order_by={orderBy}"
133+
url: statics.API + "/projects?type=user&offset={offset}&limit={limit}&search={text}"
134134
},
135135
getOne: {
136136
useCache: false,

0 commit comments

Comments
 (0)