From 8475e3174084fdf00d20f29fde06eae8b1272272 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 27 Oct 2022 18:50:32 +0200 Subject: [PATCH] UX flow improvements + fix collecting results for loops in frontend + fix Identity behavior in backend --- backend/src/worker_flow.rs | 8 +++ frontend/src/lib/components/ArgInput.svelte | 4 +- .../src/lib/components/CenteredPage.svelte | 2 +- frontend/src/lib/components/EditorBar.svelte | 4 ++ .../src/lib/components/FlowBuilder.svelte | 4 +- .../lib/components/FlowPreviewContent.svelte | 7 ++- .../lib/components/FlowStatusViewer.svelte | 30 +++++++--- frontend/src/lib/components/Path.svelte | 7 +++ .../src/lib/components/ScriptBuilder.svelte | 59 ++++++++++--------- .../src/lib/components/ScriptEditor.svelte | 51 ++++++++-------- .../src/lib/components/ScriptSchema.svelte | 19 +++--- frontend/src/lib/components/Tooltip.svelte | 6 +- .../common/breadcrumb/Breadcrumb.svelte | 2 +- .../lib/components/common/tabs/Tabs.svelte | 2 +- .../flows/content/FlowModuleComponent.svelte | 38 ++++-------- .../flows/content/FlowModuleHeader.svelte | 11 ++-- .../lib/components/flows/map/MapItem.svelte | 2 +- .../lib/components/flows/previousResults.ts | 4 +- .../components/sidebar/SidebarContent.svelte | 15 +---- frontend/src/routes/run/[...run].svelte | 2 +- 20 files changed, 147 insertions(+), 130 deletions(-) diff --git a/backend/src/worker_flow.rs b/backend/src/worker_flow.rs index fa8f547ec6..531651b928 100644 --- a/backend/src/worker_flow.rs +++ b/backend/src/worker_flow.rs @@ -1048,6 +1048,14 @@ async fn push_next_flow_job( ) .await? } + FlowModuleValue::Identity => match last_result.clone() { + Value::Object(m) => m, + v @ _ => { + let mut m = Map::new(); + m.insert("previous_result".to_string(), v); + m + } + }, _ => { /* embedded flow input is augmented with embedding flow input */ if let Some(value) = &flow_job.args { diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index f159ad8526..d28f9e1176 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -1,6 +1,4 @@ +
-

UI customisation

+

UI customisation

UI @@ -49,15 +50,13 @@
-

Arguments

- +

Arguments

+ + Argument names, being required or not, and default values are derived from the main + signature of step 2 and cannot be edited directly. Change the main signature to edit them. + +
+ diff --git a/frontend/src/lib/components/Tooltip.svelte b/frontend/src/lib/components/Tooltip.svelte index 29282ca0e4..8c9b98f60e 100644 --- a/frontend/src/lib/components/Tooltip.svelte +++ b/frontend/src/lib/components/Tooltip.svelte @@ -2,7 +2,6 @@ import { faInfoCircle } from '@fortawesome/free-solid-svg-icons' import Icon from 'svelte-awesome' import { createPopperActions } from 'svelte-popperjs' - import { fade } from 'svelte/transition' const [popperRef, popperContent] = createPopperActions({ placement: 'auto' }) @@ -17,7 +16,7 @@ }) const extraOpts = { modifiers: [ - betterPreventOverflow({ padding: 50 }), + betterPreventOverflow({ padding: 10 }), { name: 'offset', options: { offset: [8, 8] } }, { name: 'arrow', @@ -36,7 +35,7 @@ showTooltip = true } function close() { - timeout = setTimeout(() => (showTooltip = false), 200) + timeout = setTimeout(() => (showTooltip = false), 100) } @@ -49,7 +48,6 @@ {#if showTooltip}
dispatch('select', { index })} disabled={selectedIndex - 1 !== index ? disabled : false} > diff --git a/frontend/src/lib/components/common/tabs/Tabs.svelte b/frontend/src/lib/components/common/tabs/Tabs.svelte index cf42353826..66742de0cc 100644 --- a/frontend/src/lib/components/common/tabs/Tabs.svelte +++ b/frontend/src/lib/components/common/tabs/Tabs.svelte @@ -34,7 +34,7 @@
diff --git a/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte b/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte index 360c40f8f0..b535eb4d99 100644 --- a/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte +++ b/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte @@ -1,16 +1,9 @@ - - -
+
{#if !shouldPick}
-
+
diff --git a/frontend/src/lib/components/flows/previousResults.ts b/frontend/src/lib/components/flows/previousResults.ts index 14174d4672..d20b5ed806 100644 --- a/frontend/src/lib/components/flows/previousResults.ts +++ b/frontend/src/lib/components/flows/previousResults.ts @@ -96,11 +96,11 @@ function getFlowInput( if (parentModule.value.type === 'forloopflow') { return { - ...parentFlowInput, iter: { value: "Iteration's value", index: "Iteration's index" - } + }, + ...parentFlowInput, } } else { // Branches diff --git a/frontend/src/lib/components/sidebar/SidebarContent.svelte b/frontend/src/lib/components/sidebar/SidebarContent.svelte index 5c0bd5a08c..56db906bac 100644 --- a/frontend/src/lib/components/sidebar/SidebarContent.svelte +++ b/frontend/src/lib/components/sidebar/SidebarContent.svelte @@ -52,7 +52,7 @@ export let isCollapsed: boolean = false -
+
- - diff --git a/frontend/src/routes/run/[...run].svelte b/frontend/src/routes/run/[...run].svelte index 3bf6af1130..57396e3103 100644 --- a/frontend/src/routes/run/[...run].svelte +++ b/frontend/src/routes/run/[...run].svelte @@ -168,7 +168,7 @@ {/if} -
+

{#if job}