From 154c2a91ca6a4d60b02a44dda5fa23974594018b Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 22 Jul 2022 02:22:09 +0200 Subject: [PATCH] feat: more visual cues about trigger scripts --- frontend/src/lib/components/ModuleStep.svelte | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/frontend/src/lib/components/ModuleStep.svelte b/frontend/src/lib/components/ModuleStep.svelte index 4bdbf6e7c0..23de72094f 100644 --- a/frontend/src/lib/components/ModuleStep.svelte +++ b/frontend/src/lib/components/ModuleStep.svelte @@ -17,6 +17,7 @@ type FlowMode } from './flows/flowStore' import SchemaForm from './SchemaForm.svelte' + import Tooltip from './Tooltip.svelte' export let open: number export let mode: FlowMode @@ -41,6 +42,17 @@

Step {i + 1}

+ {#if i == 0 && mode == 'pull'} +

+ Trigger Script When a flow is 'Pull', the first step is a trigger script. Trigger scripts are + scripts that must return a list which are the new items to be treated one by one by + the rest of the flow, usually the list of new items since last time the flow was + run. One can retrieve the item in the next step using `previous_result._value`. To + easily compute the diff, windmill provides some helpers under the form of + `getInternalState` and `setInternalState`. +

{/if}

{#if mod.value.path} {mod.value.path} @@ -117,3 +129,14 @@ {/if}

+{#if i == 0 && mode == 'pull'} +
  • +
    + Starting from here, the flow for loop over items from last step result  This flow being in 'Pull' mode, the rest of the flow will for loop over the list of items + returned by the trigger script right above. Retrieve the item value using + `previous_result._value` +
    +
  • +{/if}