diff --git a/app/client/models/SearchModel.ts b/app/client/models/SearchModel.ts index 6008239b..ef10ae4f 100644 --- a/app/client/models/SearchModel.ts +++ b/app/client/models/SearchModel.ts @@ -189,8 +189,6 @@ class FinderImpl implements IFinder { if ('data' === this._gristDoc.activeViewId.get()) { // Get all raw sections. const rawSections = this._gristDoc.docModel.visibleTables.peek() - // Filter out those we don't have permissions to see (through ACL-tableId will be empty). - .filter(t => Boolean(t.tableId.peek())) // sort in order that is the same as on the raw data list page, .sort((a, b) => nativeCompare(a.tableNameDef.peek(), b.tableNameDef.peek())) // get rawViewSection, diff --git a/app/client/models/entities/PageRec.ts b/app/client/models/entities/PageRec.ts index 6ad94463..5cc61de3 100644 --- a/app/client/models/entities/PageRec.ts +++ b/app/client/models/entities/PageRec.ts @@ -15,7 +15,7 @@ export function createPageRec(this: PageRec, docModel: DocModel): void { const viewId = this.view().id(); const tables = docModel.rawDataTables.all(); const primaryTable = tables.find(t => t.primaryViewId() === viewId); - return !!primaryTable && primaryTable.isHidden(); + return !!primaryTable && primaryTable.tableId()?.startsWith("GristHidden_"); }; // Page is hidden when any of this is true: // - It has an empty name (or no name at all) diff --git a/app/client/models/entities/TableRec.ts b/app/client/models/entities/TableRec.ts index 89f0d6cc..a65b8aeb 100644 --- a/app/client/models/entities/TableRec.ts +++ b/app/client/models/entities/TableRec.ts @@ -52,7 +52,7 @@ export function createTableRec(this: TableRec, docModel: DocModel): void { this.summarySource = refRecord(docModel.tables, this.summarySourceTable); this.isHidden = this.autoDispose( // This is repeated logic from isHiddenTable. - ko.pureComputed(() => !!this.summarySourceTable() || this.tableId()?.startsWith("GristHidden")) + ko.pureComputed(() => !this.tableId() || !!this.summarySourceTable() || this.tableId().startsWith("GristHidden_")) ); // A Set object of colRefs for all summarySourceCols of this table. diff --git a/app/common/isHiddenTable.ts b/app/common/isHiddenTable.ts index 954603fe..65943a2a 100644 --- a/app/common/isHiddenTable.ts +++ b/app/common/isHiddenTable.ts @@ -7,7 +7,7 @@ import {UIRowId} from 'app/common/UIRowId'; */ 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 !tableId || isSummaryTable(tablesData, tableRef) || tableId.startsWith('GristHidden_'); } /** diff --git a/test/nbrowser/gristUtils.ts b/test/nbrowser/gristUtils.ts index 1b0fc226..bc6f9032 100644 --- a/test/nbrowser/gristUtils.ts +++ b/test/nbrowser/gristUtils.ts @@ -902,6 +902,11 @@ export async function addNewSection(typeRe: RegExp|string, tableRe: RegExp|strin await selectWidget(typeRe, tableRe, options); } +export async function openAddWidgetToPage() { + await driver.findWait('.test-dp-add-new', 2000).doClick(); + await driver.findWait('.test-dp-add-widget-to-page', 2000).doClick(); +} + // Select type and table that matches respectively typeRe and tableRe and save. The widget picker // must be already opened when calling this function. export async function selectWidget(