(core) Disable selection summary in previews

Summary:
This was causing an error to be thrown when a column header was
clicked in the import preview while merging.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3749
This commit is contained in:
George Gevoian 2022-12-27 23:44:39 -05:00
parent 7ef3c92b51
commit 17836031c5

View File

@ -84,8 +84,13 @@ function GridView(gristDoc, viewSectionModel, isPreview = false) {
this.isScrolledTop = this.autoDispose(ko.computed(() => this.scrollTop() > 0)); this.isScrolledTop = this.autoDispose(ko.computed(() => this.scrollTop() > 0));
this.cellSelector = selector.CellSelector.create(this, this); this.cellSelector = selector.CellSelector.create(this, this);
this.selectionSummary = SelectionSummary.create(this,
this.cellSelector, this.tableModel.tableData, this.sortedRows, this.viewSection.viewFields); if (!isPreview) {
// Disable summaries in import previews, for now.
this.selectionSummary = SelectionSummary.create(this,
this.cellSelector, this.tableModel.tableData, this.sortedRows, this.viewSection.viewFields);
}
this.colMenuTargets = {}; // Reference from column ref to its menu target dom this.colMenuTargets = {}; // Reference from column ref to its menu target dom
this.selectedColumns = this.autoDispose(ko.pureComputed(() => { this.selectedColumns = this.autoDispose(ko.pureComputed(() => {