|
|
@ -1,5 +1,6 @@ |
|
|
|
import { ColumnReqType, ColumnType } from './Api'; |
|
|
|
import { ColumnReqType, ColumnType, TableType } from './Api'; |
|
|
|
import { FormulaDataTypes } from './formulaHelpers'; |
|
|
|
import { FormulaDataTypes } from './formulaHelpers'; |
|
|
|
|
|
|
|
import { RelationTypes } from '~/lib/globals'; |
|
|
|
|
|
|
|
|
|
|
|
enum UITypes { |
|
|
|
enum UITypes { |
|
|
|
ID = 'ID', |
|
|
|
ID = 'ID', |
|
|
@ -208,17 +209,25 @@ export function isCreatedOrLastModifiedByCol( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function isHiddenCol( |
|
|
|
export function isHiddenCol( |
|
|
|
col: (ColumnReqType | ColumnType) & { system?: number | boolean } |
|
|
|
col: (ColumnReqType | ColumnType) & { |
|
|
|
|
|
|
|
colOptions?: any; |
|
|
|
|
|
|
|
system?: number | boolean; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tableMeta: Partial<TableType> |
|
|
|
) { |
|
|
|
) { |
|
|
|
return ( |
|
|
|
if (!col.system) return false; |
|
|
|
col.system && |
|
|
|
|
|
|
|
( |
|
|
|
// hide belongs to column in mm tables only
|
|
|
|
[ |
|
|
|
if (col.uidt === UITypes.LinkToAnotherRecord) { |
|
|
|
UITypes.CreatedBy, |
|
|
|
if (col.colOptions?.type === RelationTypes.BELONGS_TO && tableMeta?.mm) { |
|
|
|
UITypes.LastModifiedBy, |
|
|
|
return true; |
|
|
|
UITypes.LinkToAnotherRecord, |
|
|
|
} |
|
|
|
] as string[] |
|
|
|
// hide system columns in other tables which are has-many used for mm
|
|
|
|
).includes(col.uidt) |
|
|
|
return col.colOptions?.type === RelationTypes.HAS_MANY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ([UITypes.CreatedBy, UITypes.LastModifiedBy] as string[]).includes( |
|
|
|
|
|
|
|
col.uidt |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|