Browse Source

fix(nocodb): include kanban grouping field

pull/4848/head
Wing-Kam Wong 2 years ago
parent
commit
a09068ecd6
  1. 12
      packages/nocodb/src/lib/meta/api/publicApis/publicMetaApis.ts

12
packages/nocodb/src/lib/meta/api/publicApis/publicMetaApis.ts

@ -7,9 +7,11 @@ import {
LinkToAnotherRecordType,
RelationTypes,
UITypes,
ViewTypes,
} from 'nocodb-sdk';
import Column from '../../../models/Column';
import Base from '../../../models/Base';
import KanbanView from '../../../models/KanbanView';
import Project from '../../../models/Project';
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn';
@ -39,13 +41,21 @@ export async function viewMetaGet(req: Request, res: Response) {
// todo: return only required props
delete view['password'];
// const columnsById = c;
// include kanban grouping field column to share view
// even it is unselected in Fields
// so that it won't break kanban share view
let kanbanGroupingFieldId;
if (view.type === ViewTypes.KANBAN) {
kanbanGroupingFieldId = (await KanbanView.get(view.id)).fk_grp_col_id;
}
view.model.columns = view.columns
.filter((c) => {
const column = view.model.columnsById[c.fk_column_id];
return (
c.show ||
(view.type === ViewTypes.KANBAN &&
c.fk_column_id === kanbanGroupingFieldId) ||
(column.rqd && !column.cdf && !column.ai) ||
column.pk ||
view.model.columns.some(

Loading…
Cancel
Save