From 91074370a3e84be192f31b49fad2bf26ae2913e6 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 10 Jun 2021 10:53:10 +0200 Subject: [PATCH] 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. --- client/src/components/Workflow/Editor/Index.vue | 6 +++++- lib/galaxy/managers/workflows.py | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index 2789c869b7c..1a905bea862 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -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; diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index caed4b979c5..14b68b2f743 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -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