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/Form/FormDisplay.vue b/client/src/components/Form/FormDisplay.vue index 9d7f86e684d..db41b879e76 100644 --- a/client/src/components/Form/FormDisplay.vue +++ b/client/src/components/Form/FormDisplay.vue @@ -79,6 +79,10 @@ export default { type: Boolean, default: false, }, + allowEmptyValueOnRequiredInput: { + type: Boolean, + default: false, + }, }, data() { return { @@ -89,7 +93,7 @@ export default { }, computed: { validation() { - return validateInputs(this.formIndex, this.formData); + return validateInputs(this.formIndex, this.formData, this.allowEmptyValueOnRequiredInput); }, }, watch: { diff --git a/client/src/components/Form/utilities.js b/client/src/components/Form/utilities.js index aff9fa2ba0b..58b18d79d91 100644 --- a/client/src/components/Form/utilities.js +++ b/client/src/components/Form/utilities.js @@ -104,7 +104,7 @@ export function matchInputs(index, response) { * @param{dict} index - Index of input elements * @param{dict} values - Dictionary of parameter values */ -export function validateInputs(index, values) { +export function validateInputs(index, values, allowEmptyValueOnRequiredInput = false) { let batchN = -1; let batchSrc = null; for (const inputId in values) { @@ -113,8 +113,10 @@ export function validateInputs(index, values) { if (!inputDef || inputDef.step_linked) { continue; } - if (inputValue == null && !inputDef.optional && inputDef.type != "hidden") { - return [inputId, "Please provide a value for this option."]; + if (!inputDef.optional && inputDef.type != "hidden") { + if (inputValue == null || (allowEmptyValueOnRequiredInput && inputValue === "")) { + return [inputId, "Please provide a value for this option."]; + } } if (inputDef.wp_linked && inputDef.text_value == inputValue) { return [inputId, "Please provide a value for this workflow parameter."]; diff --git a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue index f5def99fec4..b0a166144c4 100644 --- a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue +++ b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue @@ -1,56 +1,62 @@