Make failure to save workflow dismissible

Fixes https://github.com/galaxyproject/galaxy/issues/12034.
We might also want to highlight the nodes in question or make them
activatable from the modal, and also prevent saving in the first place.
But even if we should do that we should catch errors like this.
This commit is contained in:
mvdbeek
2021-06-10 10:53:14 +02:00
parent f6f4c7e6b7
commit 91074370a3
2 changed files with 9 additions and 5 deletions
@@ -328,7 +328,11 @@ export default {
this.refactorActions = actions;
})
.catch((response) => {
this.onWorkflowError("Saving workflow failed, cannot apply requested changes...");
this.onWorkflowError("Saving workflow failed, cannot apply requested changes...", response, {
Ok: () => {
this.hideModal();
},
});
});
} else {
this.refactorActions = actions;
+4 -4
View File
@@ -1279,12 +1279,12 @@ class WorkflowContentsManager(UsesAnnotations):
uuid = step_dict.get("uuid", None)
if uuid and uuid != "None":
if uuid in discovered_uuids:
raise exceptions.DuplicatedIdentifierException("Duplicate step UUID in request.")
raise exceptions.DuplicatedIdentifierException(f"Duplicate step UUID '{uuid}' in request.")
discovered_uuids.add(uuid)
label = step_dict.get("label", None)
if label:
if label in discovered_labels:
raise exceptions.DuplicatedIdentifierException("Duplicated step label in request.")
raise exceptions.DuplicatedIdentifierException(f"Duplicated step label '{label}' in request.")
discovered_labels.add(label)
if 'workflow_outputs' in step_dict:
@@ -1297,13 +1297,13 @@ class WorkflowContentsManager(UsesAnnotations):
output_label = output_dict.get("label", None)
if output_label:
if label in discovered_output_labels:
raise exceptions.DuplicatedIdentifierException("Duplicated workflow output label in request.")
raise exceptions.DuplicatedIdentifierException(f"Duplicated workflow output label '{label}' in request.")
discovered_output_labels.add(label)
output_uuid = step_dict.get("output_uuid", None)
if output_uuid:
if output_uuid in discovered_output_uuids:
raise exceptions.DuplicatedIdentifierException("Duplicate workflow output UUID in request.")
raise exceptions.DuplicatedIdentifierException(f"Duplicate workflow output UUID '{output_uuid}' in request.")
discovered_output_uuids.add(uuid)
yield step_dict