Skip to content

Commit 92c99bf

Browse files
committed
paginated templates
1 parent b8a34cf commit 92c99bf

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
724724

725725
__didContextChange: function(reqParams) {
726726
// not needed for the comparison
727-
delete reqParams["type"];
727+
// delete reqParams["type"];
728728
delete reqParams["limit"];
729729
delete reqParams["offset"];
730730
delete reqParams["filters"];
@@ -785,6 +785,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
785785
case "studiesAndFolders":
786786
requestParams.workspaceId = this.getCurrentWorkspaceId();
787787
requestParams.folderId = this.getCurrentFolderId();
788+
requestParams.type = "user";
789+
break;
790+
case "templates":
791+
requestParams.type = "template";
792+
break;
793+
case "public":
794+
requestParams.type = "template";
788795
break;
789796
case "search": {
790797
// Use the ``search`` functionality only if the user types some text

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,11 @@ qx.Class.define("osparc.data.Resources", {
595595
getPage: {
596596
method: "GET",
597597
url: statics.API + "/projects?type=template&offset={offset}&limit={limit}"
598-
}
598+
},
599+
getPageSorted: {
600+
method: "GET",
601+
url: statics.API + "/projects?type=template&offset={offset}&limit={limit}&order_by={orderBy}"
602+
},
599603
}
600604
},
601605
/*

services/static-webserver/client/source/class/osparc/store/Templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ qx.Class.define("osparc.store.Templates", {
2323
__templatesPromisesCached: null,
2424

2525
fetchTemplatesPaginated: function(params, options) {
26-
return osparc.data.Resources.fetch("templates", "getPage", params, options)
26+
return osparc.data.Resources.fetch("templates", "getPageSorted", params, options)
2727
.then(resp => {
2828
const templates = resp.data;
2929
// add them to the list

0 commit comments

Comments
 (0)