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) => {