From a58eede9511a7ce34b81c0c4860ea340115b8150 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 14 Feb 2023 17:22:41 +0530 Subject: [PATCH] refactor(gui): reset column on changing relation Signed-off-by: Pranav C --- .../components/smartsheet/column/LookupOptions.vue | 11 ++++++----- .../components/smartsheet/column/RollupOptions.vue | 13 +++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/column/LookupOptions.vue b/packages/nc-gui/components/smartsheet/column/LookupOptions.vue index a24e9dc9bb..b205d4f06c 100644 --- a/packages/nc-gui/components/smartsheet/column/LookupOptions.vue +++ b/packages/nc-gui/components/smartsheet/column/LookupOptions.vue @@ -53,26 +53,27 @@ 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 } }) +const onRelationColChange = () => { + vModel.value.fk_rollup_column_id = columns?.[0]?.id + onDataTypeChange() +}