mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 16:09:39 +00:00
fix(frontend): add support for step id change for forloops and branch… (#4395)
* fix(frontend): add support for step id change for forloops and branchone + add initial value for DebounchedInput * fix(frontend): fix initial value of DebouncedInput
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
export let placeholder: string = 'Search...'
|
||||
@@ -11,6 +12,7 @@
|
||||
export { parentClass as class }
|
||||
|
||||
let timer: NodeJS.Timeout
|
||||
let inputElement: HTMLInputElement | null = null
|
||||
|
||||
function debounce(event: KeyboardEvent): void {
|
||||
clearTimeout(timer)
|
||||
@@ -20,9 +22,16 @@
|
||||
value = target.value
|
||||
}, debounceDelay)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if (inputElement && value !== undefined) {
|
||||
inputElement.value = value
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<input
|
||||
bind:this={inputElement}
|
||||
{placeholder}
|
||||
on:pointerdown|stopPropagation
|
||||
on:keyup={debounce}
|
||||
|
||||
@@ -348,6 +348,14 @@
|
||||
}
|
||||
})
|
||||
)
|
||||
} else if (mod?.value?.type === 'forloopflow') {
|
||||
if (mod.value.iterator.type === 'javascript') {
|
||||
mod.value.iterator.expr = replaceId(mod.value.iterator.expr, id, newId)
|
||||
}
|
||||
} else if (mod?.value?.type === 'branchone') {
|
||||
mod.value.branches.forEach((branch) => {
|
||||
branch.expr = replaceId(branch.expr, id, newId)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user