From 16ea4195dfc453349fb2e08a25170fe965d37690 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 26 Apr 2024 15:52:39 +0200 Subject: [PATCH 1/2] Fix possible new reference --- packages/frontend-core/src/utils/rows.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/frontend-core/src/utils/rows.js b/packages/frontend-core/src/utils/rows.js index ea43d63734..50f676983d 100644 --- a/packages/frontend-core/src/utils/rows.js +++ b/packages/frontend-core/src/utils/rows.js @@ -8,6 +8,10 @@ const isBetterSample = (newValue, oldValue) => { return true } + if (oldValue != null && newValue == null) { + return false + } + // Don't change type const oldType = typeof oldValue const newType = typeof newValue From a6d96cec4da9ed1cfd74438b4c3c1a4680676f95 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 26 Apr 2024 15:55:08 +0200 Subject: [PATCH 2/2] Fix type editing attachments --- .../backend/DataTable/modals/CreateEditColumn.svelte | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index f3ae207cb4..bde6f1dbe1 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -365,13 +365,11 @@ function getAllowedTypes() { if (originalName) { - const possibleTypes = ( - SWITCHABLE_TYPES[field.type] || [editableColumn.type] - ).map(t => t.toLowerCase()) + const possibleTypes = SWITCHABLE_TYPES[field.type] || [ + editableColumn.type, + ] return Object.entries(FIELDS) - .filter(([fieldType]) => - possibleTypes.includes(fieldType.toLowerCase()) - ) + .filter(([_, field]) => possibleTypes.includes(field.type)) .map(([_, fieldDefinition]) => fieldDefinition) }