Skip to content

Commit 0730883

Browse files
authored
minor
1 parent 63f1d24 commit 0730883

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ qx.Class.define("osparc.workbench.ServiceCatalog", {
201201
const excludeDeprecated = true;
202202
osparc.store.Services.getServicesLatestList(excludeFrontend, excludeDeprecated)
203203
.then(servicesList => {
204-
this.__servicesLatest = servicesList.filter(service => service !== null);
204+
// first check metadata is complete
205+
this.__servicesLatest = servicesList.filter(service => service !== null && service.inputs && service.outputs);
205206
this.__updateList();
206207
});
207208
},
@@ -210,19 +211,16 @@ qx.Class.define("osparc.workbench.ServiceCatalog", {
210211
osparc.filter.UIFilterController.getInstance().resetGroup("serviceCatalog");
211212
const filteredServices = [];
212213
this.__servicesLatest.forEach(service => {
213-
// first check metadata is complete
214-
if (service.inputs && service.outputs) {
215-
if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) {
214+
if (this.__contextLeftNodeId === null && this.__contextRightNodeId === null) {
215+
filteredServices.push(service);
216+
} else {
217+
// filter out services that can't be connected
218+
const needsInputs = this.__contextLeftNodeId !== null;
219+
const needsOutputs = this.__contextRightNodeId !== null;
220+
let connectable = needsInputs ? Boolean(Object.keys(service.inputs).length) : true;
221+
connectable = connectable && (needsOutputs ? Boolean(Object.keys(service.outputs).length) : true);
222+
if (connectable) {
216223
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-
}
226224
}
227225
}
228226
});

0 commit comments

Comments
 (0)