mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) support a ?compare=<docId2> option in document landing pages
Summary: If a `compare` query parameter is supplied, this diff will load the difference between the referenced document and the current document into an observable in the GristDoc. Nothing is done with the comparison yet. Comparisons are not yet live - they don't get updated if either document changes. For convenience, `window.gristDocPageModel` is set as an easy way to access the DocPageModel from the browser console. Test Plan: added test Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2615
This commit is contained in:
parent
dfdb54fcbd
commit
b33641dd0c
@ -65,6 +65,7 @@ export interface IGristUrlState {
|
||||
billingTask?: BillingTask;
|
||||
embed?: boolean;
|
||||
style?: InterfaceStyle;
|
||||
compare?: string;
|
||||
};
|
||||
hash?: HashLink; // if present, this specifies an individual row within a section of a page.
|
||||
}
|
||||
@ -256,6 +257,9 @@ export function decodeUrl(gristConfig: Partial<GristLoadConfig>, location: Locat
|
||||
// Turn on light style if no style has been specified.
|
||||
if (embed && !state.params!.style) { state.params!.style = 'light'; }
|
||||
}
|
||||
if (sp.has('compare')) {
|
||||
state.params!.compare = sp.get('compare')!;
|
||||
}
|
||||
if (location.hash) {
|
||||
const hash = location.hash;
|
||||
const hashParts = hash.split('.');
|
||||
|
Loading…
Reference in New Issue
Block a user