mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
feat: ADD Terms of service link (#985)
Adds an optional terms of service link for sites that need it. --------- Co-authored-by: Jonathan Perret <j-github@jonathanperret.net>
This commit is contained in:
@@ -146,6 +146,14 @@ export function createHomeLeftPane(leftPanelOpen: Observable<boolean>, home: Hom
|
||||
) : null
|
||||
),
|
||||
createHelpTools(home.app),
|
||||
(commonUrls.termsOfService ?
|
||||
cssPageEntry(
|
||||
cssPageLink(cssPageIcon('Memo'), cssLinkText(t("Terms of service")),
|
||||
{ href: commonUrls.termsOfService, target: '_blank' },
|
||||
testId('dm-tos'),
|
||||
),
|
||||
) : null
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -91,6 +91,7 @@ export const commonUrls = {
|
||||
helpAPI: 'https://support.getgrist.com/api',
|
||||
freeCoachingCall: getFreeCoachingCallUrl(),
|
||||
contactSupport: getContactSupportUrl(),
|
||||
termsOfService: getTermsOfServiceUrl(),
|
||||
plans: "https://www.getgrist.com/pricing",
|
||||
sproutsProgram: "https://www.getgrist.com/sprouts-program",
|
||||
contact: "https://www.getgrist.com/contact",
|
||||
@@ -689,6 +690,9 @@ export interface GristLoadConfig {
|
||||
// Url for support for the browser client to use.
|
||||
helpCenterUrl?: string;
|
||||
|
||||
// Url for terms of service for the browser client to use
|
||||
termsOfServiceUrl?: string;
|
||||
|
||||
// Url for free coaching call scheduling for the browser client to use.
|
||||
freeCoachingCallUrl?: string;
|
||||
|
||||
@@ -900,6 +904,15 @@ export function getHelpCenterUrl(): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function getTermsOfServiceUrl(): string|undefined {
|
||||
if(isClient()) {
|
||||
const gristConfig: GristLoadConfig = (window as any).gristConfig;
|
||||
return gristConfig && gristConfig.termsOfServiceUrl || undefined;
|
||||
} else {
|
||||
return process.env.GRIST_TERMS_OF_SERVICE_URL || undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function getFreeCoachingCallUrl(): string {
|
||||
const defaultUrl = "https://calendly.com/grist-team/grist-free-coaching-call";
|
||||
if(isClient()) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
getFreeCoachingCallUrl,
|
||||
getHelpCenterUrl,
|
||||
getPageTitleSuffix,
|
||||
getTermsOfServiceUrl,
|
||||
GristLoadConfig,
|
||||
IFeature
|
||||
} from 'app/common/gristUrls';
|
||||
@@ -62,6 +63,7 @@ export function makeGristConfig(options: MakeGristConfigOptions): GristLoadConfi
|
||||
baseDomain,
|
||||
singleOrg: process.env.GRIST_SINGLE_ORG,
|
||||
helpCenterUrl: getHelpCenterUrl(),
|
||||
termsOfServiceUrl: getTermsOfServiceUrl(),
|
||||
freeCoachingCallUrl: getFreeCoachingCallUrl(),
|
||||
contactSupportUrl: getContactSupportUrl(),
|
||||
pathOnly,
|
||||
|
||||
Reference in New Issue
Block a user