make 'contact support' link customisable (#854)

Co-authored-by: CamilleLegeron <camille@telescoop.fr>
This commit is contained in:
Vincent Viers 2024-03-06 06:59:46 +01:00 committed by GitHub
parent cf6579dffa
commit 011cf9da0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 42 additions and 14 deletions

View File

@ -276,7 +276,8 @@ GRIST_FORCE_LOGIN | Much like GRIST_ANON_PLAYGROUND but don't support anonymo
GRIST_SINGLE_ORG | set to an org "domain" to pin client to that org GRIST_SINGLE_ORG | set to an org "domain" to pin client to that org
GRIST_TEMPLATE_ORG | set to an org "domain" to show public docs from that org GRIST_TEMPLATE_ORG | set to an org "domain" to show public docs from that org
GRIST_HELP_CENTER | set the help center link ref GRIST_HELP_CENTER | set the help center link ref
FREE_COACHING_CALL_URL | set the link to the human help (example: email or meeting scheduling tool) FREE_COACHING_CALL_URL | set the link to the human help (example: email adress or meeting scheduling tool)
GRIST_CONTACT_SUPPORT_URL | set the link to contact support on error pages (example: email adress or online form)
GRIST_SUPPORT_ANON | if set to 'true', show UI for anonymous access (not shown by default) GRIST_SUPPORT_ANON | if set to 'true', show UI for anonymous access (not shown by default)
GRIST_SUPPORT_EMAIL | if set, give a user with the specified email support powers. The main extra power is the ability to share sites, workspaces, and docs with all users in a listed way. GRIST_SUPPORT_EMAIL | if set, give a user with the specified email support powers. The main extra power is the ability to share sites, workspaces, and docs with all users in a listed way.
GRIST_TELEMETRY_LEVEL | the telemetry level. Can be set to: `off` (default), `limited`, or `full`. GRIST_TELEMETRY_LEVEL | the telemetry level. Can be set to: `off` (default), `limited`, or `full`.

View File

@ -8,6 +8,7 @@ import {cardPopup, cssPopupBody, cssPopupButtons, cssPopupCloseButton,
import {icon} from 'app/client/ui2018/icons'; import {icon} from 'app/client/ui2018/icons';
import {getGristConfig} from 'app/common/urlUtils'; import {getGristConfig} from 'app/common/urlUtils';
import {dom, styled} from 'grainjs'; import {dom, styled} from 'grainjs';
import { commonUrls } from 'app/common/gristUrls';
const t = makeT('WelcomeCoachingCall'); const t = makeT('WelcomeCoachingCall');
@ -103,7 +104,7 @@ We can show you the Grist basics, or start working with your data right away to
logTelemetryEvent('clickedScheduleCoachingCall'); logTelemetryEvent('clickedScheduleCoachingCall');
}), }),
{ {
href: getGristConfig().freeCoachingCallUrl, href: commonUrls.freeCoachingCall,
target: '_blank', target: '_blank',
}, },
testId('popup-primary-button'), testId('popup-primary-button'),

View File

@ -7,7 +7,7 @@ import {pagePanels} from 'app/client/ui/PagePanels';
import {createTopBarHome} from 'app/client/ui/TopBar'; import {createTopBarHome} from 'app/client/ui/TopBar';
import {bigBasicButtonLink, bigPrimaryButtonLink} from 'app/client/ui2018/buttons'; import {bigBasicButtonLink, bigPrimaryButtonLink} from 'app/client/ui2018/buttons';
import {theme, vars} from 'app/client/ui2018/cssVars'; import {theme, vars} from 'app/client/ui2018/cssVars';
import {getPageTitleSuffix} from 'app/common/gristUrls'; import {commonUrls, getPageTitleSuffix} from 'app/common/gristUrls';
import {getGristConfig} from 'app/common/urlUtils'; import {getGristConfig} from 'app/common/urlUtils';
import {dom, DomElementArg, makeTestId, observable, styled} from 'grainjs'; import {dom, DomElementArg, makeTestId, observable, styled} from 'grainjs';
@ -94,7 +94,7 @@ export function createNotFoundPage(appModel: AppModel, message?: string) {
})), })),
cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'), cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'),
urlState().setLinkUrl({}))), urlState().setLinkUrl({}))),
cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: 'https://getgrist.com/contact'})), cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: commonUrls.contactSupport})),
]); ]);
} }
@ -109,7 +109,7 @@ export function createOtherErrorPage(appModel: AppModel, message?: string) {
t('There was an unknown error.')), t('There was an unknown error.')),
cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'), cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'),
urlState().setLinkUrl({}))), urlState().setLinkUrl({}))),
cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: 'https://getgrist.com/contact'})), cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: commonUrls.contactSupport})),
]); ]);
} }

View File

