flow ui nits

This commit is contained in:
Ruben Fiszel
2022-10-28 16:11:03 +02:00
parent e84c9921ca
commit 687fc102d5
4 changed files with 12 additions and 5 deletions
@@ -22,7 +22,7 @@
<span class="text-sm w-full">
<div class="flex items-center space-x-2">
{#if shouldPick}
<span class="font-bold text-xs">Select a script</span>
<span class="font-bold text-xs">Select a step kind</span>
{:else if flowModule?.value.type === 'rawscript'}
<Badge color={languageColors[flowModule?.value.language] ?? 'gray'} capitalize>
{flowModule?.value.language}
@@ -78,7 +78,7 @@
</div>
{#if !shouldDisableTriggerScripts}
<div class="text-sm font-bold">
<div class="text-sm font-bold pt-8">
Trigger script
<Tooltip>
Used as a first step most commonly with an intenal state and a schedule to watch for changes
@@ -99,7 +99,7 @@
</div>
{/if}
{#if !failureModule}
<div class="text-sm font-bold">
<div class="text-sm font-bold pt-8">
Approval step
<Tooltip>
Inlined common scripts can be turned into approval step by changing their suspend settings.
@@ -123,7 +123,7 @@
/>
</div>
<div class="text-sm font-bold">Flow primitive</div>
<div class="text-sm font-bold pt-8">Flow primitive</div>
<div class="grid sm:grid-col-1 md:grid-col-2 lg:grid-cols-3 gap-4">
<FlowScriptPicker
@@ -17,6 +17,7 @@
} from '$lib/components/flows/flowStateUtils'
import FlowInputs from './FlowInputs.svelte'
import { flowStateStore, type FlowModuleState } from '../flowState'
import Tooltip from '$lib/components/Tooltip.svelte'
const { selectedId } = getContext<FlowEditorContext>('FlowEditorContext')
@@ -37,6 +38,12 @@
{:else if flowModule.value.type === 'branchall'}
<FlowBranchesWrapper {previousModuleId} bind:flowModule {parentModule} />
{:else if flowModule.value.type === 'identity'}
<h1 class="p-4"
>Select a step kind <Tooltip
>Until being defined, this step acts as an identify function, returning as result its input
and assigning it a key 'previous_result' if the input is not a json object</Tooltip
></h1
>
<FlowInputs
shouldDisableTriggerScripts={parentModule !== undefined || previousModuleId !== undefined}
on:loop={async () => {
@@ -95,7 +95,7 @@
{...itemProps}
label={mod.summary ||
(`path` in mod.value ? mod.value.path : undefined) ||
(mod.value.type === 'rawscript' ? `Inline ${mod.value.language}` : 'Select a script')}
(mod.value.type === 'rawscript' ? `Inline ${mod.value.language}` : 'To be defined')}
>
<div slot="icon">
<span>{index + 1}</span>