diff --git a/services/static-webserver/client/source/class/osparc/component/notification/NotificationUI.js b/services/static-webserver/client/source/class/osparc/component/notification/NotificationUI.js index c401616aa84..e90d90601b7 100644 --- a/services/static-webserver/client/source/class/osparc/component/notification/NotificationUI.js +++ b/services/static-webserver/client/source/class/osparc/component/notification/NotificationUI.js @@ -186,8 +186,17 @@ qx.Class.define("osparc.component.notification.NotificationUI", { case "NEW_ORGANIZATION": { const items = actionablePath.split("/"); const orgId = items.pop(); - const orgsWindow = osparc.desktop.organizations.OrganizationsWindow.openWindow(); - orgsWindow.openOrganizationDetails(parseInt(orgId)); + // make sure org is available + osparc.store.Store.getInstance().getGroup(orgId) + .then(org => { + if (org) { + const orgsWindow = osparc.desktop.organizations.OrganizationsWindow.openWindow(); + orgsWindow.openOrganizationDetails(parseInt(orgId)); + } else { + const msg = this.tr("You don't have access anymore"); + osparc.component.message.FlashMessenger.getInstance().logAs(msg, "WARNING"); + } + }); break; } case "TEMPLATE_SHARED": @@ -209,6 +218,11 @@ qx.Class.define("osparc.component.notification.NotificationUI", { const win = osparc.dashboard.ResourceMoreOptions.popUpInWindow(moreOpts); moreOpts.addListener("openingStudy", () => win.close()); } + }) + .catch(err => { + console.error(err); + const msg = this.tr("You don't have access anymore"); + osparc.component.message.FlashMessenger.getInstance().logAs(msg, "WARNING"); }); break; } diff --git a/services/static-webserver/client/source/class/osparc/component/widget/PreparingInputs.js b/services/static-webserver/client/source/class/osparc/component/widget/PreparingInputs.js index cd592004229..577f35552a9 100644 --- a/services/static-webserver/client/source/class/osparc/component/widget/PreparingInputs.js +++ b/services/static-webserver/client/source/class/osparc/component/widget/PreparingInputs.js @@ -157,8 +157,8 @@ qx.Class.define("osparc.component.widget.PreparingInputs", { const fetching = [ "PUBLISHED", "PENDING", - "STARTED", - "WAITING_FOR_RESOURCES" + "WAITING_FOR_RESOURCES", + "STARTED" ].includes(nodeRunningStatus); rerunBtn.setFetching(fetching); const rerunnable = [ diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index cb73403a645..a85dca4ad06 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -1134,6 +1134,7 @@ qx.Class.define("osparc.data.Resources", { }, getWallets: function() { + const myGid = osparc.auth.Data.getInstance().getGroupId(); return new Promise(resolve => { resolve({ wallets: [{ @@ -1142,9 +1143,9 @@ qx.Class.define("osparc.data.Resources", { description: "Personal Wallet", thumbnail: null, type: "personal", - owner: 2, + owner: myGid, accessRights: { - 2: { + [myGid]: { delete: true, write: true, read: true @@ -1160,14 +1161,14 @@ qx.Class.define("osparc.data.Resources", { description: "Organization wide Wallet", thumbnail: null, type: "shared", - owner: 2, + owner: myGid, accessRights: { - 2: { + [myGid]: { delete: false, write: true, read: true }, - 10: { + 417: { delete: false, write: false, read: true @@ -1183,21 +1184,16 @@ qx.Class.define("osparc.data.Resources", { description: "Organization wide Wallet 2", thumbnail: null, type: "shared", - owner: 4, + owner: 417, accessRights: { - 2: { - delete: false, - write: false, - read: true - }, - 10: { - delete: false, + 417: { + delete: true, write: true, read: true }, - 11: { - delete: true, - write: true, + [myGid]: { + delete: false, + write: false, read: true } }, diff --git a/services/static-webserver/client/source/class/osparc/data/model/NodeStatus.js b/services/static-webserver/client/source/class/osparc/data/model/NodeStatus.js index 43ca38e7c14..ab54372bdd6 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/NodeStatus.js +++ b/services/static-webserver/client/source/class/osparc/data/model/NodeStatus.js @@ -56,7 +56,7 @@ qx.Class.define("osparc.data.model.NodeStatus", { }, running: { - check: ["UNKNOWN", "NOT_STARTED", "PUBLISHED", "PENDING", "STARTED", "RETRY", "SUCCESS", "FAILED", "ABORTED", "WAITING_FOR_RESOURCES"], + check: ["UNKNOWN", "NOT_STARTED", "PUBLISHED", "PENDING", "WAITING_FOR_RESOURCES", "STARTED", "RETRY", "SUCCESS", "FAILED", "ABORTED"], nullable: true, init: null, event: "changeRunning", @@ -117,7 +117,7 @@ qx.Class.define("osparc.data.model.NodeStatus", { isComputationalRunning(node) { if (node && node.isComputational()) { - return ["PUBLISHED", "PENDING", "STARTED", "WAITING_FOR_RESOURCES"].includes(node.getStatus().getRunning()); + return ["PUBLISHED", "PENDING", "WAITING_FOR_RESOURCES", "STARTED"].includes(node.getStatus().getRunning()); } return false; }, @@ -177,7 +177,7 @@ qx.Class.define("osparc.data.model.NodeStatus", { const hasOutputs = this.getHasOutputs(); const modified = this.getModified(); const hasDependencies = this.hasDependencies(); - if (["PUBLISHED", "PENDING", "STARTED", "WAITING_FOR_RESOURCES"].includes(compRunning)) { + if (["PUBLISHED", "PENDING", "WAITING_FOR_RESOURCES", "STARTED"].includes(compRunning)) { this.setOutput("busy"); } else if ([null, false].includes(hasOutputs)) { this.setOutput("not-available"); diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index fe1eff40325..dbdac62d001 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -306,9 +306,9 @@ qx.Class.define("osparc.data.model.Study", { return [ "PUBLISHED", "PENDING", + "WAITING_FOR_RESOURCES", "STARTED", - "RETRY", - "WAITING_FOR_RESOURCES" + "RETRY" ].includes(state); } }, diff --git a/services/static-webserver/client/source/class/osparc/desktop/credits/BuyCredits.js b/services/static-webserver/client/source/class/osparc/desktop/credits/BuyCredits.js index f659faa5514..eb43efd1c7d 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/credits/BuyCredits.js +++ b/services/static-webserver/client/source/class/osparc/desktop/credits/BuyCredits.js @@ -180,10 +180,12 @@ qx.Class.define("osparc.desktop.credits.BuyCredits", { walletSelector.addListener("changeSelection", e => { const selection = e.getData(); - const store = osparc.store.Store.getInstance(); - const found = store.getWallets().find(wallet => wallet.getWalletId() === parseInt(selection[0].walletId)); - if (found) { - this.setWallet(found); + if (selection.length) { + const store = osparc.store.Store.getInstance(); + const found = store.getWallets().find(wallet => wallet.getWalletId() === parseInt(selection[0].walletId)); + if (found) { + this.setWallet(found); + } } }); diff --git a/services/static-webserver/client/source/class/osparc/ui/basic/NodeStatusUI.js b/services/static-webserver/client/source/class/osparc/ui/basic/NodeStatusUI.js index 210228e64cb..956ade03cdb 100644 --- a/services/static-webserver/client/source/class/osparc/ui/basic/NodeStatusUI.js +++ b/services/static-webserver/client/source/class/osparc/ui/basic/NodeStatusUI.js @@ -59,7 +59,8 @@ qx.Class.define("osparc.ui.basic.NodeStatusUI", { converter: state => { if (state) { this.show(); - const labelValue = osparc.utils.StatusUI.getLabelValue(state); + let labelValue = osparc.utils.StatusUI.getLabelValue(state); + labelValue = labelValue.replaceAll("_", " "); return qx.lang.String.firstUp(labelValue.toLowerCase()); } this.exclude(); @@ -83,11 +84,11 @@ qx.Class.define("osparc.ui.basic.NodeStatusUI", { osparc.utils.Utils.removeClass(this.getChildControl("icon").getContentElement(), "rotate"); target.setTextColor(osparc.utils.StatusUI.getColor(state)); return; - case "PENDING": case "PUBLISHED": + case "PENDING": + case "WAITING_FOR_RESOURCES": case "STARTED": case "RETRY": - case "WAITING_FOR_RESOURCES": osparc.utils.Utils.addClass(this.getChildControl("icon").getContentElement(), "rotate"); target.setTextColor(osparc.utils.StatusUI.getColor(state)); return; diff --git a/services/static-webserver/client/source/class/osparc/utils/StatusUI.js b/services/static-webserver/client/source/class/osparc/utils/StatusUI.js index 51737d965dc..9425125cc6b 100644 --- a/services/static-webserver/client/source/class/osparc/utils/StatusUI.js +++ b/services/static-webserver/client/source/class/osparc/utils/StatusUI.js @@ -50,9 +50,9 @@ qx.Class.define("osparc.utils.StatusUI", { return ""; case "PUBLISHED": case "PENDING": + case "WAITING_FOR_RESOURCES": case "STARTED": case "RETRY": - case "WAITING_FOR_RESOURCES": return "@FontAwesome5Solid/circle-notch/"+size; case "SUCCESS": return "@FontAwesome5Solid/check/"+size; @@ -154,9 +154,9 @@ qx.Class.define("osparc.utils.StatusUI", { return "ready-green"; case "PUBLISHED": case "PENDING": + case "WAITING_FOR_RESOURCES": case "STARTED": case "RETRY": - case "WAITING_FOR_RESOURCES": return "busy-orange"; case "FAILED": case "ABORTED": @@ -208,9 +208,9 @@ qx.Class.define("osparc.utils.StatusUI", { return "border-error"; case "PUBLISHED": case "PENDING": + case "WAITING_FOR_RESOURCES": case "STARTED": case "RETRY": - case "WAITING_FOR_RESOURCES": return "border-busy"; case "UNKNOWN": case "NOT_STARTED":