mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
add clearbable for script picker (#6071)
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
allowRefresh?: boolean
|
||||
allowEdit?: boolean
|
||||
allowView?: boolean
|
||||
clearable?: boolean
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -40,7 +41,8 @@
|
||||
disabled = false,
|
||||
allowRefresh = false,
|
||||
allowEdit = true,
|
||||
allowView = true
|
||||
allowView = true,
|
||||
clearable = false
|
||||
}: Props = $props()
|
||||
|
||||
let items: { value: string; label: string }[] = $state([])
|
||||
@@ -128,6 +130,7 @@
|
||||
}
|
||||
class="grow shrink max-w-full"
|
||||
{items}
|
||||
{clearable}
|
||||
placeholder="Pick {itemKind === 'app' ? 'an' : 'a'} {itemKind}"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
@@ -538,6 +538,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
|
||||
{#if emptyString(script_path)}
|
||||
|
||||
@@ -349,6 +349,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
@@ -360,6 +360,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
@@ -526,6 +526,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
|
||||
{#if emptyString(script_path) && is_flow === false}
|
||||
|
||||
@@ -875,6 +875,7 @@
|
||||
on:select={(e) => {
|
||||
loadScript(e.detail.path)
|
||||
}}
|
||||
clearable
|
||||
/>
|
||||
{:else}
|
||||
<Alert type="info" title="Runnable path cannot be edited" collapsible>
|
||||
|
||||
@@ -343,6 +343,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
@@ -412,6 +412,7 @@
|
||||
bind:scriptPath={script_path}
|
||||
allowRefresh={can_write}
|
||||
allowEdit={!$userStore?.operator}
|
||||
clearable
|
||||
/>
|
||||
{#if emptyString(script_path)}
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user