Skip to content

Commit c04124d

Browse files
committed
fetchTemplatesNonPublicPaginated
1 parent aa93148 commit c04124d

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
838838
request = osparc.data.Resources.fetch("studies", "getPageSearch", params, options);
839839
break;
840840
case "templates":
841-
request = osparc.store.Templates.fetchTemplatesPaginated(params, options);
841+
request = osparc.store.Templates.fetchTemplatesNonPublicPaginated(params, options);
842842
break;
843843
case "public":
844844
request = osparc.store.Templates.fetchTemplatesPublicPaginated(params, options);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ qx.Class.define("osparc.dashboard.TutorialBrowser", {
5959
const templateId = data["project_uuid"];
6060
const state = ("data" in data) ? data.data : {};
6161
const errors = ("errors" in data) ? data.errors : [];
62-
this.__templateStateReceived(templateId, state, errors);
62+
this.__tutorialStateReceived(templateId, state, errors);
6363
}
6464
}, this);
6565
},
6666

67-
__templateStateReceived: function(templateId, state, errors) {
68-
osparc.store.Store.getInstance().setTemplateState(templateId, state);
67+
__tutorialStateReceived: function(templateId, state, errors) {
6968
const idx = this._resourcesList.findIndex(study => study["uuid"] === templateId);
7069
if (idx > -1) {
7170
this._resourcesList[idx]["state"] = state;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,6 @@ qx.Class.define("osparc.data.Resources", {
596596
method: "GET",
597597
url: statics.API + "/projects?type=template&offset={offset}&limit={limit}"
598598
},
599-
getPageSorted: {
600-
method: "GET",
601-
url: statics.API + "/projects?type=template&offset={offset}&limit={limit}&order_by={orderBy}"
602-
},
603599
getPageFilteredSorted: {
604600
method: "GET",
605601
url: statics.API + "/projects?type=template&template_type={templateType}&offset={offset}&limit={limit}&order_by={orderBy}"

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ qx.Class.define("osparc.store.Templates", {
2121
statics: {
2222
__templates: null,
2323
__templatesPromisesCached: null,
24+
__tutorials: null,
25+
__tutorialsPromisesCached: null,
26+
__hypertools: null,
27+
__hypertoolsPromisesCached: null,
2428

25-
fetchTemplatesPaginated: function(params, options) {
26-
return osparc.data.Resources.fetch("templates", "getPageSorted", params, options)
29+
__fetchTemplatesPaginated: function(params, options) {
30+
return osparc.data.Resources.fetch("templates", "getPageFilteredSorted", params, options)
2731
.then(resp => {
2832
const templates = resp.data;
2933
// add them to the list
@@ -42,8 +46,14 @@ qx.Class.define("osparc.store.Templates", {
4246
.catch(err => osparc.FlashMessenger.logError(err));
4347
},
4448

49+
fetchTemplatesNonPublicPaginated: function(params, options) {
50+
params["url"]["templateType"] = osparc.data.model.StudyUI.TEMPLATE_TYPE;
51+
return this.__fetchTemplatesPaginated(params, options);
52+
},
53+
4554
fetchTemplatesPublicPaginated: function(params, options) {
46-
return this.fetchTemplatesPaginated(params, options);
55+
params["url"]["templateType"] = osparc.data.model.StudyUI.TEMPLATE_TYPE;
56+
return this.__fetchTemplatesPaginated(params, options);
4757
},
4858

4959
__fetchAllTemplates: function() {

0 commit comments

Comments
 (0)