You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gristlabs_grist-core/app/common/isHiddenTable.ts

20 lines
786 B

import {TableData} from 'app/common/TableData';
import {UIRowId} from 'app/common/UIRowId';
/**
* Return whether a table (identified by the rowId of its metadata record) should
* normally be hidden from the user (e.g. as an option in the page-widget picker).
*/
export function isHiddenTable(tablesData: TableData, tableRef: UIRowId): boolean {
const tableId = tablesData.getValue(tableRef, 'tableId') as string|undefined;
return isSummaryTable(tablesData, tableRef) || Boolean(tableId?.startsWith('GristHidden'));
}
/**
* Return whether a table (identified by the rowId of its metadata record) is a
* summary table.
*/
export function isSummaryTable(tablesData: TableData, tableRef: UIRowId): boolean {
return tablesData.getValue(tableRef, 'summarySourceTable') !== 0;
}