(core) Tweak navbar, breadcrumbs, and sign-in buttons

Summary:
The changes are intended to smooth over some sharp edges when a signed-out user
is using Grist (particularly while on the templates site).

Test Plan: Browser tests.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3957
This commit is contained in:
George Gevoian
2023-07-26 15:31:02 -07:00
parent bc54a6646e
commit a77170c4bd
25 changed files with 380 additions and 127 deletions

View File

@@ -20,7 +20,7 @@ import {
WebhookSummaryCollection,
WebhookUpdate
} from 'app/common/Triggers';
import {addCurrentOrgToPath} from 'app/common/urlUtils';
import {addCurrentOrgToPath, getGristConfig} from 'app/common/urlUtils';
import omitBy from 'lodash/omitBy';
@@ -92,11 +92,14 @@ export function getOrgName(org: Organization): string {
}
/**
* Returns whether the given org is the templates org, which contains the public templates.
* Returns whether the given org is the templates org, which contains the public
* templates and tutorials.
*/
export function isTemplatesOrg(org: Organization): boolean {
// TODO: It would be nice to have a more robust way to detect the templates org.
return org.domain === 'templates' || org.domain === 'templates-s';
export function isTemplatesOrg(org: {domain: Organization['domain']}|null): boolean {
if (!org) { return false; }
const {templateOrg} = getGristConfig();
return org.domain === templateOrg;
}
export type WorkspaceProperties = CommonProperties;
@@ -117,7 +120,7 @@ export interface Workspace extends WorkspaceProperties {
isSupportWorkspace?: boolean;
}
export type DocumentType = 'tutorial';
export type DocumentType = 'tutorial'|'template';
// Non-core options for a document.
// "Non-core" means bundled into a single options column in the database.

View File

@@ -80,6 +80,7 @@ export const commonUrls = {
plans: "https://www.getgrist.com/pricing",
sproutsProgram: "https://www.getgrist.com/sprouts-program",
contact: "https://www.getgrist.com/contact",
templates: 'https://www.getgrist.com/templates',
community: 'https://community.getgrist.com',
functions: 'https://support.getgrist.com/functions',
formulaSheet: 'https://support.getgrist.com/formula-cheat-sheet',
@@ -647,6 +648,9 @@ export interface GristLoadConfig {
// The Grist deployment type (e.g. core, enterprise).
deploymentType?: GristDeploymentType;
// The org containing public templates and tutorials.
templateOrg?: string|null;
}
export const Features = StringUnion(