From 3e13db9ee5b296b8afb0b6ee512140c7fc92cc30 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 16 Nov 2023 18:38:30 +0100 Subject: [PATCH 1/4] Ensure we're not allowing None as non-optional workflow input --- lib/galaxy/workflow/run_request.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/workflow/run_request.py b/lib/galaxy/workflow/run_request.py index e6ade460970..26b5411cbe4 100644 --- a/lib/galaxy/workflow/run_request.py +++ b/lib/galaxy/workflow/run_request.py @@ -125,7 +125,8 @@ def _normalize_inputs( # but asserting 'optional' is definitely a bool and not a String->Bool or something is a good # start to ensure tool state is being preserved and loaded in a type safe way. assert isinstance(optional, bool) - if not inputs_key and default_value is None and not optional: + has_input_value = inputs_key and inputs[inputs_key] is not None + if not has_input_value and default_value is None and not optional: message = f"Workflow cannot be run because an expected input step '{step.id}' ({step.label}) is not optional and no input." raise exceptions.MessageException(message) if inputs_key: From 26573dd7ed9d3640b51678e03f966e5f4aec0e7b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 17 Nov 2023 15:51:20 +0100 Subject: [PATCH 2/4] Prevent workflow submission with validation errors And disable submit button when request is being handled. --- .../src/components/Common/ButtonSpinner.vue | 5 + .../Workflow/Run/WorkflowRunFormSimple.vue | 122 ++++++++++-------- lib/galaxy/workflow/run_request.py | 2 +- 3 files changed, 76 insertions(+), 53 deletions(-) diff --git a/client/src/components/Common/ButtonSpinner.vue b/client/src/components/Common/ButtonSpinner.vue index e77f9ae66f3..b6e0c128c3c 100644 --- a/client/src/components/Common/ButtonSpinner.vue +++ b/client/src/components/Common/ButtonSpinner.vue @@ -14,6 +14,7 @@ variant="primary" class="d-flex flex-nowrap align-items-center text-nowrap" :title="tooltip" + :disabled="disabled" @click="$emit('onClick')"> {{ title }} @@ -43,6 +44,10 @@ export default { type: String, default: null, }, + disabled: { + type: Boolean, + default: false, + }, }, }; diff --git a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue index f5def99fec4..c73b8b58ff7 100644 --- a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue +++ b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue @@ -1,56 +1,58 @@