From 779a78856727dc682f17d3ec92980c8cdd9b11c0 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Sep 2024 20:27:45 +0200 Subject: [PATCH] nit accept underscore for flow editor --- frontend/src/lib/components/IdEditorInput.svelte | 3 ++- .../src/lib/components/flows/map/FlowModuleSchemaItem.svelte | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/IdEditorInput.svelte b/frontend/src/lib/components/IdEditorInput.svelte index 1db5bf686f574..dae667c867c1b 100644 --- a/frontend/src/lib/components/IdEditorInput.svelte +++ b/frontend/src/lib/components/IdEditorInput.svelte @@ -11,10 +11,11 @@ export let value = initialId export let buttonText = '' export let btnClasses = '!p-1 !w-[34px] !ml-1' + export let acceptUnderScores = false let error = '' const dispatch = createEventDispatcher() - const regex = /^[a-zA-Z][a-zA-Z0-9]*$/ + const regex = acceptUnderScores ? /^[a-zA-Z][a-zA-Z0-9_]*$/ : /^[a-zA-Z][a-zA-Z0-9]*$/ $: validateId(value, reservedIds) diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index c5e3f62c65568..f369ec2624647 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -77,6 +77,7 @@ btnClasses="!ml-1" label="" initialId={id} + acceptUnderScores reservedIds={dfs(flowStore?.value.modules ?? [], (x) => x.id)} bind:value={newId} on:save={(e) => {