From 87be6230575647e3f4eb4f2678711e78a04b0bf8 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:26:13 +0000 Subject: [PATCH] Remove auto naming of columns (#12816) * Remove auto column naming * Let enter key save edit table name * update submodules --- .../DataTable/modals/CreateEditColumn.svelte | 21 ------------------- .../popovers/EditTablePopover.svelte | 19 ++++++++++------- yarn.lock | 5 +++++ 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 936eb614d6..0328759908 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -172,22 +172,6 @@ } } } - if (!savingColumn && !originalName) { - let highestNumber = 0 - Object.keys(table.schema).forEach(columnName => { - const columnNumber = extractColumnNumber(columnName) - if (columnNumber > highestNumber) { - highestNumber = columnNumber - } - return highestNumber - }) - - if (highestNumber >= 1) { - editableColumn.name = `Column 0${highestNumber + 1}` - } else { - editableColumn.name = "Column 01" - } - } if (!savingColumn) { editableColumn.fieldId = makeFieldId( @@ -389,11 +373,6 @@ deleteColName = "" } - function extractColumnNumber(columnName) { - const match = columnName.match(/Column (\d+)/) - return match ? parseInt(match[1]) : 0 - } - function getAllowedTypes() { if ( originalName && diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 18c0d460a8..f4b2a2fc25 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -17,7 +17,7 @@ export let table - let editorModal + let editorModal, editTableNameModal let confirmDeleteDialog let error = "" @@ -101,18 +101,21 @@ - +
editTableNameModal.confirm()}> + +