From 9ef76504c5f80a7c46fbf6df24d72c1b295124cb Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 29 Sep 2022 12:28:28 +0800 Subject: [PATCH] feat(nc-gui): kanban grouping column id in copy view #3840 --- packages/nc-gui/components/dlg/ViewCreate.vue | 17 +++++++++++++++-- .../components/smartsheet/sidebar/MenuTop.vue | 2 +- .../smartsheet/sidebar/RenameableMenuItem.vue | 11 ++++++++--- .../components/smartsheet/sidebar/index.vue | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 7 deletions(-) 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 @@