mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
a051830aeb
Summary: Summary tables now have their own raw viewsection, and are shown under Raw Data Tables on the Raw Data page. Test Plan: Browser and Python tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3495
20 lines
786 B
TypeScript
20 lines
786 B
TypeScript
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;
|
|
}
|