|
|
@ -7,9 +7,11 @@ import { |
|
|
|
LinkToAnotherRecordType, |
|
|
|
LinkToAnotherRecordType, |
|
|
|
RelationTypes, |
|
|
|
RelationTypes, |
|
|
|
UITypes, |
|
|
|
UITypes, |
|
|
|
|
|
|
|
ViewTypes, |
|
|
|
} from 'nocodb-sdk'; |
|
|
|
} from 'nocodb-sdk'; |
|
|
|
import Column from '../../../models/Column'; |
|
|
|
import Column from '../../../models/Column'; |
|
|
|
import Base from '../../../models/Base'; |
|
|
|
import Base from '../../../models/Base'; |
|
|
|
|
|
|
|
import KanbanView from '../../../models/KanbanView'; |
|
|
|
import Project from '../../../models/Project'; |
|
|
|
import Project from '../../../models/Project'; |
|
|
|
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
|
|
|
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
|
|
|
|
|
|
|
|
|
|
@ -39,13 +41,21 @@ export async function viewMetaGet(req: Request, res: Response) { |
|
|
|
// todo: return only required props
|
|
|
|
// todo: return only required props
|
|
|
|
delete view['password']; |
|
|
|
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 |
|
|
|
view.model.columns = view.columns |
|
|
|
.filter((c) => { |
|
|
|
.filter((c) => { |
|
|
|
const column = view.model.columnsById[c.fk_column_id]; |
|
|
|
const column = view.model.columnsById[c.fk_column_id]; |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
c.show || |
|
|
|
c.show || |
|
|
|
|
|
|
|
(view.type === ViewTypes.KANBAN && |
|
|
|
|
|
|
|
c.fk_column_id === kanbanGroupingFieldId) || |
|
|
|
(column.rqd && !column.cdf && !column.ai) || |
|
|
|
(column.rqd && !column.cdf && !column.ai) || |
|
|
|
column.pk || |
|
|
|
column.pk || |
|
|
|
view.model.columns.some( |
|
|
|
view.model.columns.some( |
|
|
|