From b536c7e924607c944b9aec03a72e0131311650f9 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 12 Jun 2025 11:26:29 +0200 Subject: [PATCH 1/5] handle errored /services --- .../source/class/osparc/dashboard/CardBase.js | 53 ++++++++++++------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index 1ca9f2d6da6a..29846e131019 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -405,7 +405,7 @@ qx.Class.define("osparc.dashboard.CardBase", { services: { check: "Array", init: true, - nullable: false, + nullable: true, apply: "__applyServices", event: "changeServices", }, @@ -567,7 +567,10 @@ qx.Class.define("osparc.dashboard.CardBase", { resourceData["services"] = services; this.setServices(services); }) - .catch(err => console.error(err)); + .catch(err => { + this.setServices(null); + console.error(err); + }); osparc.study.Utils.guessIcon(resourceData) .then(iconSource => this.setIcon(iconSource)); @@ -688,27 +691,37 @@ qx.Class.define("osparc.dashboard.CardBase", { }, __applyServices: function(services) { - this.setEmptyWorkbench(services.length === 0); - - // Updatable study - if (osparc.study.Utils.anyServiceRetired(services)) { - this.setUpdatable("retired"); - } else if (osparc.study.Utils.anyServiceDeprecated(services)) { - this.setUpdatable("deprecated"); - } else if (osparc.study.Utils.anyServiceUpdatable(services)) { - this.setUpdatable("updatable"); - } - - // Block card - const cantReadServices = osparc.study.Utils.getCantReadServices(services); - if (cantReadServices.length) { + const unknownServices = cantReadServices => { + // Block card this.setBlocked("UNKNOWN_SERVICES"); const image = "@FontAwesome5Solid/ban/"; - let toolTipText = this.tr("Inaccessible service(s):"); - cantReadServices.forEach(unSrv => { - toolTipText += "
" + unSrv.key + ":" + osparc.service.Utils.extractVersionDisplay(unSrv.release); - }); + if (cantReadServices && cantReadServices.length) { + let toolTipText = this.tr("Inaccessible service(s):"); + cantReadServices.forEach(unSrv => { + toolTipText += "
" + unSrv.key + ":" + osparc.service.Utils.extractVersionDisplay(unSrv.release); + }); + } this.__showBlockedCard(image, toolTipText); + }; + + if (services) { + this.setEmptyWorkbench(services.length === 0); + + // Updatable study + if (osparc.study.Utils.anyServiceRetired(services)) { + this.setUpdatable("retired"); + } else if (osparc.study.Utils.anyServiceDeprecated(services)) { + this.setUpdatable("deprecated"); + } else if (osparc.study.Utils.anyServiceUpdatable(services)) { + this.setUpdatable("updatable"); + } + + const cantReadServices = osparc.study.Utils.getCantReadServices(services); + if (cantReadServices.length) { + unknownServices(cantReadServices); + } + } else { + unknownServices(); } this.evaluateMenuButtons(); From f4e8a166b9f158e3750d61c32c1eaaae43970db9 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 12 Jun 2025 11:33:46 +0200 Subject: [PATCH 2/5] minor --- .../client/source/class/osparc/dashboard/CardBase.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index 29846e131019..8f33ce282aaf 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -695,8 +695,9 @@ qx.Class.define("osparc.dashboard.CardBase", { // Block card this.setBlocked("UNKNOWN_SERVICES"); const image = "@FontAwesome5Solid/ban/"; + let toolTipText = this.tr("Unknown service(s)"); if (cantReadServices && cantReadServices.length) { - let toolTipText = this.tr("Inaccessible service(s):"); + toolTipText = this.tr("Inaccessible service(s)"); cantReadServices.forEach(unSrv => { toolTipText += "
" + unSrv.key + ":" + osparc.service.Utils.extractVersionDisplay(unSrv.release); }); From 585bab3c7fac05b603b103a31e83534661ac97e8 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 12 Jun 2025 11:45:09 +0200 Subject: [PATCH 3/5] fix --- .../client/source/class/osparc/dashboard/ResourceDetails.js | 2 +- 1 file changed, 1 insertion(+), 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 2f9454212e38..df7146df45dc 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js @@ -804,7 +804,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { __getCreateTemplatePage: function() { if ( !osparc.utils.Resources.isStudy(this.__resourceData) || - osparc.product.Utils.showTemplates() + !osparc.product.Utils.showTemplates() ) { return null; } From 665ba79ab70b3c0f2f6acd2ba996c6a17f72456d Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 12 Jun 2025 12:34:42 +0200 Subject: [PATCH 4/5] block sections --- .../client/source/class/osparc/dashboard/CardBase.js | 1 + .../client/source/class/osparc/study/Utils.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index 8f33ce282aaf..9cefd0c9affa 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -568,6 +568,7 @@ qx.Class.define("osparc.dashboard.CardBase", { this.setServices(services); }) .catch(err => { + resourceData["services"] = null; this.setServices(null); console.error(err); }); 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 35902e6d4aa7..51953df991db 100644 --- a/services/static-webserver/client/source/class/osparc/study/Utils.js +++ b/services/static-webserver/client/source/class/osparc/study/Utils.js @@ -355,7 +355,9 @@ qx.Class.define("osparc.study.Utils", { }, __getBlockedState: function(studyData) { - if (studyData["services"]) { + if (studyData["services"] === null) { + return "UNKNOWN_SERVICES"; + } else if (studyData["services"]) { const cantReadServices = osparc.study.Utils.getCantReadServices(studyData["services"]); const inaccessibleServices = osparc.store.Services.getInaccessibleServices(studyData["workbench"]); if (cantReadServices.length || inaccessibleServices.length) { From cd5f7c25e93d5619f14d8770745068a5ca48f9d6 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 12 Jun 2025 15:11:04 +0200 Subject: [PATCH 5/5] minor --- .../client/source/class/osparc/dashboard/DataBrowser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js b/services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js index f109994119c2..024cca2100a1 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js @@ -43,7 +43,9 @@ qx.Class.define("osparc.dashboard.DataBrowser", { let control; switch (id) { case "tree-folder-view": - control = new osparc.file.TreeFolderView(); + control = new osparc.file.TreeFolderView().set({ + paddingBottom: 15, + }); this._addToLayout(control, { flex: 1 });