Skip to content

Commit 6aba3cd

Browse files
committed
__dummyResponse
1 parent a2ac3f7 commit 6aba3cd

File tree

1 file changed

+33
-0
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ qx.Class.define("osparc.store.Functions", {
9292
},
9393

9494
fetchFunctionsPaginated: function(params, options) {
95+
const isBackendReady = false;
96+
if (!isBackendReady) {
97+
return new Promise(resolve => {
98+
const response = this.__dummyResponse();
99+
resolve(response);
100+
});
101+
}
95102
return osparc.data.Resources.fetch("functions", "getPage", params, options)
96103
.then(response => {
97104
const functions = response["data"];
@@ -122,5 +129,31 @@ qx.Class.define("osparc.store.Functions", {
122129
this.__functionsPromiseCached = null;
123130
}
124131
},
132+
133+
__dummyResponse: function() {
134+
return {
135+
"_meta": {
136+
"limit": 10,
137+
"total": 1,
138+
"offset": 0,
139+
"count": 1
140+
},
141+
"data": [{
142+
"uuid": "0fab79c3-14b8-4625-a455-6dcbf74eb4f2",
143+
"functionClass": "PROJECT",
144+
"title": "Potential Function II",
145+
"description": "Function description",
146+
"inputSchema": {"schema_class": "application/schema+json", "schema_content": {"type": "object", "required": ["X"], "properties": {"X": {"type": "number"}}}},
147+
"outputSchema": {"schema_class": "application/schema+json", "schema_content": {"type": "object", "required": ["Out 1", "Out_2"], "properties": {"Out 1": {"type": "number"}, "Out_2": {"type": "number"}}}},
148+
"defaultInputs": {"X": 2, "Y": 1},
149+
"creationDate": "2025-05-16T12:22:31.063Z",
150+
"lastChangeDate": "2025-05-16T12:22:33.804Z",
151+
"accessRights": {"3": {"read": true, "write": true, "delete": true}, "5": {"read": true, "write": false, "delete": false}},
152+
"thumbnail": "https://img.freepik.com/premium-vector/image-icon-design-vector-template_1309674-940.jpg",
153+
"workbench": {"50a50309-1dfc-5ad5-b2d9-c11697641f0b": {"key": "simcore/services/comp/itis/sleeper", "version": "2.2.0", "label": "sleeper", "inputs": {"input_2": 2, "input_3": false, "input_4": 0, "input_5": 0}, "inputsRequired": [], "inputNodes": ["2e348481-5042-5148-9196-590574747297", "69873032-770a-536b-adb6-0e6ea01720a4"]}, "2e348481-5042-5148-9196-590574747297": {"key": "simcore/services/frontend/parameter/number", "version": "1.0.0", "label": "X", "inputs": {}, "inputsRequired": [], "inputNodes": [], "outputs": {"out_1": 1}, "runHash": null}, "70e1de1a-a8b0-59e3-b19e-ea20f78765ce": {"key": "simcore/services/frontend/iterator-consumer/probe/number", "version": "1.0.0", "label": "Out 1", "inputs": {"in_1": 0}, "inputsRequired": [], "inputNodes": ["50a50309-1dfc-5ad5-b2d9-c11697641f0b"]}, "69873032-770a-536b-adb6-0e6ea01720a4": {"key": "simcore/services/frontend/parameter/number", "version": "1.0.0", "label": "Y", "inputs": {}, "inputsRequired": [], "inputNodes": [], "outputs": {"out_1": 1}, "runHash": null}, "24f856c3-408c-5ab4-ad01-e99630a355fe": {"key": "simcore/services/frontend/iterator-consumer/probe/number", "version": "1.0.0", "label": "Out_2", "inputs": {"in_1": 0}, "inputsRequired": [], "inputNodes": ["50a50309-1dfc-5ad5-b2d9-c11697641f0b"]}},
154+
"ui": {"24f856c3-408c-5ab4-ad01-e99630a355fe": {"position": {"x": 540, "y": 240}}, "2e348481-5042-5148-9196-590574747297": {"position": {"x": 120, "y": 140}}, "50a50309-1dfc-5ad5-b2d9-c11697641f0b": {"position": {"x": 300, "y": 180}}, "69873032-770a-536b-adb6-0e6ea01720a4": {"position": {"x": 120, "y": 240}}, "70e1de1a-a8b0-59e3-b19e-ea20f78765ce": {"position": {"x": 540, "y": 140}}},
155+
}]
156+
};
157+
},
125158
}
126159
});

0 commit comments

Comments
 (0)