fix inner branches in the flow UX

This commit is contained in:
Ruben Fiszel
2022-11-04 16:31:30 +01:00
parent fc3aaf6d5f
commit 2750c586ed
3 changed files with 21 additions and 14 deletions
@@ -76,20 +76,26 @@
{#each branches as branch, i}
{#if flowModule.value.type === 'branchone'}
<div class="flex flex-row gap-x-2 items-center">
<Button on:click={() => ($selectedId = branch.id)}>
Set branch {i} '{branch.summary && branch.summary != ''
? branch.summary
: 'No summary'}' predicate</Button
<div class="max-w-sm w-full text-sm text-gray-600">
{branch.summary && branch.summary != '' ? branch.summary : 'No summary'}</div
>
<div>
<Button size="sm" on:click={() => ($selectedId = branch.id)}>
Set branch {i} predicate</Button
>
</div>
<HighlightCode language="deno" code={branch.expr} />
</div>
{:else}
<div>
<Badge large={true} color="blue">
branch {i}: {branch.summary && branch.summary != ''
? branch.summary
: 'No summary'}
</Badge>
<div class="flex flex-row gap-x-2">
<div class="max-w-sm w-full text-sm text-gray-600">
{branch.summary && branch.summary != '' ? branch.summary : 'No summary'}
</div>
<div>
<Button size="sm" on:click={() => ($selectedId = branch.id)}>
Set branch {i} summary</Button
>
</div>
</div>
{/if}
{/each}
@@ -9,5 +9,6 @@
on:delete={() => {
$flowStore.value.failure_module = undefined
}}
previousModule={undefined}
/>
{/if}
@@ -112,7 +112,7 @@
<svelte:self
bind:flowModule={submodule}
bind:parentModule={flowModule}
previousModuleId={flowModule.value.modules[index - 1]?.id}
previousModule={flowModule.value.modules[index - 1]}
/>
{/each}
{:else if flowModule.value.type === 'branchone'}
@@ -123,7 +123,7 @@
<svelte:self
bind:flowModule={submodule}
bind:parentModule={flowModule}
previousModuleId={flowModule.value.default[index - 1]?.id}
previousModule={flowModule.value.default[index - 1]}
/>
{/each}
{/if}
@@ -135,7 +135,7 @@
<svelte:self
bind:flowModule={submodule}
bind:parentModule={flowModule}
previousModuleId={flowModule.value.branches[branchIndex].modules[index - 1]?.id}
previousModule={flowModule.value.branches[branchIndex].modules[index - 1]}
/>
{/each}
{/if}
@@ -149,7 +149,7 @@
<svelte:self
bind:flowModule={submodule}
bind:parentModule={flowModule}
previousModuleId={flowModule.value.branches[branchIndex].modules[index - 1]?.id}
previousModule={flowModule.value.branches[branchIndex].modules[index - 1]}
/>
{/each}
{/if}