From c12a8f03e9ee95cec37470ec8a778f61edb88d4e Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 5 Jul 2024 15:33:08 +0100 Subject: [PATCH] Removed placeholder from row data picker, fix for stuck row selector in testmodal and old field test config fixes --- .../SetupPanel/AutomationBlockSetup.svelte | 18 +++++++--- .../automation/SetupPanel/RowSelector.svelte | 34 +++++++++---------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 562b3bcbe0..283bd14fc0 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -250,6 +250,7 @@ }, })) }, + placeholder: false, getOptionLabel: type => type.name, getOptionValue: type => type.id, options: [ @@ -280,14 +281,14 @@ tableId: inputData["row"].tableId, }, meta: { - fields: inputData["meta"].oldFields || {}, + fields: inputData["meta"]?.oldFields || {}, }, onChange: e => { onChange({ oldRow: e.detail.row, meta: { - fields: inputData["meta"].fields, - oldFields: e.detail.meta.fields, + fields: inputData["meta"]?.fields || {}, + oldFields: e.detail?.meta?.fields || {}, }, }) }, @@ -304,7 +305,15 @@ row: inputData["row"], meta: inputData["meta"] || {}, onChange: e => { - onChange(e.detail) + onChange({ + row: e.detail.row, + meta: { + fields: e.detail?.meta?.fields || {}, + ...(isTestModal + ? { oldFields: inputData["meta"]?.oldFields || {} } + : {}), + }, + }) }, ...baseProps, }, @@ -452,7 +461,6 @@ */ const onChange = Utils.sequential(async update => { const request = cloneDeep(update) - // Process app trigger updates if (isTrigger && !isTestModal) { // Row trigger diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index a2c83ea060..32e38803b3 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -288,29 +288,27 @@ {/each} {#if table && schemaFields} - {#key editableFields} -
- { - customPopover.show() - }} - disabled={!schemaFields} - >Add fields - -
- {/key} +
+ { + customPopover.show() + }} + disabled={!schemaFields} + >Add fields + +
{/if}