diff --git a/api/specs/webserver/openapi-user.yaml b/api/specs/webserver/openapi-user.yaml index 586c4ecac4a..5a8d90c76be 100644 --- a/api/specs/webserver/openapi-user.yaml +++ b/api/specs/webserver/openapi-user.yaml @@ -140,7 +140,7 @@ paths: in: path required: true schema: - type: integer + type: string patch: tags: - user diff --git a/services/static-webserver/client/source/class/osparc/component/service/ServiceButtonList.js b/services/static-webserver/client/source/class/osparc/component/service/ServiceButtonList.js index e8d5f07bb3d..7feed0dd645 100644 --- a/services/static-webserver/client/source/class/osparc/component/service/ServiceButtonList.js +++ b/services/static-webserver/client/source/class/osparc/component/service/ServiceButtonList.js @@ -100,7 +100,8 @@ qx.Class.define("osparc.component.service.ServiceButtonList", { _filterTags: function(tags) { if (tags && tags.length) { - const type = this.getServiceModel().getType() || ""; + // xtype is a tuned type by the frontend + const type = this.getServiceModel().getXType() || ""; if (!tags.includes(osparc.utils.Utils.capitalize(type.trim()))) { return true; } diff --git a/services/static-webserver/client/source/class/osparc/store/Store.js b/services/static-webserver/client/source/class/osparc/store/Store.js index 65018aa56e2..5de2bd7dfda 100644 --- a/services/static-webserver/client/source/class/osparc/store/Store.js +++ b/services/static-webserver/client/source/class/osparc/store/Store.js @@ -339,17 +339,19 @@ qx.Class.define("osparc.store.Store", { }) .catch(err => console.error("getServices failed", err)) .finally(() => { + let servicesObj = {}; if (includeRetired) { - const servicesObj = osparc.utils.Services.convertArrayToObject(allServices); - osparc.utils.Services.addTSRInfo(servicesObj); - osparc.utils.Services.servicesCached = servicesObj; - resolve(servicesObj); + servicesObj = osparc.utils.Services.convertArrayToObject(allServices); } else { const nonDepServices = allServices.filter(service => !(osparc.utils.Services.isRetired(service) || osparc.utils.Services.isDeprecated(service))); - const servicesObj = osparc.utils.Services.convertArrayToObject(nonDepServices); - osparc.utils.Services.addTSRInfo(servicesObj); - resolve(servicesObj); + servicesObj = osparc.utils.Services.convertArrayToObject(nonDepServices); + } + osparc.utils.Services.addTSRInfo(servicesObj); + osparc.utils.Services.addExtraTypeInfo(servicesObj); + if (includeRetired) { + osparc.utils.Services.servicesCached = servicesObj; } + resolve(servicesObj); }); }); }, diff --git a/services/static-webserver/client/source/class/osparc/utils/Services.js b/services/static-webserver/client/source/class/osparc/utils/Services.js index 8ebf82aabe4..87a0e431be4 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Services.js +++ b/services/static-webserver/client/source/class/osparc/utils/Services.js @@ -343,6 +343,25 @@ qx.Class.define("osparc.utils.Services", { }); }, + addExtraTypeInfo: function(services) { + Object.values(services).forEach(serviceWVersion => { + Object.values(serviceWVersion).forEach(service => { + service["xType"] = service["type"]; + if (["backend", "frontend"].includes(service["xType"])) { + if (osparc.data.model.Node.isFilePicker(service)) { + service["xType"] = "file"; + } else if (osparc.data.model.Node.isParameter(service)) { + service["xType"] = "parameter"; + } else if (osparc.data.model.Node.isIterator(service)) { + service["xType"] = "iterator"; + } else if (osparc.data.model.Node.isProbe(service)) { + service["xType"] = "probe"; + } + } + }); + }); + }, + removeFileToKeyMap: function(service) { [ "inputs", diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index cd331a69009..0ebf40e90b8 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -1313,7 +1313,7 @@ paths: in: path required: true schema: - type: integer + type: string patch: tags: - user diff --git a/services/web/server/src/simcore_service_webserver/users_handlers.py b/services/web/server/src/simcore_service_webserver/users_handlers.py index f136e41026c..eec03ca3527 100644 --- a/services/web/server/src/simcore_service_webserver/users_handlers.py +++ b/services/web/server/src/simcore_service_webserver/users_handlers.py @@ -162,7 +162,7 @@ async def update_user_notification(request: web.Request): nid = request.match_info["nid"] notifs = await _get_user_notifications(redis_client, user_id) notif_idx = next((idx for (idx, n) in enumerate(notifs) if n["id"] == nid), None) - if notif_idx: + if notif_idx is not None: notif = notifs[notif_idx] # body includes a dict with the changes to make body = await request.json()