From 5f2b4f3ef9bbb8fad0f8aa3996f3565d98d383e3 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 17 Oct 2023 11:51:23 +0100 Subject: [PATCH] initial styling and input updates for naming --- .../FlowChart/FlowItem.svelte | 14 +- .../FlowChart/FlowItemHeader.svelte | 130 ++++++++++++++++-- 2 files changed, 133 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 6c964c84a9..0517fe1034 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -104,13 +104,19 @@ } -
{}}> +
{}} + on:click={() => {}} +> {#if loopBlock}
{ showLooping = !showLooping }} + on:keydown={() => {}} class="splitHeader" >
@@ -129,7 +135,11 @@
-
{}}> +
{}} + on:click={() => {}} + >
diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte index c09474a370..0bbd2d2318 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte @@ -1,6 +1,6 @@ -
-
dispatch("toggle")} class="splitHeader"> +
+
{#if externalActions[block.stepId]} {#if isTrigger} Trigger - When this happens: {:else} Step {idx} - Do this: {/if} - {block?.name?.toUpperCase() || ""} + { + automationNameError = getAutomationNameError(e.target.value) + automationName = e.target.value + if (!automationNameError) { + automationNameError = false // Reset the error when input is valid + } + }} + value={automationName} + on:click={startTyping} + on:blur={() => { + typing = false + if (automationNameError) { + automationName = block?.name + automationNameError = null + } + }} + />
@@ -89,18 +130,46 @@
{/if}
{ onSelect(block) }} > - + {#if !showTestStatus} + + + + + + + {/if} + dispatch("toggle")} + hoverable + name={open ? "ChevronUp" : "ChevronDown"} + />
+ {#if automationNameError} +
+ +
+ +
+
+
+ {/if}