From 56240fe149f941a029a2ad23f6a12bbfa226838e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 19 Sep 2022 12:16:14 +0800 Subject: [PATCH] fix(nc-gui): copy view issue for kanban --- packages/nocodb/src/lib/models/KanbanView.ts | 3 ++- packages/nocodb/src/lib/models/View.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/lib/models/KanbanView.ts b/packages/nocodb/src/lib/models/KanbanView.ts index ee9258a1ff..df31cd790d 100644 --- a/packages/nocodb/src/lib/models/KanbanView.ts +++ b/packages/nocodb/src/lib/models/KanbanView.ts @@ -44,8 +44,9 @@ export default class KanbanView implements KanbanType { base_id: view.base_id, fk_view_id: view.fk_view_id, grp_column_id: view.grp_column_id, - // TODO: more + stack_meta: view.stack_meta, }; + if (!(view.project_id && view.base_id)) { const viewRef = await View.get(view.fk_view_id); insertObj.project_id = viewRef.project_id; diff --git a/packages/nocodb/src/lib/models/View.ts b/packages/nocodb/src/lib/models/View.ts index 9cac631d0d..51886c1a4a 100644 --- a/packages/nocodb/src/lib/models/View.ts +++ b/packages/nocodb/src/lib/models/View.ts @@ -361,7 +361,7 @@ export default class View implements ViewType { let kanbanShowCount = 0; let kanbanAttachmentCount = 0; - if (view.type === ViewTypes.KANBAN) { + if (view.type === ViewTypes.KANBAN && !copyFromView) { // sort by primary value & attachment first, then by order // so that later we can handle control `show` easily columns.sort((a, b) => { @@ -388,7 +388,7 @@ export default class View implements ViewType { } else { show = false; } - } else if (view.type === ViewTypes.KANBAN) { + } else if (view.type === ViewTypes.KANBAN && !copyFromView) { const kanbanView = await KanbanView.get(view_id, ncMeta); if (vCol.id === kanbanView?.grp_column_id) { // include grouping field if it exists