From f58ad3a12cfe017055dd53236c70841d066d9004 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Sun, 23 May 2021 15:06:33 +0100 Subject: [PATCH] allow deletion of relationships --- .../DataTable/modals/CreateEditColumn.svelte | 15 ++++++++++----- .../src/components/integration/index.svelte | 4 +++- packages/server/src/api/controllers/query.js | 9 ++++++++- .../server/src/integrations/microsoftSqlServer.js | 9 +++++++-- packages/server/src/integrations/rest.js | 8 ++++---- 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 88ee57e176..f5f6da7d86 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -33,6 +33,7 @@ let fieldDefinitions = cloneDeep(FIELDS) const { hide } = getContext(Context.Modal) + export let onClosed = () => {} export let field = { type: "string", constraints: fieldDefinitions.STRING.constraints, @@ -56,9 +57,8 @@ ) $: required = !!field?.constraints?.presence || primaryDisplay $: uneditable = - ($tables.selected?._id === TableNames.USERS && - UNEDITABLE_USER_FIELDS.includes(field.name)) || - (originalName && field.type === LINK_TYPE) + $tables.selected?._id === TableNames.USERS && + UNEDITABLE_USER_FIELDS.includes(field.name) $: invalid = !field.name || (field.type === LINK_TYPE && !field.tableId) || @@ -98,7 +98,8 @@ } else { tables.deleteField(field) notifications.success(`Column ${field.name} deleted.`) - hide() + confirmDeleteDialog.hide() + deletion = false } } @@ -193,7 +194,11 @@ onConfirm={saveColumn} disabled={invalid} > - +