Skip to content

Commit 63f1d24

Browse files
authored
check metadata is complete
1 parent b5d600f commit 63f1d24

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,19 @@ qx.Class.define("osparc.workbench.ServiceCatalog", {
210210
osparc.filter.UIFilterController.getInstance().resetGroup("serviceCatalog");
211211
const filteredServices = [];
212212
this.__servicesLatest.forEach(service => {
213-
if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) {
214-
filteredServices.push(service);
215-
} else if (service.inputs && service.outputs) {
216-
// filter out services that can't be connected
217-
const needsInputs = this.__contextLeftNodeId !== null;
218-
const needsOutputs = this.__contextRightNodeId !== null;
219-
let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true;
220-
connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true);
221-
if (connectable) {
213+
// first check metadata is complete
214+
if (service.inputs && service.outputs) {
215+
if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) {
222216
filteredServices.push(service);
217+
} else {
218+
// filter out services that can't be connected
219+
const needsInputs = this.__contextLeftNodeId !== null;
220+
const needsOutputs = this.__contextRightNodeId !== null;
221+
let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true;
222+
connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true);
223+
if (connectable) {
224+
filteredServices.push(service);
225+
}
223226
}
224227
}
225228
});

0 commit comments

Comments
 (0)