From eebc6ddee6e6be237e648bed64fc4ebf427052be Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 16 Mar 2023 01:18:11 +0100 Subject: [PATCH] fix minor flow UX --- frontend/src/lib/components/ArgInput.svelte | 4 +++- frontend/src/lib/components/ModulePreview.svelte | 1 + frontend/src/lib/components/Path.svelte | 4 ++++ frontend/src/lib/components/propertyPicker/PropPicker.svelte | 5 ++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index 5001abf150..84dbc8d229 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -152,6 +152,8 @@ value = enum_?.[0] } else if (inputCat == 'boolean') { value = false + } else if (inputCat == 'list') { + value = [] } } } @@ -288,7 +290,7 @@ on:click={() => { value = value.filter((el) => el != v) if (value.length == 0) { - value = undefined + value = [] } }} > diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index ea60ad3bd0..3e60622742 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -60,6 +60,7 @@ if (testJob && !testJob.canceled && testJob.type == 'CompletedJob' && `result` in testJob) { if ($flowStateStore[mod.id]?.previewResult) { $flowStateStore[mod.id].previewResult = testJob.result + $flowStateStore = $flowStateStore } } } diff --git a/frontend/src/lib/components/Path.svelte b/frontend/src/lib/components/Path.svelte index 8903921018..eb3b2673b8 100644 --- a/frontend/src/lib/components/Path.svelte +++ b/frontend/src/lib/components/Path.svelte @@ -200,6 +200,10 @@ } function initPath() { + if (path != undefined && path != '') { + meta = pathToMeta(path) + return + } if (initialPath == undefined || initialPath == '') { reset() } else { diff --git a/frontend/src/lib/components/propertyPicker/PropPicker.svelte b/frontend/src/lib/components/propertyPicker/PropPicker.svelte index 5d6ad93936..75c7ececa4 100644 --- a/frontend/src/lib/components/propertyPicker/PropPicker.svelte +++ b/frontend/src/lib/components/propertyPicker/PropPicker.svelte @@ -93,7 +93,10 @@ pureViewer={!$propPickerConfig} json={flowInputsFiltered} on:select={(e) => { - dispatch('select', `flow_input.${e.detail}`) + dispatch( + 'select', + e.detail?.startsWith('[') ? `flow_input${e.detail}` : `flow_input.${e.detail}` + ) }} />