fix: fix use input from input library + make selected subgrid clearer

This commit is contained in:
Ruben Fiszel
2023-06-12 17:57:46 +02:00
parent edf62764e5
commit 1e3bc84787
6 changed files with 36 additions and 43 deletions
@@ -56,6 +56,10 @@
$runFormStore = undefined
}
export function setArgs(nargs: Record<string, any>) {
args = nargs
}
export function run() {
runAction(scheduledForStr, args, invisible_to_owner)
}
@@ -98,14 +98,14 @@
class={twMerge(
`${
$mode == 'dnd' ? 'absolute' : 'fixed'
} top-0 bottom-0 left-0 right-0 transition-all duration-50 overflow-hidden`,
} top-0 bottom-0 left-0 right-0 transition-all duration-50`,
open ? 'z-[1100] bg-black bg-opacity-60' : 'hidden'
)}
>
<div
style={css?.popup?.style}
class={twMerge(
'm-24 h-[80%] bg-white overflow-y-auto rounded-lg relative',
'm-24 max-h-[80%] bg-white overflow-y-auto rounded-lg relative',
css?.popup?.class
)}
use:clickOutside
@@ -78,7 +78,9 @@
style="{containerHeight ? `height: ${containerHeight}px;` : ''} {style ?? ''}"
>
{#if $mode !== 'preview'}
<div class={highlight ? 'border-gray-400 border border-dashed min-h-full' : ''}>
<div
class={highlight ? 'border-gray-600 animate-border border-dashed border-2 min-h-full' : ''}
>
<Grid
allIdsInPath={$allIdsInPath}
items={$app.subgrids?.[subGridId] ?? []}
@@ -6,7 +6,7 @@
export let id: string
export let type: string
const { app, connectingInput, selectedComponent, focusedGrid } =
const { app, connectingInput, selectedComponent } =
getContext<AppViewerContext>('AppViewerContext')
const { manuallyOpened } = getContext<ContextPanelContext>('ContextPanel')
@@ -14,9 +14,6 @@
function selectComponent(e: PointerEvent, id: string) {
if (!$connectingInput.opened) {
selectId(e, id, selectedComponent, $app)
if ($focusedGrid?.parentComponentId != id) {
$focusedGrid = undefined
}
}
}
@@ -88,8 +88,6 @@
duration: 200,
easing: cubicOut
})
let reloadArgs = 0
</script>
<svelte:window on:keydown={onKeyDown} />
@@ -186,20 +184,18 @@
</div>
</Button>
</div>
{#key reloadArgs}
<RunForm
{loading}
autofocus
bind:this={runForm}
bind:isValid
detailed={false}
runnable={flow}
runAction={runFlow}
viewCliRun
isFlow
bind:args
/>
{/key}
<RunForm
{loading}
autofocus
bind:this={runForm}
bind:isValid
detailed={false}
runnable={flow}
runAction={runFlow}
viewCliRun
isFlow
bind:args
/>
{:else}
<Skeleton layout={[2, [3], 1, [2], 4, [4], 3, [8]]} />
{/if}
@@ -212,8 +208,7 @@
{isValid}
{args}
on:selected_args={(e) => {
args = JSON.parse(JSON.stringify(e.detail))
reloadArgs += 1
runForm?.setArgs(JSON.parse(JSON.stringify(e.detail)))
}}
/>
{/if}
@@ -112,8 +112,6 @@
duration: 200,
easing: cubicOut
})
let reloadArgs = 0
</script>
<svelte:window on:keydown={onKeyDown} />
@@ -247,20 +245,18 @@
</div>
</Button>
</div>
{#key reloadArgs}
<RunForm
{loading}
autofocus
detailed={false}
bind:isValid
bind:this={runForm}
runnable={script}
runAction={runScript}
viewCliRun
isFlow={false}
bind:args
/>
{/key}
<RunForm
{loading}
autofocus
detailed={false}
bind:isValid
bind:this={runForm}
runnable={script}
runAction={runScript}
viewCliRun
isFlow={false}
bind:args
/>
{/if}
{:else}
<Skeleton layout={[2, [3], 1, [2], 4, [4], 3, [8]]} />
@@ -276,8 +272,7 @@
{isValid}
{args}
on:selected_args={(e) => {
args = JSON.parse(JSON.stringify(e.detail))
reloadArgs += 1
runForm?.setArgs(JSON.parse(JSON.stringify(e.detail)))
}}
/>
{/if}