mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Redesign examples and templates UI
Summary: The old Examples and Templates workspace is now a page that pulls templates from a new public Grist Templates org. The All Documents view will pull featured templates from that org, where featured templates are simply pinned documents in Grist Templates. The Examples and Templates page will also show the featured templates, as well as the rest of the available templates organized by category. The categories are equivalent to workspaces in Grist Templates, and are generated dynamically. Test Plan: Browser tests. Reviewers: paulfitz, dsagal Reviewed By: paulfitz, dsagal Subscribers: dsagal, paulfitz, jarek Differential Revision: https://phab.getgrist.com/D2930
This commit is contained in:
@@ -37,9 +37,23 @@ export function urlState(): UrlState<IGristUrlState> {
|
||||
}
|
||||
let _urlState: UrlState<IGristUrlState>|undefined;
|
||||
|
||||
// Returns url parameters appropriate for the specified document, specifically `doc` and `slug`.
|
||||
export function docUrl(doc: Document): IGristUrlState {
|
||||
return {doc: doc.urlId || doc.id, slug: getSlugIfNeeded(doc)};
|
||||
/**
|
||||
* Returns url parameters appropriate for the specified document.
|
||||
*
|
||||
* In addition to setting `doc` and `slug`, it sets additional parameters
|
||||
* from `params` if any are supplied.
|
||||
*/
|
||||
export function docUrl(doc: Document, params: {org?: string} = {}): IGristUrlState {
|
||||
const state: IGristUrlState = {
|
||||
doc: doc.urlId || doc.id,
|
||||
slug: getSlugIfNeeded(doc),
|
||||
};
|
||||
|
||||
// TODO: Get non-sample documents with `org` set to fully work (a few tests fail).
|
||||
if (params.org) {
|
||||
state.org = params.org;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
// Returns the home page for the current org.
|
||||
|
||||
Reference in New Issue
Block a user