fix minor UX bugs

This commit is contained in:
Ruben Fiszel
2023-02-13 13:17:20 +01:00
parent 9b3413775b
commit d97a3fb400
6 changed files with 22 additions and 15 deletions

View File

@@ -165,7 +165,7 @@
argName,
previousModuleId,
staticTemplate
? `\`${arg?.value.toString().replaceAll('`', '\\`') ?? ''}\``
? `\`${arg?.value?.toString().replaceAll('`', '\\`') ?? ''}\``
: arg.value
? JSON.stringify(arg?.value, null, 4)
: ''

View File

@@ -48,6 +48,7 @@
export let topButton = false
export let loading = false
export let noVariablePicker = false
export let viewCliRun = false
export let args: Record<string, any> = decodeArgs($page.url.searchParams.get('args') ?? undefined)
@@ -208,19 +209,21 @@
</Button>
{/if}
<div class="my-10" />
<Button
color="light"
size="sm"
endIcon={{ icon: viewCliOptions ? faChevronUp : faChevronDown }}
on:click={() => (viewCliOptions = !viewCliOptions)}
>
Run it from the CLI
</Button>
{#if viewCliOptions}
<div transition:slide class="mt-2 px-4 pt-2">
<InlineCodeCopy content={cliCommand} />
<CliHelpBox />
</div>
{#if viewCliRun}
<div class="my-10" />
<Button
color="light"
size="sm"
endIcon={{ icon: viewCliOptions ? faChevronUp : faChevronDown }}
on:click={() => (viewCliOptions = !viewCliOptions)}
>
Run it from the CLI
</Button>
{#if viewCliOptions}
<div transition:slide class="mt-2 px-4 pt-2">
<InlineCodeCopy content={cliCommand} />
<CliHelpBox />
</div>
{/if}
{/if}
</div>

View File

@@ -292,6 +292,7 @@
runnable={flow}
runAction={runFlow}
bind:args
viewCliRun
/>
</div>
{#if !emptyString(flow.description)}

View File

@@ -139,6 +139,7 @@
detailed={false}
runnable={flow}
runAction={runFlow}
viewCliRun
/>
{:else}
<Skeleton layout={[2, [3], 1, [2], 4, [4], 3, [8]]} />

View File

@@ -390,6 +390,7 @@
runnable={script}
runAction={runScript}
bind:args
viewCliRun
/>
</div>
{#if !emptyString(script.description)}

View File

@@ -192,6 +192,7 @@
bind:this={runForm}
runnable={script}
runAction={runScript}
viewCliRun
/>
{/if}
{:else}