From 45b07da2b7e58a05a496e7b63d3a6b944028024c Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 15 Oct 2024 16:34:47 +0200 Subject: [PATCH] [skip ci] upload icons working --- .../class/osparc/desktop/StudyEditor.js | 40 ++++++++++++++----- .../source/class/osparc/widget/NodeOutputs.js | 13 +++--- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index bf6102a5f6e..91434f71170 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -466,29 +466,49 @@ qx.Class.define("osparc.desktop.StudyEditor", { return; } - if (node.getPropForm()) { + const propsForm = node.getPropsForm(); + if (propsForm) { const portId = socketData["port_key"]; const status = socketData["status"]; switch (status) { case "DOWNLOAD_STARTED": - node.getPropForm().retrievingPortData( + propsForm.retrievingPortData( portId, osparc.form.renderer.PropForm.RETRIEVE_STATUS.downloading); break; + case "DOWNLOAD_FINISHED_SUCCESSFULLY": + propsForm.retrievedPortData(portId, true); + break; + case "DOWNLOAD_WAS_ABORTED": + case "DOWNLOAD_FINISHED_WITH_ERROR": + propsForm.retrievedPortData(portId, false); + break; + } + } + + const outputsForm = node.getOutputsForm(); + if (outputsForm) { + const portId = socketData["port_key"]; + const status = socketData["status"]; + switch (status) { case "UPLOAD_STARTED": - node.getPropForm().retrievingPortData( + outputsForm.setRetrievingStatus( portId, - osparc.form.renderer.PropForm.RETRIEVE_STATUS.uploading); + osparc.form.renderer.PropForm.RETRIEVE_STATUS.uploading + ); break; - case "DOWNLOAD_FINISHED_SUCCESSFULLY": case "UPLOAD_FINISHED_SUCCESSFULLY": - node.getPropForm().retrievedPortData(portId, true); + outputsForm.setRetrievingStatus( + portId, + osparc.form.renderer.PropForm.RETRIEVE_STATUS.succeed + ); break; - case "DOWNLOAD_WAS_ABORTED": - case "DOWNLOAD_FINISHED_WITH_ERRROR": case "UPLOAD_WAS_ABORTED": - case "UPLOAD_FINISHED_WITH_ERRROR": - node.getPropForm().retrievedPortData(portId, false); + case "UPLOAD_FINISHED_WITH_ERROR": + outputsForm.setRetrievingStatus( + portId, + osparc.form.renderer.PropForm.RETRIEVE_STATUS.failed + ); break; } } diff --git a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js index 494afba228e..137d2962f82 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -229,14 +229,13 @@ qx.Class.define("osparc.widget.NodeOutputs", { setRetrievingStatus: function(portId, status) { const ports = this.getPorts(); const portKeys = Object.keys(ports); - const idx = portKeys.findIndex(portId); + const idx = portKeys.indexOf(portId); if (idx === -1) { return; } - const icon = osparc.form.renderer.PropForm.getIconForStatus(status); // remove first if any - let children = this._getChildren(); + let children = this.__gridLayout.getChildren(); for (let i=0; i