From b5d600f1faf6416f3e7bda82fc1662b8f6c907a0 Mon Sep 17 00:00:00 2001 From: Odei Maiz <33152403+odeimaiz@users.noreply.github.com> Date: Sat, 7 Jun 2025 08:48:14 +0200 Subject: [PATCH 1/3] make sure information is complete --- .../client/source/class/osparc/workbench/ServiceCatalog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js index 4bb6b869398..2b27c083ea0 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js +++ b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js @@ -212,7 +212,7 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { this.__servicesLatest.forEach(service => { if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) { filteredServices.push(service); - } else { + } else if (service.inputs && service.outputs) { // filter out services that can't be connected const needsInputs = this.__contextLeftNodeId !== null; const needsOutputs = this.__contextRightNodeId !== null; From 63f1d246a93babd64cfc699fe7e4b941c08508ab Mon Sep 17 00:00:00 2001 From: Odei Maiz <33152403+odeimaiz@users.noreply.github.com> Date: Sat, 7 Jun 2025 09:02:34 +0200 Subject: [PATCH 2/3] check metadata is complete --- .../class/osparc/workbench/ServiceCatalog.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js index 2b27c083ea0..2aaf45de114 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js +++ b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js @@ -210,16 +210,19 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { osparc.filter.UIFilterController.getInstance().resetGroup("serviceCatalog"); const filteredServices = []; this.__servicesLatest.forEach(service => { - if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) { - filteredServices.push(service); - } else if (service.inputs && service.outputs) { - // filter out services that can't be connected - const needsInputs = this.__contextLeftNodeId !== null; - const needsOutputs = this.__contextRightNodeId !== null; - let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true; - connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true); - if (connectable) { + // first check metadata is complete + if (service.inputs && service.outputs) { + if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) { filteredServices.push(service); + } else { + // filter out services that can't be connected + const needsInputs = this.__contextLeftNodeId !== null; + const needsOutputs = this.__contextRightNodeId !== null; + let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true; + connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true); + if (connectable) { + filteredServices.push(service); + } } } }); From 0730883d1bfb8840b181ba96cb7989bdbdbf467f Mon Sep 17 00:00:00 2001 From: Odei Maiz <33152403+odeimaiz@users.noreply.github.com> Date: Sat, 7 Jun 2025 09:03:54 +0200 Subject: [PATCH 3/3] minor --- .../class/osparc/workbench/ServiceCatalog.js | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js index 2aaf45de114..42ee0571d9e 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js +++ b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js @@ -201,7 +201,8 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { const excludeDeprecated = true; osparc.store.Services.getServicesLatestList(excludeFrontend, excludeDeprecated) .then(servicesList => { - this.__servicesLatest = servicesList.filter(service => service !== null); + // first check metadata is complete + this.__servicesLatest = servicesList.filter(service => service !== null && service.inputs && service.outputs); this.__updateList(); }); }, @@ -210,19 +211,16 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { osparc.filter.UIFilterController.getInstance().resetGroup("serviceCatalog"); const filteredServices = []; this.__servicesLatest.forEach(service => { - // first check metadata is complete - if (service.inputs && service.outputs) { - if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) { + if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) { + filteredServices.push(service); + } else { + // filter out services that can't be connected + const needsInputs = this.__contextLeftNodeId !== null; + const needsOutputs = this.__contextRightNodeId !== null; + let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true; + connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true); + if (connectable) { filteredServices.push(service); - } else { - // filter out services that can't be connected - const needsInputs = this.__contextLeftNodeId !== null; - const needsOutputs = this.__contextRightNodeId !== null; - let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true; - connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true); - if (connectable) { - filteredServices.push(service); - } } } });