diff --git a/frontend/src/lib/components/SchemaEditor.svelte b/frontend/src/lib/components/SchemaEditor.svelte index 15a3dd2ae6..6f0b989b58 100644 --- a/frontend/src/lib/components/SchemaEditor.svelte +++ b/frontend/src/lib/components/SchemaEditor.svelte @@ -15,6 +15,7 @@ import Portal from 'svelte-portal' export let isFlowInput = false + export let blacklistedNames: string[] = [] const dispatch = createEventDispatcher() @@ -374,5 +375,6 @@ on:save={(e) => handleAddOrEditArgument(e.detail)} bind:editing bind:oldArgName + {blacklistedNames} /> diff --git a/frontend/src/lib/components/SchemaModal.svelte b/frontend/src/lib/components/SchemaModal.svelte index 4ea92d734a..3be1c1d53a 100644 --- a/frontend/src/lib/components/SchemaModal.svelte +++ b/frontend/src/lib/components/SchemaModal.svelte @@ -73,6 +73,7 @@ export let editing = false export let oldArgName: string | undefined = undefined export let isFlowInput = false + export let blacklistedNames: string[] = [] const dispatch = createEventDispatcher() let drawer: Drawer @@ -80,12 +81,21 @@ let property: ModalSchemaProperty = DEFAULT_PROPERTY function handleKeyUp(event: KeyboardEvent) { + validateName(property.name) const key = event.key if (key === 'Enter') { dispatch('save', property) } } + function validateName(name: string) { + if (blacklistedNames.includes(name.toLowerCase())) { + error = 'This name is not allowed.' + } else { + error = '' + } + } + export function openDrawer(nproperty: ModalSchemaProperty): void { drawer.openDrawer() property = nproperty diff --git a/frontend/src/lib/components/flows/content/FlowInput.svelte b/frontend/src/lib/components/flows/content/FlowInput.svelte index 1cf00bb5cf..839e91af10 100644 --- a/frontend/src/lib/components/flows/content/FlowInput.svelte +++ b/frontend/src/lib/components/flows/content/FlowInput.svelte @@ -87,6 +87,7 @@ on:change={() => { $flowStore = $flowStore }} + blacklistedNames={['iter']} />