From efe3973c29e38a4637f60364fac91c7e5848d7ea Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 28 Dec 2022 12:52:21 +0100 Subject: [PATCH] fix test just this step freeze svelte bc of transition:fade --- .../flows/content/FlowModuleWrapper.svelte | 246 +++++++++--------- 1 file changed, 122 insertions(+), 124 deletions(-) diff --git a/frontend/src/lib/components/flows/content/FlowModuleWrapper.svelte b/frontend/src/lib/components/flows/content/FlowModuleWrapper.svelte index 3ccc02338a..713ae451c8 100644 --- a/frontend/src/lib/components/flows/content/FlowModuleWrapper.svelte +++ b/frontend/src/lib/components/flows/content/FlowModuleWrapper.svelte @@ -30,155 +30,153 @@ export let previousModule: FlowModule | undefined = undefined -{#key $selectedId} - {#if flowModule.id === $selectedId} - {#if flowModule.value.type === 'forloopflow'} - - {:else if flowModule.value.type === 'branchone'} - - {:else if flowModule.value.type === 'branchall'} - - {:else if flowModule.value.type === 'identity'} - {#if $selectedId == 'failure'} - - If defined, the error handler will take as input, the result of the step that errored - (which has its error in the 'error field'). -
-
- Steps are retried until they succeed, or until the maximum number of retries defined for that - spec is reached, at which point the error handler is called. -
- {/if} +{#if flowModule.id === $selectedId} + {#if flowModule.value.type === 'forloopflow'} + + {:else if flowModule.value.type === 'branchone'} + + {:else if flowModule.value.type === 'branchall'} + + {:else if flowModule.value.type === 'identity'} + {#if $selectedId == 'failure'} + + If defined, the error handler will take as input, the result of the step that errored (which + has its error in the 'error field'). +
+
+ Steps are retried until they succeed, or until the maximum number of retries defined for that + spec is reached, at which point the error handler is called. +
+ {/if} - {#if flowModule.value.flow} - { - const { path, summary } = detail - const [module, state] = await pickFlow(path, summary, flowModule.id) + {#if flowModule.value.flow} + { + const { path, summary } = detail + const [module, state] = await pickFlow(path, summary, flowModule.id) - flowModule = module - $flowStateStore[module.id] = state - }} - /> - {:else} - { - const { path, summary, kind, hash } = detail - const [module, state] = await pickScript(path, summary, flowModule.id, hash) + flowModule = module + $flowStateStore[module.id] = state + }} + /> + {:else} + { + const { path, summary, kind, hash } = detail + const [module, state] = await pickScript(path, summary, flowModule.id, hash) - if (kind == Script.kind.APPROVAL) { - module.suspend = { required_events: 1, timeout: 1800 } + if (kind == Script.kind.APPROVAL) { + module.suspend = { required_events: 1, timeout: 1800 } + } + + if (kind == Script.kind.TRIGGER) { + if (!$schedule.cron) { + $schedule.cron = '0 */15 * * *' } + $schedule.enabled = true - if (kind == Script.kind.TRIGGER) { - if (!$schedule.cron) { - $schedule.cron = '0 */15 * * *' - } - $schedule.enabled = true - - module.stop_after_if = { - expr: 'result == undefined || Array.isArray(result) && result.length == 0', - skip_if_stopped: true - } + module.stop_after_if = { + expr: 'result == undefined || Array.isArray(result) && result.length == 0', + skip_if_stopped: true } + } - flowModule = module - $flowStateStore[module.id] = state - }} - on:new={async ({ detail }) => { - const { language, kind, subkind } = detail + flowModule = module + $flowStateStore[module.id] = state + }} + on:new={async ({ detail }) => { + const { language, kind, subkind } = detail - const [module, state] = await createInlineScriptModule( - language, - kind, - subkind, - flowModule.id - ) + const [module, state] = await createInlineScriptModule( + language, + kind, + subkind, + flowModule.id + ) - if (kind == Script.kind.TRIGGER) { - if (!$schedule.cron) { - $schedule.cron = '0 */15 * * *' - } - $schedule.enabled = true - - module.stop_after_if = { - expr: 'result == undefined || Array.isArray(result) && result.length == 0', - skip_if_stopped: true - } + if (kind == Script.kind.TRIGGER) { + if (!$schedule.cron) { + $schedule.cron = '0 */15 * * *' } + $schedule.enabled = true - if (kind == Script.kind.APPROVAL) { - module.suspend = { required_events: 1, timeout: 1800 } + module.stop_after_if = { + expr: 'result == undefined || Array.isArray(result) && result.length == 0', + skip_if_stopped: true } + } - flowModule = module - $flowStateStore[module.id] = state - }} - failureModule={$selectedId === 'failure'} - /> - {/if} - {:else if flowModule.value.type === 'rawscript' || flowModule.value.type === 'script' || flowModule.value.type === 'flow'} - {/if} - {:else if flowModule.value.type === 'forloopflow'} - {#each flowModule.value.modules as submodule, index (index)} + {:else if flowModule.value.type === 'rawscript' || flowModule.value.type === 'script' || flowModule.value.type === 'flow'} + + {/if} +{:else if flowModule.value.type === 'forloopflow'} + {#each flowModule.value.modules as submodule, index (index)} + + {/each} +{:else if flowModule.value.type === 'branchone'} + {#if $selectedId === `${flowModule?.id}-branch-default`} +
+

Default branch

+ Nothing to configure, this is the default branch if none of the predicates are met. +
+ {:else} + {#each flowModule.value.default as submodule, index} {/each} - {:else if flowModule.value.type === 'branchone'} - {#if $selectedId === `${flowModule?.id}-branch-default`} -
-

Default branch

- Nothing to configure, this is the default branch if none of the predicates are met. -
+ {/if} + {#each flowModule.value.branches as branch, branchIndex (branchIndex)} + {#if $selectedId === `${flowModule?.id}-branch-${branchIndex}`} + {:else} - {#each flowModule.value.default as submodule, index} + {#each branch.modules as submodule, index} {/each} {/if} - {#each flowModule.value.branches as branch, branchIndex (branchIndex)} - {#if $selectedId === `${flowModule?.id}-branch-${branchIndex}`} - - {:else} - {#each branch.modules as submodule, index} - - {/each} - {/if} - {/each} - {:else if flowModule.value.type === 'branchall'} - {#each flowModule.value.branches as branch, branchIndex (branchIndex)} - {#if $selectedId === `${flowModule?.id}-branch-${branchIndex}`} - - {:else} - {#each branch.modules as submodule, index} - - {/each} - {/if} - {/each} - {/if} -{/key} + {/each} +{:else if flowModule.value.type === 'branchall'} + {#each flowModule.value.branches as branch, branchIndex (branchIndex)} + {#if $selectedId === `${flowModule?.id}-branch-${branchIndex}`} + + {:else} + {#each branch.modules as submodule, index} + + {/each} + {/if} + {/each} +{/if}