(core) Showing a raw data section on a popup

Summary:
Show raw data will now open a popup with
raw section instead of redirecting to raw data page.

Adding new anchor link type "a2" that is able to open
any section in a popup on a current view.

Not related:
Fixing highlightMatches function, after merging core PR.

Test Plan: Updated tests

Reviewers: alexmojaki, georgegevoian

Reviewed By: alexmojaki, georgegevoian

Subscribers: georgegevoian, alexmojaki

Differential Revision: https://phab.getgrist.com/D3592
This commit is contained in:
Jarosław Sadziński
2022-08-24 13:43:15 +02:00
parent 177b9d83d9
commit 2997434815
8 changed files with 186 additions and 67 deletions

View File

@@ -307,7 +307,7 @@ BaseView.prototype.getAnchorLinkForSection = function(sectionId) {
// Note that this case only happens in combination with the widget linking mentioned.
// If the table is empty but the 'new record' row is selected, the `viewData.getRowId` line above works.
|| 'new';
const colRef = this.viewSection.viewFields().peek()[this.cursor.fieldIndex()].colRef();
const colRef = this.viewSection.viewFields().peek()[this.cursor.fieldIndex.peek()].colRef.peek();
return {hash: {sectionId, rowId, colRef}};
}
@@ -328,7 +328,8 @@ BaseView.prototype.copyLink = async function() {
BaseView.prototype.showRawData = async function() {
const sectionId = this.schemaModel.rawViewSectionRef.peek();
const anchorUrlState = this.getAnchorLinkForSection(sectionId);
await urlState().pushUrl({...anchorUrlState, docPage: 'data'});
anchorUrlState.hash.popup = true;
await urlState().pushUrl(anchorUrlState, {replace: true, avoidReload: true});
}
BaseView.prototype.filterByThisCellValue = function() {