From beed32a5a6222831269b196cdb15222acc37744f Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Wed, 3 Aug 2022 19:07:31 +0530 Subject: [PATCH 1/4] refactor/gui-v2-added-rollup-column --- .../smartsheet-column/EditOrAdd.vue | 22 +++-- .../smartsheet-column/RollupOptions.vue | 94 +++++++++++++++++++ 2 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index 4cd8369692..a0a30bb131 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -1,5 +1,6 @@ + + + + From 6f448f06a8a061cf6be669ca483be9f5524d0c71 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Wed, 3 Aug 2022 19:13:43 +0530 Subject: [PATCH 2/4] fix/gui-v2-rollup-column-style-fix --- .../nc-gui-v2/components/smartsheet-column/RollupOptions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue index 45d0670b57..86bd412256 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue @@ -61,9 +61,9 @@ const columns = $computed(() => { -
+
{{ table.column.title }}
-
({{ relationNames[table.col.type] }} {{ table.title || table.table_name }})
+
({{ relationNames[table.col.type] }} {{ table.title || table.table_name }})
From 0daab21eec7db649c32983ab40a5bc7e8b6a61bd Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 11:14:31 +0530 Subject: [PATCH 3/4] fix/fixed rollup column validation issue --- .../nc-gui-v2/components/smartsheet-column/RollupOptions.vue | 4 ++++ packages/nc-gui-v2/composables/useColumnCreateStore.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue index 86bd412256..e3fa65240d 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue @@ -31,6 +31,10 @@ const aggrFunctionsList = [ { text: 'avgDistinct', value: 'avgDistinct' }, ] +if (!formState.fk_relation_column_id) formState.fk_relation_column_id = null +if (!formState.fk_rollup_column_id) formState.fk_rollup_column_id = null +if (!formState.rollup_function) formState.rollup_function = null + const refTables = $computed(() => { if (!tables || !tables.length) { return [] diff --git a/packages/nc-gui-v2/composables/useColumnCreateStore.ts b/packages/nc-gui-v2/composables/useColumnCreateStore.ts index 59c0b9dc37..f1d37686d1 100644 --- a/packages/nc-gui-v2/composables/useColumnCreateStore.ts +++ b/packages/nc-gui-v2/composables/useColumnCreateStore.ts @@ -198,7 +198,8 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState } onSuccess() } catch (e: any) { - toast.error(await extractSdkResponseErrorMsg(e)) + const error = await extractSdkResponseErrorMsg(e) + if (error) toast.error(await extractSdkResponseErrorMsg(e)) } } From 048c2d45fbdb037c15d7ad6a521d5655f40a270c Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 11:26:31 +0530 Subject: [PATCH 4/4] chore/removed unnecassary rollup option import --- packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index a0a30bb131..3f196a7af4 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -1,6 +1,5 @@