From f4c6ab7f48960b780d398cd56858512b08221d70 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 24 Oct 2023 17:33:49 +0100 Subject: [PATCH] Make sure the user cannot enter the same column name as the old column for the migrated column. --- .../src/components/grid/cells/HeaderCell.svelte | 1 - .../src/components/grid/controls/MigrationModal.svelte | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte index 9b05f9ef79..420be480e9 100644 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte @@ -18,7 +18,6 @@ export let orderable = true const { - API, reorder, isReordering, isResizing, diff --git a/packages/frontend-core/src/components/grid/controls/MigrationModal.svelte b/packages/frontend-core/src/components/grid/controls/MigrationModal.svelte index e329038217..f4070e7a98 100644 --- a/packages/frontend-core/src/components/grid/controls/MigrationModal.svelte +++ b/packages/frontend-core/src/components/grid/controls/MigrationModal.svelte @@ -12,6 +12,7 @@ export let column let newColumnName = `${column.schema.name} (migrated)` + $: newAndOldNameMatch = column.schema.name === newColumnName const migrateUserColumn = async () => { let subtype = "users" @@ -43,6 +44,7 @@ confirmText="Continue" cancelText="Cancel" onConfirm={migrateUserColumn} + disabled={newAndOldNameMatch} size="M" > This operation will kick off a migration of the column "{column.schema.name}" @@ -54,5 +56,11 @@ header="Are you sure?" message="This will leave bindings which utilised the user relationship column in a state where they will need to be updated to use the new column instead." /> - +