Browse Source

fix(nc-gui): copy view issue for kanban

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
56240fe149
  1. 3
      packages/nocodb/src/lib/models/KanbanView.ts
  2. 4
      packages/nocodb/src/lib/models/View.ts

3
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;

4
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

Loading…
Cancel
Save