From bfd5872aeb5b62dc19cd150f6f1b512b69d6fe41 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 13:51:39 +0200 Subject: [PATCH 01/13] create function tabPage --- .../class/osparc/dashboard/ResourceDetails.js | 19 +++++++++++- .../client/source/class/osparc/study/Utils.js | 29 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js index e63ae8343303..66b1ae57c380 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js @@ -336,6 +336,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { this.__getConversationsPage, this.__getPermissionsPage, this.__getSaveAsTemplatePage, + this.__getCreateFunctionsPage, this.__getTagsPage, this.__getQualityPage, this.__getClassifiersPage, @@ -688,7 +689,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { const id = "ServicesUpdate"; const title = this.tr("Services Updates"); - const iconSrc = "@MaterialIcons/update/22"; + const iconSrc = "@MaterialIcons/update/24"; const page = this.__servicesUpdatePage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id); this.__addOpenButton(page); @@ -801,6 +802,22 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { return page; } return null; + }, + + __getCreateFunctionsPage: function() { + if (!osparc.utils.Resources.isStudy(this.__resourceData)) { + return null; + } + + if (!osparc.study.Utils.canCreateFunction(this.__resourceData["workbench"])) { + return null; + } + + const id = "CreateFunction"; + const iconSrc = "@MaterialIcons/functions/24"; + const title = this.tr("Create Function"); + const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id); + return page; } } }); diff --git a/services/static-webserver/client/source/class/osparc/study/Utils.js b/services/static-webserver/client/source/class/osparc/study/Utils.js index 8f1dad69d406..6630e7ca6115 100644 --- a/services/static-webserver/client/source/class/osparc/study/Utils.js +++ b/services/static-webserver/client/source/class/osparc/study/Utils.js @@ -230,6 +230,35 @@ qx.Class.define("osparc.study.Utils", { return Array.from(services); }, + extractFilePickers: function(workbench) { + const parameters = Object.values(workbench).filter(srv => srv["key"].includes("simcore/services/frontend/file-picker")); + return parameters; + }, + + extractParameters: function(workbench) { + const parameters = Object.values(workbench).filter(srv => srv["key"].includes("simcore/services/frontend/parameter/")); + return parameters; + }, + + extractProbes: function(workbench) { + const parameters = Object.values(workbench).filter(srv => srv["key"].includes("simcore/services/frontend/iterator-consumer/probe/")); + return parameters; + }, + + canCreateFunction: function(workbench) { + if (!osparc.store.StaticInfo.getInstance().isDevFeaturesEnabled()) { + return false; + } + + // in order to create a function, the pipeline needs: + // - at least one parameter (or file-picker (file type parameter)) + // - at least one probe + const filePickers = osparc.study.Utils.extractFilePickers(workbench); + const parameters = osparc.study.Utils.extractParameters(workbench); + const probes = osparc.study.Utils.extractProbes(workbench); + return (filePickers.length + parameters.length) && probes.length; + }, + getCantExecuteServices: function(studyServices = []) { return studyServices.filter(studyService => studyService["myAccessRights"]["execute"] === false); }, From 4a0408a2d3e6ff6eb37a2c6d2ee4a7c58f8ca3ac Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 14:02:32 +0200 Subject: [PATCH 02/13] CreateFunction --- .../class/osparc/dashboard/ResourceDetails.js | 7 ++ .../class/osparc/study/CreateFunction.js | 81 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 services/static-webserver/client/source/class/osparc/study/CreateFunction.js diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js index 66b1ae57c380..d543206295de 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js @@ -817,6 +817,13 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { const iconSrc = "@MaterialIcons/functions/24"; const title = this.tr("Create Function"); const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id); + const createFunction = new osparc.study.CreateFunction(this.__resourceData); + const createFunctionButton = createFunction.getCreateFunctionButton(); + osparc.dashboard.resources.pages.BasePage.decorateHeaderButton(createFunctionButton); + const toolbar = this.self().createToolbar(); + toolbar.add(createFunctionButton); + page.addToHeader(toolbar); + page.addToContent(createFunction); return page; } } diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js new file mode 100644 index 000000000000..2c56b92079a8 --- /dev/null +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -0,0 +1,81 @@ +/* ************************************************************************ + + osparc - the simcore frontend + + https://osparc.io + + Copyright: + 2024 IT'IS Foundation, https://itis.swiss + + License: + MIT: https://opensource.org/licenses/MIT + + Authors: + * Odei Maiz (odeimaiz) + +************************************************************************ */ + + +qx.Class.define("osparc.study.CreateFunction", { + extend: qx.ui.core.Widget, + + /** + * @param studyData {Object} Object containing part or the entire serialized Study Data + */ + construct: function(studyData) { + this.base(arguments); + + this._setLayout(new qx.ui.layout.VBox(20)); + + this.__studyDataClone = osparc.data.model.Study.deepCloneStudyObject(studyData); + + this.__buildLayout(); + }, + + members: { + __studyDataClone: null, + __form: null, + __createFunctionBtn: null, + + __buildLayout: function() { + const form = this.__form = new qx.ui.form.Form(); + this._add(new qx.ui.form.renderer.Single(form)); + + const title = new qx.ui.form.TextField().set({ + required: true, + value: this.__studyDataClone.name, + }); + this.addListener("appear", () => { + title.focus(); + title.activate(); + }); + form.add(title, this.tr("Name"), null, "name"); + + const description = new qx.ui.form.TextField().set({ + required: false, + }); + form.add(description, this.tr("Description"), null, "description"); + + const createFunctionBtn = this.__createFunctionBtn = new qx.ui.form.Button().set({ + appearance: "strong-button", + label: this.tr("Create"), + allowGrowX: false, + alignX: "right" + }); + createFunctionBtn.addListener("execute", () => this.__createFunction(), this); + this._add(createFunctionBtn); + }, + + __createFunction: function() { + const name = this.__form.getItem("name"); + const description = this.__form.getItem("description"); + + console.log("Creating function with name: ", name.getValue()); + console.log("Creating function with description: ", description.getValue()); + }, + + getCreateFunctionButton: function() { + return this.__createFunctionBtn; + } + } +}); From ff122d311e80f5ffb31f60713e7ffe91fea0f402 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 14:21:46 +0200 Subject: [PATCH 03/13] create template first --- .../source/class/osparc/data/Resources.js | 12 +++ .../class/osparc/study/CreateFunction.js | 80 ++++++++++++++++--- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index 401bf5b7d699..f91a8a5062f4 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -586,6 +586,18 @@ qx.Class.define("osparc.data.Resources", { } } }, + /* + * FUNCTIONS + */ + "functions": { + useCache: false, + endpoints: { + getPage: { + method: "POST", + url: statics.API + "/functions" + } + } + }, /* * TASKS */ diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 2c56b92079a8..60e2a292f777 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -27,13 +27,13 @@ qx.Class.define("osparc.study.CreateFunction", { this._setLayout(new qx.ui.layout.VBox(20)); - this.__studyDataClone = osparc.data.model.Study.deepCloneStudyObject(studyData); + this.__studyData = studyData; this.__buildLayout(); }, members: { - __studyDataClone: null, + __studyData: null, __form: null, __createFunctionBtn: null, @@ -43,7 +43,7 @@ qx.Class.define("osparc.study.CreateFunction", { const title = new qx.ui.form.TextField().set({ required: true, - value: this.__studyDataClone.name, + value: this.__studyData.name, }); this.addListener("appear", () => { title.focus(); @@ -56,22 +56,84 @@ qx.Class.define("osparc.study.CreateFunction", { }); form.add(description, this.tr("Description"), null, "description"); - const createFunctionBtn = this.__createFunctionBtn = new qx.ui.form.Button().set({ + const createFunctionBtn = this.__createFunctionBtn = new qx.ui.form.FetchButton().set({ appearance: "strong-button", label: this.tr("Create"), allowGrowX: false, alignX: "right" }); - createFunctionBtn.addListener("execute", () => this.__createFunction(), this); + createFunctionBtn.addListener("execute", () => { + if (this.__form.validate()) { + this.__createFunction(); + } + }, this); this._add(createFunctionBtn); }, __createFunction: function() { - const name = this.__form.getItem("name"); - const description = this.__form.getItem("description"); + this.__createFunctionBtn.setFetching(true); + + // first publish it as a template + const params = { + url: { + "study_id": this.__studyData["uuid"], + "copy_data": true, + }, + }; + const options = { + pollTask: true + }; + const fetchPromise = osparc.data.Resources.fetch("studies", "postToTemplate", params, options); + const pollTasks = osparc.store.PollTasks.getInstance(); + pollTasks.createPollingTask(fetchPromise) + .then(task => { + task.addListener("resultReceived", e => { + const templateData = e.getData(); + this.__doCreateFunction(templateData); + }); + }) + .catch(err => { + this.__createFunctionBtn.setFetching(false); + osparc.FlashMessenger.logError(err); + }); + }, - console.log("Creating function with name: ", name.getValue()); - console.log("Creating function with description: ", description.getValue()); + __doCreateFunction: function(templateData) { + const nameField = this.__form.getItem("name"); + const descriptionField = this.__form.getItem("description"); + + const functionData = { + "name": nameField.getValue(), + "description": descriptionField.getValue(), + "project_id": templateData["uuid"], + "function_class": "project", + "input_schema": { + "schema_dict": { + "type": "object", + "properties": { + "input1": { + "type": "integer" // InputTypes: TypeAlias = FileID | float | int | bool | str | list + } + } + } + }, + "output_schema": { + "schema_dict": { + "type": "object", + "properties": { + "output1": { + "type": "integer" // OutputTypes: TypeAlias = FileID | float | int | bool | str | list + } + } + } + }, + "default_inputs": { + "input1": 5 + }, + }; + console.log("Creating function with data: ", functionData); + + this.__createFunctionBtn.setFetching(false); }, getCreateFunctionButton: function() { From e38ef8b0b957e1e71eabc121554c65271c531b7c Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 14:27:12 +0200 Subject: [PATCH 04/13] call backend --- .../source/class/osparc/study/CreateFunction.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 60e2a292f777..5c82532ca556 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -56,7 +56,7 @@ qx.Class.define("osparc.study.CreateFunction", { }); form.add(description, this.tr("Description"), null, "description"); - const createFunctionBtn = this.__createFunctionBtn = new qx.ui.form.FetchButton().set({ + const createFunctionBtn = this.__createFunctionBtn = new osparc.ui.form.FetchButton().set({ appearance: "strong-button", label: this.tr("Create"), allowGrowX: false, @@ -131,9 +131,14 @@ qx.Class.define("osparc.study.CreateFunction", { "input1": 5 }, }; - console.log("Creating function with data: ", functionData); - this.__createFunctionBtn.setFetching(false); + const params = { + data: functionData, + }; + osparc.data.Resources.fetch("functions", "create", params) + .then(() => osparc.FlashMessenger.logAs(this.tr("Function created"), "INFO")) + .catch(err => osparc.FlashMessenger.logError(err)) + .finally(() => this.__createFunctionBtn.setFetching(false)); }, getCreateFunctionButton: function() { From 83e8f15283a98799dc5b6ed14a374cd8c42b8881 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 14:46:25 +0200 Subject: [PATCH 05/13] functionData --- .../class/osparc/node/ParameterEditor.js | 10 +--- .../source/class/osparc/service/Utils.js | 18 ++++++- .../class/osparc/study/CreateFunction.js | 50 ++++++++++++++----- 3 files changed, 55 insertions(+), 23 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/node/ParameterEditor.js b/services/static-webserver/client/source/class/osparc/node/ParameterEditor.js index a5a6085dcaf2..a762a75af38a 100644 --- a/services/static-webserver/client/source/class/osparc/node/ParameterEditor.js +++ b/services/static-webserver/client/source/class/osparc/node/ParameterEditor.js @@ -29,17 +29,9 @@ qx.Class.define("osparc.node.ParameterEditor", { }, statics: { - getParameterOutputTypeFromMD: function(metadata) { - let type = metadata["outputs"]["out_1"]["type"]; - if (type === "ref_contentSchema") { - type = metadata["outputs"]["out_1"]["contentSchema"]["type"]; - } - return type; - }, - getParameterOutputType: function(node) { const metadata = node.getMetaData(); - return this.self().getParameterOutputTypeFromMD(metadata); + return osparc.service.Utils.getParameterType(metadata); }, setParameterOutputValue: function(node, val) { diff --git a/services/static-webserver/client/source/class/osparc/service/Utils.js b/services/static-webserver/client/source/class/osparc/service/Utils.js index ef6e687d2542..69d8ae8584fe 100644 --- a/services/static-webserver/client/source/class/osparc/service/Utils.js +++ b/services/static-webserver/client/source/class/osparc/service/Utils.js @@ -240,6 +240,22 @@ qx.Class.define("osparc.service.Utils", { } }); return services; - } + }, + + getParameterType: function(metadata) { + let type = metadata["outputs"]["out_1"]["type"]; + if (type === "ref_contentSchema") { + type = metadata["outputs"]["out_1"]["contentSchema"]["type"]; + } + return type; + }, + + getProbeType: function(metadata) { + let type = metadata["inputs"]["in_1"]["type"]; + if (type === "ref_contentSchema") { + type = metadata["inputs"]["in_1"]["contentSchema"]["type"]; + } + return type; + }, } }); diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 5c82532ca556..1585a57b7b44 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -110,28 +110,52 @@ qx.Class.define("osparc.study.CreateFunction", { "input_schema": { "schema_dict": { "type": "object", - "properties": { - "input1": { - "type": "integer" // InputTypes: TypeAlias = FileID | float | int | bool | str | list - } - } + "properties": {} } }, "output_schema": { "schema_dict": { "type": "object", - "properties": { - "output1": { - "type": "integer" // OutputTypes: TypeAlias = FileID | float | int | bool | str | list - } - } + "properties": {} } }, - "default_inputs": { - "input1": 5 - }, + "default_inputs": {}, }; + const filePickers = osparc.study.Utils.extractFilePickers(templateData["workbench"]); + filePickers.forEach(filePicker => { + const fpName = filePicker["name"]; + functionData["input_schema"]["schema_dict"]["properties"][fpName] = { + "type": "FileID", + }; + functionData["default_inputs"][fpName] = "asdfasdf"; + }); + + const parameters = osparc.study.Utils.extractParameters(templateData["workbench"]); + parameters.forEach(parameter => { + const parameterName = parameter["name"]; + const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); + if (parameterMetadata) { + functionData["input_schema"]["schema_dict"]["properties"][parameterName] = { + "type": osparc.service.Utils.getParameterType(parameterMetadata), + }; + } + functionData["default_inputs"][parameterName] = parameter["outputs"]["out_1"]; + }); + + const probes = osparc.study.Utils.extractProbes(templateData["workbench"]); + probes.forEach(probe => { + const probeName = probe["name"]; + const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); + if (probeMetadata) { + functionData["output_schema"]["schema_dict"]["properties"][probeName] = { + "type": osparc.service.Utils.getProbeType(probeMetadata), + }; + } + }); + + console.log("functionData", functionData); + const params = { data: functionData, }; From 4b869f224f4b9dd42a0743e4173e322ed8b12993 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 15:12:15 +0200 Subject: [PATCH 06/13] generate functionData --- .../client/source/class/osparc/service/Utils.js | 11 +++++++++++ .../source/class/osparc/study/CreateFunction.js | 17 +++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/service/Utils.js b/services/static-webserver/client/source/class/osparc/service/Utils.js index 69d8ae8584fe..b7499816eac4 100644 --- a/services/static-webserver/client/source/class/osparc/service/Utils.js +++ b/services/static-webserver/client/source/class/osparc/service/Utils.js @@ -250,6 +250,17 @@ qx.Class.define("osparc.service.Utils", { return type; }, + getParameterValue: function(parameterData) { + if ( + parameterData && + parameterData["outputs"] && + parameterData["outputs"]["out_1"] + ) { + return parameterData["outputs"]["out_1"]; + } + return null; + }, + getProbeType: function(metadata) { let type = metadata["inputs"]["in_1"]["type"]; if (type === "ref_contentSchema") { diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 1585a57b7b44..3200c401f8e1 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -124,31 +124,32 @@ qx.Class.define("osparc.study.CreateFunction", { const filePickers = osparc.study.Utils.extractFilePickers(templateData["workbench"]); filePickers.forEach(filePicker => { - const fpName = filePicker["name"]; - functionData["input_schema"]["schema_dict"]["properties"][fpName] = { + const fpLabel = filePicker["label"]; + functionData["input_schema"]["schema_dict"]["properties"][fpLabel] = { "type": "FileID", }; - functionData["default_inputs"][fpName] = "asdfasdf"; + const outputValue = osparc.file.FilePicker.getOutput(filePicker); + functionData["default_inputs"][fpLabel] = outputValue && outputValue["path"] ? outputValue["path"] : null; }); const parameters = osparc.study.Utils.extractParameters(templateData["workbench"]); parameters.forEach(parameter => { - const parameterName = parameter["name"]; + const parameterLabel = parameter["label"]; const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); if (parameterMetadata) { - functionData["input_schema"]["schema_dict"]["properties"][parameterName] = { + functionData["input_schema"]["schema_dict"]["properties"][parameterLabel] = { "type": osparc.service.Utils.getParameterType(parameterMetadata), }; } - functionData["default_inputs"][parameterName] = parameter["outputs"]["out_1"]; + functionData["default_inputs"][parameterLabel] = osparc.service.Utils.getParameterValue(parameter); }); const probes = osparc.study.Utils.extractProbes(templateData["workbench"]); probes.forEach(probe => { - const probeName = probe["name"]; + const probeLabel = probe["label"]; const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); if (probeMetadata) { - functionData["output_schema"]["schema_dict"]["properties"][probeName] = { + functionData["output_schema"]["schema_dict"]["properties"][probeLabel] = { "type": osparc.service.Utils.getProbeType(probeMetadata), }; } From 9ac415e66bb1c5cb22308ffe5f310c6b3c10e3b6 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 15:38:50 +0200 Subject: [PATCH 07/13] inputs --- .../class/osparc/study/CreateFunction.js | 138 +++++++++++++++++- 1 file changed, 137 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 3200c401f8e1..56d140b068b8 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -67,7 +67,143 @@ qx.Class.define("osparc.study.CreateFunction", { this.__createFunction(); } }, this); - this._add(createFunctionBtn); + + + // INPUTS + const inGrid = new qx.ui.layout.Grid(6, 6); + const inputsLayout = new qx.ui.container.Composite(inGrid).set({ + allowGrowX: false, + alignX: "left", + alignY: "middle" + }); + this._add(inputsLayout); + + // header + let row = 0; + let column = 0; + const nameLabel = new qx.ui.basic.Label(this.tr("Input name")); + inputsLayout.add(nameLabel, { + row, + column, + }); + column++; + const typeLabel = new qx.ui.basic.Label(this.tr("Type")); + inputsLayout.add(typeLabel, { + row, + column, + }); + column++; + const exposedLabel = new qx.ui.basic.Label(this.tr("Exposed")); + inputsLayout.add(exposedLabel, { + row, + column, + }); + column++; + const defaultValue = new qx.ui.basic.Label(this.tr("Default value")); + inputsLayout.add(defaultValue, { + row, + column, + }); + column = 0; + row++; + + const filePickers = osparc.study.Utils.extractFilePickers(this.__studyData["workbench"]); + filePickers.forEach(filePicker => { + const fpLabel = new qx.ui.basic.Label(filePicker["label"]); + inputsLayout.add(fpLabel, { + row, + column, + }); + column++; + + const fpType = new qx.ui.basic.Label("FileID"); + inputsLayout.add(fpType, { + row, + column, + }); + column++; + + const fpExposed = new qx.ui.form.CheckBox().set({ value: true }); + inputsLayout.add(fpExposed, { + row, + column, + }); + column++; + + const outputValue = osparc.file.FilePicker.getOutput(filePicker); + const fpDefaultValue = new qx.ui.basic.Label(outputValue && outputValue["path"] ? outputValue["path"] : null); + inputsLayout.add(fpDefaultValue, { + row, + column, + }); + column++; + + column = 0; + row++; + }); + + const parameters = osparc.study.Utils.extractParameters(this.__studyData["workbench"]); + parameters.forEach(parameter => { + const parameterLabel = new qx.ui.basic.Label(parameter["label"]); + inputsLayout.add(parameterLabel, { + row, + column, + }); + column++; + + const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); + if (parameterMetadata) { + const parameterType = new qx.ui.basic.Label(osparc.service.Utils.getParameterType(parameterMetadata)); + inputsLayout.add(parameterType, { + row, + column, + }); + } + column++; + + const parameterExposed = new qx.ui.form.CheckBox().set({ value: true }); + inputsLayout.add(parameterExposed, { + row, + column, + }); + column++; + + const parameterDefaultValue = new qx.ui.basic.Label(String(osparc.service.Utils.getParameterValue(parameter))); + inputsLayout.add(parameterDefaultValue, { + row, + column, + }); + column++; + + column = 0; + row++; + }); + + // OUTPUTS + const outGrid = new qx.ui.layout.Grid(6, 6); + const outputsLayout = new qx.ui.container.Composite(outGrid).set({ + allowGrowX: false, + alignX: "left", + alignY: "middle" + }); + this._add(outputsLayout); + + // header + const nameLabel2 = new qx.ui.basic.Label(this.tr("Output name")); + outputsLayout.add(nameLabel2, { + row: 0, + column: 0, + }); + const typeLabel2 = new qx.ui.basic.Label(this.tr("Type")); + outputsLayout.add(typeLabel2, { + row: 0, + column: 1, + }); + const exposedLabel2 = new qx.ui.basic.Label(this.tr("Exposed")); + outputsLayout.add(exposedLabel2, { + row: 0, + column: 2, + }); }, __createFunction: function() { From 54300b60a8f3a1cb434fef6806417c60942437c6 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 15:40:50 +0200 Subject: [PATCH 08/13] minor --- .../client/source/class/osparc/study/CreateFunction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 56d140b068b8..3d6fa07b1b43 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -81,7 +81,7 @@ qx.Class.define("osparc.study.CreateFunction", { // header let row = 0; let column = 0; - const nameLabel = new qx.ui.basic.Label(this.tr("Input name")); + const nameLabel = new qx.ui.basic.Label(this.tr("Input")); inputsLayout.add(nameLabel, { row, column, @@ -189,7 +189,7 @@ qx.Class.define("osparc.study.CreateFunction", { this._add(outputsLayout); // header - const nameLabel2 = new qx.ui.basic.Label(this.tr("Output name")); + const nameLabel2 = new qx.ui.basic.Label(this.tr("Output")); outputsLayout.add(nameLabel2, { row: 0, column: 0, From bf01de48f8774fbe4ddd70f23a6e2c2bf39c2eaa Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 16:00:43 +0200 Subject: [PATCH 09/13] minor --- .../client/source/class/osparc/study/CreateFunction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 3d6fa07b1b43..e25d66c27534 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -70,7 +70,7 @@ qx.Class.define("osparc.study.CreateFunction", { // INPUTS - const inGrid = new qx.ui.layout.Grid(6, 6); + const inGrid = new qx.ui.layout.Grid(10, 6); const inputsLayout = new qx.ui.container.Composite(inGrid).set({ allowGrowX: false, alignX: "left", @@ -180,7 +180,7 @@ qx.Class.define("osparc.study.CreateFunction", { }); // OUTPUTS - const outGrid = new qx.ui.layout.Grid(6, 6); + const outGrid = new qx.ui.layout.Grid(10, 6); const outputsLayout = new qx.ui.container.Composite(outGrid).set({ allowGrowX: false, alignX: "left", From 1169f279ecaf5ddabd4062a611034e16b322ed53 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 9 May 2025 16:54:25 +0200 Subject: [PATCH 10/13] exposedInputs, exposedOutputs --- .../class/osparc/study/CreateFunction.js | 127 +++++++++++++----- 1 file changed, 90 insertions(+), 37 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index e25d66c27534..4761c9e552f5 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -56,18 +56,9 @@ qx.Class.define("osparc.study.CreateFunction", { }); form.add(description, this.tr("Description"), null, "description"); - const createFunctionBtn = this.__createFunctionBtn = new osparc.ui.form.FetchButton().set({ - appearance: "strong-button", - label: this.tr("Create"), - allowGrowX: false, - alignX: "right" - }); - createFunctionBtn.addListener("execute", () => { - if (this.__form.validate()) { - this.__createFunction(); - } - }, this); + const exposedInputs = {}; + const exposedOutputs = {}; // INPUTS const inGrid = new qx.ui.layout.Grid(10, 6); @@ -128,10 +119,12 @@ qx.Class.define("osparc.study.CreateFunction", { row, column, }); + exposedInputs[filePicker["label"]] = true; + fpExposed.addListener("changeValue", e => exposedInputs[filePicker["label"]] = e.getData()); column++; const outputValue = osparc.file.FilePicker.getOutput(filePicker); - const fpDefaultValue = new qx.ui.basic.Label(outputValue && outputValue["path"] ? outputValue["path"] : null); + const fpDefaultValue = new qx.ui.basic.Label(outputValue && outputValue["path"] ? outputValue["path"] : ""); inputsLayout.add(fpDefaultValue, { row, column, @@ -166,6 +159,8 @@ qx.Class.define("osparc.study.CreateFunction", { row, column, }); + exposedInputs[parameter["label"]] = true; + parameterExposed.addListener("changeValue", e => exposedInputs[parameter["label"]] = e.getData()); column++; const parameterDefaultValue = new qx.ui.basic.Label(String(osparc.service.Utils.getParameterValue(parameter))); @@ -179,6 +174,7 @@ qx.Class.define("osparc.study.CreateFunction", { row++; }); + // OUTPUTS const outGrid = new qx.ui.layout.Grid(10, 6); const outputsLayout = new qx.ui.container.Composite(outGrid).set({ @@ -189,24 +185,75 @@ qx.Class.define("osparc.study.CreateFunction", { this._add(outputsLayout); // header + row = 0; + column = 0; const nameLabel2 = new qx.ui.basic.Label(this.tr("Output")); outputsLayout.add(nameLabel2, { - row: 0, - column: 0, + row, + column, }); + column++; const typeLabel2 = new qx.ui.basic.Label(this.tr("Type")); outputsLayout.add(typeLabel2, { - row: 0, - column: 1, + row, + column, }); + column++; const exposedLabel2 = new qx.ui.basic.Label(this.tr("Exposed")); outputsLayout.add(exposedLabel2, { - row: 0, - column: 2, + row, + column, + }); + column++; + column = 0; + row++; + + const probes = osparc.study.Utils.extractProbes(this.__studyData["workbench"]); + probes.forEach(probe => { + const parameterLabel = new qx.ui.basic.Label(probe["label"]); + outputsLayout.add(parameterLabel, { + row, + column, + }); + column++; + + const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); + if (probeMetadata) { + const probeType = new qx.ui.basic.Label(osparc.service.Utils.getProbeType(probeMetadata)); + outputsLayout.add(probeType, { + row, + column, + }); + } + column++; + + const probeExposed = new qx.ui.form.CheckBox().set({ value: true }); + outputsLayout.add(probeExposed, { + row, + column, + }); + exposedOutputs[probe["label"]] = true; + probeExposed.addListener("changeValue", e => exposedOutputs[probe["label"]] = e.getData()); + column++; + + column = 0; + row++; + }); + + const createFunctionBtn = this.__createFunctionBtn = new osparc.ui.form.FetchButton().set({ + appearance: "strong-button", + label: this.tr("Create"), + allowGrowX: false, + alignX: "right" }); + createFunctionBtn.addListener("execute", () => { + if (this.__form.validate()) { + this.__createFunction(exposedInputs, exposedOutputs); + } + }, this); }, - __createFunction: function() { + __createFunction: function(exposedInputs, exposedOutputs) { this.__createFunctionBtn.setFetching(true); // first publish it as a template @@ -225,7 +272,7 @@ qx.Class.define("osparc.study.CreateFunction", { .then(task => { task.addListener("resultReceived", e => { const templateData = e.getData(); - this.__doCreateFunction(templateData); + this.__doCreateFunction(templateData, exposedInputs, exposedOutputs); }); }) .catch(err => { @@ -234,7 +281,7 @@ qx.Class.define("osparc.study.CreateFunction", { }); }, - __doCreateFunction: function(templateData) { + __doCreateFunction: function(templateData, exposedInputs, exposedOutputs) { const nameField = this.__form.getItem("name"); const descriptionField = this.__form.getItem("description"); @@ -261,33 +308,39 @@ qx.Class.define("osparc.study.CreateFunction", { const filePickers = osparc.study.Utils.extractFilePickers(templateData["workbench"]); filePickers.forEach(filePicker => { const fpLabel = filePicker["label"]; - functionData["input_schema"]["schema_dict"]["properties"][fpLabel] = { - "type": "FileID", - }; - const outputValue = osparc.file.FilePicker.getOutput(filePicker); - functionData["default_inputs"][fpLabel] = outputValue && outputValue["path"] ? outputValue["path"] : null; + if (exposedInputs[fpLabel]) { + functionData["input_schema"]["schema_dict"]["properties"][fpLabel] = { + "type": "FileID", + }; + const outputValue = osparc.file.FilePicker.getOutput(filePicker); + functionData["default_inputs"][fpLabel] = outputValue && outputValue["path"] ? outputValue["path"] : null; + } }); const parameters = osparc.study.Utils.extractParameters(templateData["workbench"]); parameters.forEach(parameter => { const parameterLabel = parameter["label"]; - const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); - if (parameterMetadata) { - functionData["input_schema"]["schema_dict"]["properties"][parameterLabel] = { - "type": osparc.service.Utils.getParameterType(parameterMetadata), - }; + if (exposedInputs[parameterLabel]) { + const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); + if (parameterMetadata) { + functionData["input_schema"]["schema_dict"]["properties"][parameterLabel] = { + "type": osparc.service.Utils.getParameterType(parameterMetadata), + }; + } + functionData["default_inputs"][parameterLabel] = osparc.service.Utils.getParameterValue(parameter); } - functionData["default_inputs"][parameterLabel] = osparc.service.Utils.getParameterValue(parameter); }); const probes = osparc.study.Utils.extractProbes(templateData["workbench"]); probes.forEach(probe => { const probeLabel = probe["label"]; - const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); - if (probeMetadata) { - functionData["output_schema"]["schema_dict"]["properties"][probeLabel] = { - "type": osparc.service.Utils.getProbeType(probeMetadata), - }; + if (exposedOutputs[probeLabel]) { + const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); + if (probeMetadata) { + functionData["output_schema"]["schema_dict"]["properties"][probeLabel] = { + "type": osparc.service.Utils.getProbeType(probeMetadata), + }; + } } }); From c7167804e3f708d2dddda75e5d62c4bf79ee6875 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 12 May 2025 08:26:31 +0200 Subject: [PATCH 11/13] only floats --- .../class/osparc/study/CreateFunction.js | 57 ++----------------- .../client/source/class/osparc/study/Utils.js | 30 ++++++++-- 2 files changed, 28 insertions(+), 59 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index 4761c9e552f5..f7db15b92c21 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -98,44 +98,7 @@ qx.Class.define("osparc.study.CreateFunction", { column = 0; row++; - const filePickers = osparc.study.Utils.extractFilePickers(this.__studyData["workbench"]); - filePickers.forEach(filePicker => { - const fpLabel = new qx.ui.basic.Label(filePicker["label"]); - inputsLayout.add(fpLabel, { - row, - column, - }); - column++; - - const fpType = new qx.ui.basic.Label("FileID"); - inputsLayout.add(fpType, { - row, - column, - }); - column++; - - const fpExposed = new qx.ui.form.CheckBox().set({ value: true }); - inputsLayout.add(fpExposed, { - row, - column, - }); - exposedInputs[filePicker["label"]] = true; - fpExposed.addListener("changeValue", e => exposedInputs[filePicker["label"]] = e.getData()); - column++; - - const outputValue = osparc.file.FilePicker.getOutput(filePicker); - const fpDefaultValue = new qx.ui.basic.Label(outputValue && outputValue["path"] ? outputValue["path"] : ""); - inputsLayout.add(fpDefaultValue, { - row, - column, - }); - column++; - - column = 0; - row++; - }); - - const parameters = osparc.study.Utils.extractParameters(this.__studyData["workbench"]); + const parameters = osparc.study.Utils.extractFunctionableParameters(this.__studyData["workbench"]); parameters.forEach(parameter => { const parameterLabel = new qx.ui.basic.Label(parameter["label"]); inputsLayout.add(parameterLabel, { @@ -208,7 +171,7 @@ qx.Class.define("osparc.study.CreateFunction", { column = 0; row++; - const probes = osparc.study.Utils.extractProbes(this.__studyData["workbench"]); + const probes = osparc.study.Utils.extractFunctionableProbes(this.__studyData["workbench"]); probes.forEach(probe => { const parameterLabel = new qx.ui.basic.Label(probe["label"]); outputsLayout.add(parameterLabel, { @@ -305,19 +268,7 @@ qx.Class.define("osparc.study.CreateFunction", { "default_inputs": {}, }; - const filePickers = osparc.study.Utils.extractFilePickers(templateData["workbench"]); - filePickers.forEach(filePicker => { - const fpLabel = filePicker["label"]; - if (exposedInputs[fpLabel]) { - functionData["input_schema"]["schema_dict"]["properties"][fpLabel] = { - "type": "FileID", - }; - const outputValue = osparc.file.FilePicker.getOutput(filePicker); - functionData["default_inputs"][fpLabel] = outputValue && outputValue["path"] ? outputValue["path"] : null; - } - }); - - const parameters = osparc.study.Utils.extractParameters(templateData["workbench"]); + const parameters = osparc.study.Utils.extractFunctionableParameters(templateData["workbench"]); parameters.forEach(parameter => { const parameterLabel = parameter["label"]; if (exposedInputs[parameterLabel]) { @@ -331,7 +282,7 @@ qx.Class.define("osparc.study.CreateFunction", { } }); - const probes = osparc.study.Utils.extractProbes(templateData["workbench"]); + const probes = osparc.study.Utils.extractFunctionableProbes(templateData["workbench"]); probes.forEach(probe => { const probeLabel = probe["label"]; if (exposedOutputs[probeLabel]) { diff --git a/services/static-webserver/client/source/class/osparc/study/Utils.js b/services/static-webserver/client/source/class/osparc/study/Utils.js index 6630e7ca6115..02c52bbe7fe1 100644 --- a/services/static-webserver/client/source/class/osparc/study/Utils.js +++ b/services/static-webserver/client/source/class/osparc/study/Utils.js @@ -236,12 +236,24 @@ qx.Class.define("osparc.study.Utils", { }, extractParameters: function(workbench) { - const parameters = Object.values(workbench).filter(srv => srv["key"].includes("simcore/services/frontend/parameter/")); + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isParameter(srv)); + return parameters; + }, + + extractFunctionableParameters: function(workbench) { + // - for now, only float types are allowed + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isParameter(srv) && srv["key"].includes("parameter/float")); return parameters; }, extractProbes: function(workbench) { - const parameters = Object.values(workbench).filter(srv => srv["key"].includes("simcore/services/frontend/iterator-consumer/probe/")); + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isProbe(srv)); + return parameters; + }, + + extractFunctionableProbes: function(workbench) { + // - for now, only float types are allowed + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isProbe(srv) && srv["key"].includes("probe/float")); return parameters; }, @@ -253,10 +265,16 @@ qx.Class.define("osparc.study.Utils", { // in order to create a function, the pipeline needs: // - at least one parameter (or file-picker (file type parameter)) // - at least one probe - const filePickers = osparc.study.Utils.extractFilePickers(workbench); - const parameters = osparc.study.Utils.extractParameters(workbench); - const probes = osparc.study.Utils.extractProbes(workbench); - return (filePickers.length + parameters.length) && probes.length; + + // const filePickers = osparc.study.Utils.extractFilePickers(workbench); + // const parameters = osparc.study.Utils.extractParameters(workbench); + // const probes = osparc.study.Utils.extractProbes(workbench); + // return (filePickers.length + parameters.length) && probes.length; + + // - for now, only float types are allowed + const parameters = osparc.study.Utils.extractFunctionableParameters(workbench); + const probes = osparc.study.Utils.extractFunctionableProbes(workbench); + return parameters.length && probes.length; }, getCantExecuteServices: function(studyServices = []) { From 330241cc603268a07ba7a8d7a273eaa1fbeb1d09 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 12 May 2025 10:57:01 +0200 Subject: [PATCH 12/13] minor --- .../client/source/class/osparc/form/renderer/PropForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/form/renderer/PropForm.js b/services/static-webserver/client/source/class/osparc/form/renderer/PropForm.js index b62fc32be298..9a7d4d7ad34c 100644 --- a/services/static-webserver/client/source/class/osparc/form/renderer/PropForm.js +++ b/services/static-webserver/client/source/class/osparc/form/renderer/PropForm.js @@ -86,7 +86,7 @@ qx.Class.define("osparc.form.renderer.PropForm", { const supportedTypes = []; const paramsMD = osparc.store.Services.getParametersMetadata(); paramsMD.forEach(paramMD => { - supportedTypes.push(osparc.node.ParameterEditor.getParameterOutputTypeFromMD(paramMD)); + supportedTypes.push(osparc.service.Utils.getParameterType(paramMD)); }); return supportedTypes.includes(field.type); }, From 5d9f9ee55cff50ea9d802720fdc5ab03e86c1f8f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 12 May 2025 11:07:22 +0200 Subject: [PATCH 13/13] map types --- .../class/osparc/study/CreateFunction.js | 113 ++++++++++-------- .../client/source/class/osparc/study/Utils.js | 4 +- 2 files changed, 68 insertions(+), 49 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js index f7db15b92c21..e74009b10247 100644 --- a/services/static-webserver/client/source/class/osparc/study/CreateFunction.js +++ b/services/static-webserver/client/source/class/osparc/study/CreateFunction.js @@ -32,6 +32,71 @@ qx.Class.define("osparc.study.CreateFunction", { this.__buildLayout(); }, + statics: { + typeToFunctionType: function(type) { + switch (type) { + case "number": + return "float" + case "data:*/*": + return "FileID" + } + return type; + }, + + createFunctionData: function(projectData, name, description, exposedInputs, exposedOutputs) { + const functionData = { + "project_id": projectData["uuid"], + "name": name, + "description": description, + "function_class": "project", + "input_schema": { + "schema_dict": { + "type": "object", + "properties": {} + } + }, + "output_schema": { + "schema_dict": { + "type": "object", + "properties": {} + } + }, + "default_inputs": {}, + }; + + const parameters = osparc.study.Utils.extractFunctionableParameters(projectData["workbench"]); + parameters.forEach(parameter => { + const parameterLabel = parameter["label"]; + if (exposedInputs[parameterLabel]) { + const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); + if (parameterMetadata) { + const type = osparc.service.Utils.getParameterType(parameterMetadata); + functionData["input_schema"]["schema_dict"]["properties"][parameterLabel] = { + "type": this.self().typeToFunctionType(type), + }; + } + functionData["default_inputs"][parameterLabel] = osparc.service.Utils.getParameterValue(parameter); + } + }); + + const probes = osparc.study.Utils.extractFunctionableProbes(projectData["workbench"]); + probes.forEach(probe => { + const probeLabel = probe["label"]; + if (exposedOutputs[probeLabel]) { + const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); + if (probeMetadata) { + const type = osparc.service.Utils.getProbeType(probeMetadata); + functionData["output_schema"]["schema_dict"]["properties"][probeLabel] = { + "type": this.self().typeToFunctionType(type), + }; + } + } + }); + + return functionData; + } + }, + members: { __studyData: null, __form: null, @@ -248,53 +313,7 @@ qx.Class.define("osparc.study.CreateFunction", { const nameField = this.__form.getItem("name"); const descriptionField = this.__form.getItem("description"); - const functionData = { - "name": nameField.getValue(), - "description": descriptionField.getValue(), - "project_id": templateData["uuid"], - "function_class": "project", - "input_schema": { - "schema_dict": { - "type": "object", - "properties": {} - } - }, - "output_schema": { - "schema_dict": { - "type": "object", - "properties": {} - } - }, - "default_inputs": {}, - }; - - const parameters = osparc.study.Utils.extractFunctionableParameters(templateData["workbench"]); - parameters.forEach(parameter => { - const parameterLabel = parameter["label"]; - if (exposedInputs[parameterLabel]) { - const parameterMetadata = osparc.store.Services.getMetadata(parameter["key"], parameter["version"]); - if (parameterMetadata) { - functionData["input_schema"]["schema_dict"]["properties"][parameterLabel] = { - "type": osparc.service.Utils.getParameterType(parameterMetadata), - }; - } - functionData["default_inputs"][parameterLabel] = osparc.service.Utils.getParameterValue(parameter); - } - }); - - const probes = osparc.study.Utils.extractFunctionableProbes(templateData["workbench"]); - probes.forEach(probe => { - const probeLabel = probe["label"]; - if (exposedOutputs[probeLabel]) { - const probeMetadata = osparc.store.Services.getMetadata(probe["key"], probe["version"]); - if (probeMetadata) { - functionData["output_schema"]["schema_dict"]["properties"][probeLabel] = { - "type": osparc.service.Utils.getProbeType(probeMetadata), - }; - } - } - }); - + const functionData = this.self().createFunctionData(templateData, nameField.getValue(), descriptionField.getValue(), exposedInputs, exposedOutputs); console.log("functionData", functionData); const params = { diff --git a/services/static-webserver/client/source/class/osparc/study/Utils.js b/services/static-webserver/client/source/class/osparc/study/Utils.js index 02c52bbe7fe1..cdaa3ca712db 100644 --- a/services/static-webserver/client/source/class/osparc/study/Utils.js +++ b/services/static-webserver/client/source/class/osparc/study/Utils.js @@ -242,7 +242,7 @@ qx.Class.define("osparc.study.Utils", { extractFunctionableParameters: function(workbench) { // - for now, only float types are allowed - const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isParameter(srv) && srv["key"].includes("parameter/float")); + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isParameter(srv) && srv["key"].includes("parameter/number")); return parameters; }, @@ -253,7 +253,7 @@ qx.Class.define("osparc.study.Utils", { extractFunctionableProbes: function(workbench) { // - for now, only float types are allowed - const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isProbe(srv) && srv["key"].includes("probe/float")); + const parameters = Object.values(workbench).filter(srv => osparc.data.model.Node.isProbe(srv) && srv["key"].includes("probe/number")); return parameters; },