From db760af901fb86e2a5497d4ea3b0e90f68229c5d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 14 Feb 2023 13:23:33 +0530 Subject: [PATCH] feat: allow editing rollup and lookup column Signed-off-by: Pranav C --- .../smartsheet/column/EditOrAdd.vue | 4 +- .../smartsheet/column/LookupOptions.vue | 16 +- .../smartsheet/column/RollupOptions.vue | 13 +- .../nocodb/src/lib/meta/api/columnApis.ts | 197 +++++++++++------- 4 files changed, 144 insertions(+), 86 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue index 845f74d574..91004c235b 100644 --- a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue +++ b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue @@ -181,10 +181,10 @@ useEventListener('keydown', (e: KeyboardEvent) => { - + - + +import { onMounted } from '@vue/runtime-core' import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import { UITypes, isSystemColumn } from 'nocodb-sdk' import { getRelationName } from './utils' @@ -14,7 +15,7 @@ const vModel = useVModel(props, 'value', emit) const meta = $(inject(MetaInj, ref())) -const { setAdditionalValidations, validateInfos, onDataTypeChange } = useColumnCreateStoreOrThrow() +const { setAdditionalValidations, validateInfos, onDataTypeChange, isEdit } = useColumnCreateStoreOrThrow() const { tables } = $(useProject()) @@ -51,12 +52,23 @@ const columns = $computed(() => { } return metas[selectedTable.id].columns.filter((c: ColumnType) => !isSystemColumn(c)) }) + + +onMounted(() => { + if (isEdit.value) { + vModel.value.fk_lookup_column_id = vModel.value.colOptions?.fk_lookup_column_id + vModel.value.fk_relation_column_id = vModel.value.colOptions?.fk_relation_column_id + // delete vModel.value.colOptions + } +}) +