Skip to content

Commit 6dfe4f4

Browse files
committed
showing card
1 parent 73c6692 commit 6dfe4f4

File tree

3 files changed

+37
-21
lines changed

3 files changed

+37
-21
lines changed

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

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
326326
check: [
327327
"study",
328328
"template",
329+
"function",
329330
"tutorial",
330331
"hypertool",
331332
"service",
@@ -527,6 +528,11 @@ qx.Class.define("osparc.dashboard.CardBase", {
527528
owner = resourceData.prjOwner ? resourceData.prjOwner : "";
528529
workbench = resourceData.workbench ? resourceData.workbench : {};
529530
break;
531+
case "function":
532+
uuid = resourceData.uuid ? resourceData.uuid : null;
533+
owner = "";
534+
workbench = resourceData.workbench ? resourceData.workbench : {};
535+
break;
530536
case "service":
531537
uuid = resourceData.key ? resourceData.key : null;
532538
owner = resourceData.owner ? resourceData.owner : resourceData.contact;
@@ -555,26 +561,31 @@ qx.Class.define("osparc.dashboard.CardBase", {
555561
workbench
556562
});
557563

558-
if ([
559-
"study",
560-
"template",
561-
"tutorial",
562-
"hypertool"
563-
].includes(resourceData["resourceType"])) {
564-
osparc.store.Services.getStudyServices(resourceData.uuid)
565-
.then(resp => {
566-
const services = resp["services"];
567-
resourceData["services"] = services;
568-
this.setServices(services);
569-
})
570-
.catch(err => {
571-
resourceData["services"] = null;
572-
this.setServices(null);
573-
console.error(err);
574-
});
564+
switch (resourceData["resourceType"]) {
565+
case "study":
566+
case "template":
567+
case "tutorial":
568+
case "hypertool": {
569+
osparc.store.Services.getStudyServices(resourceData.uuid)
570+
.then(resp => {
571+
const services = resp["services"];
572+
resourceData["services"] = services;
573+
this.setServices(services);
574+
})
575+
.catch(err => {
576+
resourceData["services"] = null;
577+
this.setServices(null);
578+
console.error(err);
579+
});
580+
581+
osparc.study.Utils.guessIcon(resourceData)
582+
.then(iconSource => this.setIcon(iconSource));
575583

576-
osparc.study.Utils.guessIcon(resourceData)
577-
.then(iconSource => this.setIcon(iconSource));
584+
break;
585+
}
586+
case "function":
587+
this.setIcon(osparc.data.model.StudyUI.PIPELINE_ICON);
588+
break;
578589
}
579590
},
580591

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
190190
"template",
191191
"tutorial",
192192
"hypertool",
193+
"function",
193194
].includes(this.getResourceType())) {
194195
const dateBy = this.getChildControl("date-by");
195196
dateBy.set({

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ qx.Class.define("osparc.store.Functions", {
9696
if (!isBackendReady) {
9797
return new Promise(resolve => {
9898
const response = this.__dummyResponse();
99+
response["params"] = params;
99100
resolve(response);
100101
});
101102
}
@@ -126,7 +127,7 @@ qx.Class.define("osparc.store.Functions", {
126127
"data": [{
127128
"uuid": "0fab79c3-14b8-4625-a455-6dcbf74eb4f2",
128129
"functionClass": "PROJECT",
129-
"title": "Potential Function II",
130+
"name": "Potential Function II",
130131
"description": "Function description",
131132
"inputSchema": {"schema_class": "application/schema+json", "schema_content": {"type": "object", "required": ["X"], "properties": {"X": {"type": "number"}}}},
132133
"outputSchema": {"schema_class": "application/schema+json", "schema_content": {"type": "object", "required": ["Out 1", "Out_2"], "properties": {"Out 1": {"type": "number"}, "Out_2": {"type": "number"}}}},
@@ -137,7 +138,10 @@ qx.Class.define("osparc.store.Functions", {
137138
"thumbnail": "https://img.freepik.com/premium-vector/image-icon-design-vector-template_1309674-940.jpg",
138139
"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"]}},
139140
"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}}},
140-
}]
141+
}],
142+
"_links": {
143+
"next": null,
144+
},
141145
};
142146
},
143147
}

0 commit comments

Comments
 (0)