Skip to content

Commit 287b3a1

Browse files
committed
list view for functions
1 parent 2d58bb3 commit 287b3a1

File tree

1 file changed

+14
-11
lines changed
  • services/static-webserver/client/source/class/osparc/dashboard

1 file changed

+14
-11
lines changed

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
106106
},
107107

108108
members: {
109-
__dontShowTutorial: null,
109+
__dontQuickStart: null,
110110
__header: null,
111+
__sortByButton: null,
111112
__workspacesList: null,
112113
__foldersList: null,
113114
__loadingFolders: null,
@@ -349,8 +350,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
349350
// Show Quick Start if there are no studies in the root folder of the personal workspace
350351
const quickStartInfo = osparc.product.quickStart.Utils.getQuickStart();
351352
if (quickStartInfo) {
352-
const dontShow = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
353-
if (dontShow === "true" || this.__dontShowTutorial) {
353+
const dontShowQuickStart = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
354+
if (dontShowQuickStart === "true" || this.__dontQuickStart) {
354355
return;
355356
}
356357
const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0;
@@ -364,7 +365,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
364365
quickStartWindow.center();
365366
quickStartWindow.open();
366367
quickStartWindow.addListener("close", () => {
367-
this.__dontShowTutorial = true;
368+
this.__dontQuickStart = true;
368369
}, this);
369370
}
370371
}
@@ -1233,13 +1234,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12331234
this._resourcesList = [];
12341235
this._resourcesContainer.setResourcesToList(this._resourcesList);
12351236
this._resourcesContainer.reloadCards("studies");
1237+
// functions will disable it
12361238
this._searchBarFilter.setEnabled(true);
1239+
// workspaces will exclude it
1240+
this._toolbar.show();
1241+
// functions will exclude it
1242+
this.__sortByButton.show();
12371243

12381244
switch (this.getCurrentContext()) {
12391245
case osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS:
12401246
this._searchBarFilter.resetFilters();
12411247
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in My Projects");
1242-
this._toolbar.show();
12431248
this.__reloadFolders();
12441249
this._loadingResourcesBtn.setFetching(false);
12451250
this.invalidateStudies();
@@ -1248,12 +1253,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12481253
case osparc.dashboard.StudyBrowser.CONTEXT.WORKSPACES:
12491254
this._searchBarFilter.resetFilters();
12501255
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in My Projects");
1256+
// workspaces can't be sorted and don't support list view
12511257
this._toolbar.exclude();
12521258
this.__reloadWorkspaces();
12531259
break;
12541260
case osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PROJECTS:
12551261
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in My Projects");
1256-
this._toolbar.show();
12571262
this.__reloadWorkspaces();
12581263
this.__reloadFolders();
12591264
this._loadingResourcesBtn.setFetching(false);
@@ -1266,7 +1271,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12661271
this._searchBarFilter.resetFilters();
12671272
}
12681273
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in Templates");
1269-
this._toolbar.show();
12701274
this._loadingResourcesBtn.setFetching(false);
12711275
this.invalidateStudies();
12721276
this.__reloadStudies();
@@ -1277,25 +1281,24 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12771281
this._searchBarFilter.resetFilters();
12781282
}
12791283
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in Public Projects");
1280-
this._toolbar.show();
12811284
this._loadingResourcesBtn.setFetching(false);
12821285
this.invalidateStudies();
12831286
this.__reloadStudies();
12841287
break;
12851288
case osparc.dashboard.StudyBrowser.CONTEXT.FUNCTIONS:
12861289
this._searchBarFilter.resetFilters();
12871290
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in Functions");
1291+
// functions can't be searched yet
12881292
this._searchBarFilter.setEnabled(false);
12891293
// functions can't be sorted yet
1290-
this._toolbar.exclude();
1294+
this.__sortByButton.exclude();
12911295
this._loadingResourcesBtn.setFetching(false);
12921296
this.invalidateFunctions();
12931297
this.__reloadStudies();
12941298
break;
12951299
case osparc.dashboard.StudyBrowser.CONTEXT.TRASH:
12961300
this._searchBarFilter.resetFilters();
12971301
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in My Projects");
1298-
this._toolbar.show();
12991302
this.__reloadWorkspaces();
13001303
this.__reloadFolders();
13011304
this._loadingResourcesBtn.setFetching(false);
@@ -1365,7 +1368,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
13651368
},
13661369

13671370
__addSortByButton: function() {
1368-
const sortByButton = new osparc.dashboard.SortedByMenuButton();
1371+
const sortByButton = this.__sortByButton = new osparc.dashboard.SortedByMenuButton();
13691372
sortByButton.set({
13701373
appearance: "form-button-outlined"
13711374
});

0 commit comments

Comments
 (0)