mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Undo bug with summary table and raw data view
Summary: Clicking undo/redo after converting a table to a summary table navigated to the raw data view. Test Plan: new test Reviewers: georgegevoian, alexmojaki Reviewed By: georgegevoian, alexmojaki Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3337
This commit is contained in:
parent
546096fcc9
commit
64c9717ac1
@ -924,12 +924,12 @@ export class GristDoc extends DisposableWithEvents {
|
|||||||
*/
|
*/
|
||||||
private async _switchToSectionId(sectionId: number) {
|
private async _switchToSectionId(sectionId: number) {
|
||||||
const section: ViewSectionRec = this.docModel.viewSections.getRowModel(sectionId);
|
const section: ViewSectionRec = this.docModel.viewSections.getRowModel(sectionId);
|
||||||
const view: ViewRec = section.view.peek();
|
if (section.isRaw.peek()) {
|
||||||
if (!view.id.peek()) {
|
|
||||||
// This is raw data view
|
// This is raw data view
|
||||||
await urlState().pushUrl({docPage: 'data'});
|
await urlState().pushUrl({docPage: 'data'});
|
||||||
this.viewModel.activeSectionId(sectionId);
|
this.viewModel.activeSectionId(sectionId);
|
||||||
} else {
|
} else {
|
||||||
|
const view: ViewRec = section.view.peek();
|
||||||
await this.openDocPage(view.getRowId());
|
await this.openDocPage(view.getRowId());
|
||||||
view.activeSectionId(sectionId); // this.viewModel will reflect this with a delay.
|
view.activeSectionId(sectionId); // this.viewModel will reflect this with a delay.
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,9 @@ function createNodes(docModel: DocModel, sections: MaybeSection[]) {
|
|||||||
|
|
||||||
// Creates an array of LinkNode from a view section record.
|
// Creates an array of LinkNode from a view section record.
|
||||||
function fromViewSectionRec(section: ViewSectionRec): LinkNode[] {
|
function fromViewSectionRec(section: ViewSectionRec): LinkNode[] {
|
||||||
|
if (section.isDisposed()) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const table = section.table.peek();
|
const table = section.table.peek();
|
||||||
const ancestors = new Set<number>();
|
const ancestors = new Set<number>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user