mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Filter out pages for hidden views from the page list.
Summary: - Filters out hidden pages from docModel.allPagesList (used for knowing default page, and for search iteration). - Filters out hidden pages from TreeModel (uses raw tableData, so has a different way to filter). Test Plan: WIP Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D2996
This commit is contained in:
@@ -18,7 +18,7 @@ export function createDocInfoRec(this: DocInfoRec, docModel: DocModel): void {
|
||||
return tab ? tab.viewRef() : 0;
|
||||
}));
|
||||
this.newDefaultViewId = this.autoDispose(ko.pureComputed(() => {
|
||||
const page = docModel.allDocPages.at(0);
|
||||
const page = docModel.visibleDocPages()[0];
|
||||
return page ? page.viewRef() : 0;
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -4,8 +4,13 @@ import * as ko from 'knockout';
|
||||
// Represents a page entry in the tree of pages.
|
||||
export interface PageRec extends IRowModel<"_grist_Pages"> {
|
||||
view: ko.Computed<ViewRec>;
|
||||
isHidden: ko.Computed<boolean>;
|
||||
}
|
||||
|
||||
export function createPageRec(this: PageRec, docModel: DocModel): void {
|
||||
this.view = refRecord(docModel.views, this.viewRef);
|
||||
this.isHidden = ko.pureComputed(() => {
|
||||
const name = this.view().name();
|
||||
return !name || (name === 'GristDocTour' && !docModel.showDocTourTable);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user