From bbcee67e4cdceb07d9a441793982c37f9cfe2593 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 3 Nov 2021 11:55:01 +0000 Subject: [PATCH] Fixing issue #3199 - don't allow submitting automation creation modal without name, adding error message. --- .../AutomationPanel/CreateAutomationModal.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index f3273aa5ec..cf3dc8f314 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -8,10 +8,13 @@ let name let selectedTrigger + let nameTouched = false let triggerVal export let webhookModal $: instanceId = $database._id + $: nameError = + nameTouched && !name ? "Please specify a name for the automation." : null async function createAutomation() { await automationStore.actions.create({ @@ -51,13 +54,18 @@ confirmText="Save" size="M" onConfirm={createAutomation} - disabled={!selectedTrigger} + disabled={!selectedTrigger || !name} > Please name your automation, then select a trigger. Every automation must start with a trigger. - + (nameTouched = true)} + bind:error={nameError} + label="Name" + /> Triggers