diff --git a/README.md b/README.md index 4eb7ca134..8b142c643 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,11 @@ Note: there is a test account you can use. Get this from another developer if yo - `DATADOG_APP_ID` - Datadog tracking application ID. - `DATADOG_CLIENT_TOKEN` - Datadog tracking client token. - `DD_ENV` - Datadog environment. -- `BEACON_TOKEN` - HelpScout beacon token -- `HS_CONTACTS_SUGGESTIONS` - Comma-separated IDs of the HelpScout articles to suggest on the contacts page -- `HS_CONTACTS_CONTACT_SUGGESTIONS` - Comma-separated IDs of the HelpScout articles to suggest on the contact page -- `HS_HOME_SUGGESTIONS` - Comma-separated IDs of the HelpScout articles to suggest on the dashboard page -- `HS_REPORTS_SUGGESTIONS` - Comma-separated IDs of the HelpScout articles to suggest on the reports pages -- `HS_TASKS_SUGGESTIONS` - Comma-separated IDs of the HelpScout articles to suggest on the tasks page +- `HELPJUICE_ORIGIN` - Helpjuice origin for documentation and user support (example: `https://www.helpducks.org`) +- `HELPJUICE_KNOWLEDGE_BASE_URL` - Knowledge base page to make the Helpjuice "Visit Knowledge Base" page link to (example: `https://www.helpducks.org/mpdx`) +- `HELP_URL_COACHING_ACTIVITY` - Link to an article explaining the coaching activity table +- `HELP_URL_COACHING_APPOINTMENTS_AND_RESULTS` - Link to an article explaining the coaching appointments and results table +- `HELP_URL_SETUP_FIND_ORGANIZATION` - Link to an article explaining how to find an organization - `PRIVACY_POLICY_URL` - URL of the privacy policy - `TERMS_OF_USE_URL` - URL of the terms of use - `DISABLE_SETUP_TOUR` - Set to `true` to disable starting users on the welcome tour. This should be removed from the codebase once tools are live. diff --git a/__tests__/util/setup.ts b/__tests__/util/setup.ts index c6b0ece87..379081a5c 100644 --- a/__tests__/util/setup.ts +++ b/__tests__/util/setup.ts @@ -25,8 +25,6 @@ expect.extend({ toHaveGraphqlOperation, }); -window.Beacon = jest.fn(); - window.document.createRange = (): Range => ({ setStart: jest.fn(), diff --git a/next.config.js b/next.config.js index 07e076370..1661c7226 100644 --- a/next.config.js +++ b/next.config.js @@ -41,7 +41,6 @@ const config = { SITE_URL: siteUrl, CLIENT_ID: process.env.CLIENT_ID ?? '4027334344069527005', CLIENT_SECRET: process.env.CLIENT_SECRET, - BEACON_TOKEN: process.env.BEACON_TOKEN, AUTH_PROVIDER: process.env.AUTH_PROVIDER ?? 'OKTA', OKTA_CLIENT_ID: process.env.OKTA_CLIENT_ID ?? '0oa1n0gjoy3j5Ycdg0h8', OKTA_CLIENT_SECRET: process.env.OKTA_CLIENT_SECRET, @@ -76,25 +75,13 @@ const config = { process.env.DATADOG_APP_ID && process.env.DATADOG_CLIENT_TOKEN, ).toString(), - HS_COACHING_ACTIVITY_SUMMARY: process.env.HS_COACHING_ACTIVITY_SUMMARY, - HS_COACHING_ACTIVITY: process.env.HS_COACHING_ACTIVITY, - HS_COACHING_APPOINTMENTS_AND_RESULTS: - process.env.HS_COACHING_APPOINTMENTS_AND_RESULTS, - HS_COACHING_COMMITMENTS: process.env.HS_COACHING_COMMITMENTS, - HS_COACHING_OUTSTANDING_RECURRING_COMMITMENTS: - process.env.HS_COACHING_OUTSTANDING_RECURRING_COMMITMENTS, - HS_COACHING_OUTSTANDING_SPECIAL_NEEDS: - process.env.HS_COACHING_OUTSTANDING_SPECIAL_NEEDS, - HS_COACHING_SUGGESTIONS: process.env.HS_COACHING_SUGGESTIONS, - HS_CONTACTS_CONTACT_SUGGESTIONS: - process.env.HS_CONTACTS_CONTACT_SUGGESTIONS, - HS_CONTACTS_SUGGESTIONS: process.env.HS_CONTACTS_SUGGESTIONS, - HS_HOME_SUGGESTIONS: process.env.HS_HOME_SUGGESTIONS, - HS_REPORTS_SUGGESTIONS: process.env.HS_REPORTS_SUGGESTIONS, - HS_TASKS_SUGGESTIONS: process.env.HS_TASKS_SUGGESTIONS, - HS_SETTINGS_SERVICES_SUGGESTIONS: - process.env.HS_SETTINGS_SERVICES_SUGGESTIONS, - HS_SETUP_FIND_ORGANIZATION: process.env.HS_SETUP_FIND_ORGANIZATION, + HELPJUICE_ORIGIN: process.env.HELPJUICE_ORIGIN, + HELPJUICE_KNOWLEDGE_BASE_URL: process.env.HELPJUICE_KNOWLEDGE_BASE_URL, + HELP_URL_COACHING_ACTIVITY: process.env.HELP_URL_COACHING_ACTIVITY, + HELP_URL_COACHING_APPOINTMENTS_AND_RESULTS: + process.env.HELP_URL_COACHING_APPOINTMENTS_AND_RESULTS, + HELP_URL_SETUP_FIND_ORGANIZATION: + process.env.HELP_URL_SETUP_FIND_ORGANIZATION, ALERT_MESSAGE: process.env.ALERT_MESSAGE, PRIVACY_POLICY_URL: process.env.PRIVACY_POLICY_URL, TERMS_OF_USE_URL: process.env.TERMS_OF_USE_URL, diff --git a/pages/_app.page.tsx b/pages/_app.page.tsx index 9cef845a7..20d37f3b7 100644 --- a/pages/_app.page.tsx +++ b/pages/_app.page.tsx @@ -21,7 +21,7 @@ import { I18nextProvider, useTranslation } from 'react-i18next'; import Rollbar from 'rollbar'; import DataDog from 'src/components/DataDog/DataDog'; import { GlobalStyles } from 'src/components/GlobalStyles/GlobalStyles'; -import HelpscoutBeacon from 'src/components/Helpscout/HelpscoutBeacon'; +import { Helpjuice } from 'src/components/Helpjuice/Helpjuice'; import PrimaryLayout from 'src/components/Layouts/Primary'; import Loading from 'src/components/Loading'; import { RouterGuard } from 'src/components/RouterGuard/RouterGuard'; @@ -36,7 +36,7 @@ import { useRequiredSession } from 'src/hooks/useRequiredSession'; import makeClient from 'src/lib/apollo/client'; import i18n from 'src/lib/i18n'; import theme from 'src/theme'; -import './helpscout.css'; +import './helpjuice.css'; import './print.css'; export type PageWithLayout = NextPage & { @@ -170,7 +170,6 @@ const App = ({ - @@ -203,6 +202,7 @@ const App = ({ + {process.env.ALERT_MESSAGE ? ( + {process.env.HELPJUICE_ORIGIN && ( + + )} + {/* The swifty.js script initializes in response to a DOMContentLoaded + * event, but that event has fired by the time the script is executed + * when using the Next.js