From 662e8d9c31c168bb7ea3953c90c870d901490e76 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Sep 2023 17:02:11 +0100 Subject: [PATCH] Quick fix for disabling formula changing, swapping between static and dynamic can cause problems. --- .../backend/DataTable/modals/CreateEditColumn.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index fdfbff7b14..fd13767a63 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -55,7 +55,7 @@ let linkEditDisabled let primaryDisplay let indexes = [...($tables.selected.indexes || [])] - let isCreating + let isCreating = undefined let table = $tables.selected let confirmDeleteDialog @@ -75,11 +75,11 @@ } const initialiseField = (field, savingColumn) => { + isCreating = !field if (field && !savingColumn) { editableColumn = cloneDeep(field) originalName = editableColumn.name ? editableColumn.name + "" : null linkEditDisabled = originalName != null - isCreating = originalName == null primaryDisplay = $tables.selected.primaryDisplay == null || $tables.selected.primaryDisplay === editableColumn.name @@ -584,6 +584,7 @@ { label: "Dynamic", value: "dynamic" }, { label: "Static", value: "static" }, ]} + disabled={!isCreating} getOptionLabel={option => option.label} getOptionValue={option => option.value} tooltip="Dynamic formula are calculated when retrieved, but cannot be filtered or sorted by,