@ -86,6 +86,8 @@ export const commonUrls = {
helpTelemetryLimited: "https://support.getgrist.com/telemetry-limited", helpTelemetryLimited: "https://support.getgrist.com/telemetry-limited",
helpCalendarWidget: "https://support.getgrist.com/widget-calendar", helpCalendarWidget: "https://support.getgrist.com/widget-calendar",
helpLinkKeys: "https://support.getgrist.com/examples/2021-04-link-keys", helpLinkKeys: "https://support.getgrist.com/examples/2021-04-link-keys",
freeCoachingCall: getFreeCoachingCallUrl(),
contactSupport: getContactSupportUrl(),
plans: "https://www.getgrist.com/pricing", plans: "https://www.getgrist.com/pricing",
sproutsProgram: "https://www.getgrist.com/sprouts-program", sproutsProgram: "https://www.getgrist.com/sprouts-program",
contact: "https://www.getgrist.com/contact", contact: "https://www.getgrist.com/contact",
@ -670,6 +672,9 @@ export interface GristLoadConfig {
// Url for free coaching call scheduling for the browser client to use. // Url for free coaching call scheduling for the browser client to use.
freeCoachingCallUrl?: string; freeCoachingCallUrl?: string;
// Url for "contact support" button on Grist's "not found" error page
contactSupportUrl?: string;
// When set, this directs the client to encode org information in path, not in domain. // When set, this directs the client to encode org information in path, not in domain.
pathOnly?: boolean; pathOnly?: boolean;
@ -865,21 +870,33 @@ export function getKnownOrg(): string|null {
} }
} }
export function getHelpCenterUrl(): string|null { export function getHelpCenterUrl(): string {
const defaultUrl = "https://support.getgrist.com";
if(isClient()) { if(isClient()) {
const gristConfig: GristLoadConfig = (window as any).gristConfig; const gristConfig: GristLoadConfig = (window as any).gristConfig;
return gristConfig && gristConfig.helpCenterUrl || null; return gristConfig && gristConfig.helpCenterUrl || defaultUrl;
} else { } else {
return process.env.GRIST_HELP_CENTER || null; return process.env.GRIST_HELP_CENTER || defaultUrl;
} }
} }
export function getFreeCoachingCallUrl(): string|null { export function getFreeCoachingCallUrl(): string {
const defaultUrl = "https://calendly.com/grist-team/grist-free-coaching-call";
if(isClient()) { if(isClient()) {
const gristConfig: GristLoadConfig = (window as any).gristConfig; const gristConfig: GristLoadConfig = (window as any).gristConfig;
return gristConfig && gristConfig.freeCoachingCallUrl || null; return gristConfig && gristConfig.freeCoachingCallUrl || defaultUrl;
} else { } else {
return process.env.FREE_COACHING_CALL_URL || null; return process.env.FREE_COACHING_CALL_URL || defaultUrl;
}
}
export function getContactSupportUrl(): string {
const defaultUrl = "https://www.getgrist.com/contact/";
if(isClient()) {
const gristConfig: GristLoadConfig = (window as any).gristConfig;
return gristConfig && gristConfig.contactSupportUrl || defaultUrl;
} else {
return process.env.GRIST_CONTACT_SUPPORT_URL || defaultUrl;
} }
} }

View File

@ -1,4 +1,12 @@
import {Features, getPageTitleSuffix, GristLoadConfig, IFeature} from 'app/common/gristUrls'; import {
Features,
getContactSupportUrl,
getFreeCoachingCallUrl,
getHelpCenterUrl,
getPageTitleSuffix,
GristLoadConfig,
IFeature
} from 'app/common/gristUrls';
import {isAffirmative} from 'app/common/gutil'; import {isAffirmative} from 'app/common/gutil';
import {getTagManagerSnippet} from 'app/common/tagManager'; import {getTagManagerSnippet} from 'app/common/tagManager';
import {Document} from 'app/common/UserAPI'; import {Document} from 'app/common/UserAPI';
@ -53,8 +61,9 @@ export function makeGristConfig(options: MakeGristConfigOptions): GristLoadConfi
org: process.env.GRIST_SINGLE_ORG || (mreq && mreq.org), org: process.env.GRIST_SINGLE_ORG || (mreq && mreq.org),
baseDomain, baseDomain,
singleOrg: process.env.GRIST_SINGLE_ORG, singleOrg: process.env.GRIST_SINGLE_ORG,
helpCenterUrl: process.env.GRIST_HELP_CENTER || "https://support.getgrist.com", helpCenterUrl: getHelpCenterUrl(),
freeCoachingCallUrl: process.env.FREE_COACHING_CALL_URL || "https://calendly.com/grist-team/grist-free-coaching-call", freeCoachingCallUrl: getFreeCoachingCallUrl(),
contactSupportUrl: getContactSupportUrl(),
pathOnly, pathOnly,
supportAnon: shouldSupportAnon(), supportAnon: shouldSupportAnon(),
enableAnonPlayground: isAffirmative(process.env.GRIST_ANON_PLAYGROUND ?? true), enableAnonPlayground: isAffirmative(process.env.GRIST_ANON_PLAYGROUND ?? true),