diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte index 0c7ac3d27d..3c9e1a13b1 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte @@ -13,13 +13,13 @@ export let idx export let addLooping export let deleteStep - + export let enableNaming = true let validRegex = /^[A-Za-z0-9_\s]+$/ let typing = false const dispatch = createEventDispatcher() - $: stepNames = $selectedAutomation.definition.stepNames + $: stepNames = $selectedAutomation?.definition.stepNames $: automationName = stepNames?.[block.id] || block?.name || "" $: automationNameError = getAutomationNameError(automationName) $: status = updateStatus(testResult, isTrigger) @@ -32,7 +32,7 @@ )?.[0] } } - $: loopBlock = $selectedAutomation.definition.steps.find( + $: loopBlock = $selectedAutomation?.definition.steps.find( x => x.blockToLoop === block?.id ) @@ -126,24 +126,33 @@
Step {idx} {/if} - { - automationName = e.target.value.trim() - }} - on:click={startTyping} - on:blur={async () => { - typing = false - if (automationNameError) { - automationName = stepNames[block.id] || block?.name - } else { - await saveName() - } - }} - /> + + {#if enableNaming} + { + automationName = e.target.value.trim() + }} + on:click={startTyping} + on:blur={async () => { + typing = false + if (automationNameError) { + automationName = stepNames[block.id] || block?.name + } else { + await saveName() + } + }} + /> + {:else} +