diff --git a/packages/nc-gui/components/dlg/ViewCreate.vue b/packages/nc-gui/components/dlg/ViewCreate.vue
index b1eb50726e..3e9c400f9f 100644
--- a/packages/nc-gui/components/dlg/ViewCreate.vue
+++ b/packages/nc-gui/components/dlg/ViewCreate.vue
@@ -25,6 +25,7 @@ interface Props {
type: ViewTypes
title?: string
selectedViewId?: string
+ groupingFieldColumnId?: string
}
interface Emits {
@@ -123,7 +124,13 @@ function init() {
label: field.title,
}
})
- form.grp_column_id = singleSelectFieldOptions.value?.[0]?.value as string
+ if (props.groupingFieldColumnId) {
+ // take from the one from copy view
+ form.grp_column_id = props.groupingFieldColumnId
+ } else {
+ // take the first option
+ form.grp_column_id = singleSelectFieldOptions.value?.[0]?.value as string
+ }
}
nextTick(() => {
@@ -186,11 +193,17 @@ async function onSubmit() {
-
+
diff --git a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
index f8e232eef4..f4f1624bbd 100644
--- a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
+++ b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
@@ -28,7 +28,7 @@ const emits = defineEmits()
const { t } = useI18n()
interface Emits {
- (event: 'openModal', data: { type: ViewTypes; title?: string; copyViewId?: string }): void
+ (event: 'openModal', data: { type: ViewTypes; title?: string; copyViewId?: string; groupingFieldColumnId?: string }): void
(event: 'deleted'): void
}
diff --git a/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue b/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
index 0df3513929..8c7d93b9bb 100644
--- a/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
+++ b/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
@@ -1,5 +1,5 @@