Skip to content

Commit

Permalink
[skip ci] upload icons working
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Oct 15, 2024
1 parent 0d0a6ce commit 45b07da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,27 @@ 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<children.length; i++) {
let child = children[i];
const layoutProps = child.getLayoutProperties();
if (
layoutProps.row === idx &&
layoutProps.column === this.self().POS.RETRIEVE_STATUS
) {
this._remove(child);
this.__gridLayout.remove(child);
break;
}
}
this._addAt(icon, idx, {
idx,
const icon = osparc.form.renderer.PropForm.getIconForStatus(status);
this.__gridLayout.add(icon, {
row: idx,
column: this.self().POS.RETRIEVE_STATUS
});
}
Expand Down

0 comments on commit 45b07da

Please sign in to comment.