From 3dd902666c899e87eea54b7dd39c6ecdc607f7d6 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 15 Mar 2021 20:38:55 +0000 Subject: [PATCH] fix duplicate column name issue --- .../DataTable/modals/CreateEditColumn.svelte | 6 +++- .../PropertyControls/ColorPicker.svelte | 34 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index ad2371f3ea..d269124219 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -53,7 +53,11 @@ $: uneditable = $backendUiStore.selectedTable?._id === TableNames.USERS && UNEDITABLE_USER_FIELDS.includes(field.name) - $: invalid = field.type === LINK_TYPE && !field.tableId + $: invalid = + (field.type === LINK_TYPE && !field.tableId) || + Object.keys($backendUiStore.draftTable.schema).some( + key => key === field.name + ) // used to select what different options can be displayed for column type $: canBeSearched = diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte index 6235e744f8..c777f79666 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte @@ -1,38 +1,42 @@