From 4a17aa1f2f8166f6e0eea3d3a475fe300f990ada Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Wed, 28 Aug 2024 14:24:09 -0500 Subject: [PATCH 01/13] Remove HelpScout beacon --- README.md | 5 - next.config.js | 20 -- pages/_app.page.tsx | 3 - pages/accountLists/[accountListId].page.tsx | 5 - .../contacts/ContactsWrapper.tsx | 7 - .../[accountListId]/reports/coaching.page.tsx | 7 +- .../reports/designationAccounts.page.tsx | 7 +- .../donations/[[...contactId]].page.tsx | 7 +- .../reports/expectedMonthlyTotal.page.tsx | 7 +- .../partnerCurrency/[[...contactId]].page.tsx | 7 +- .../[[...contactId]].page.tsx | 7 +- .../reports/responsibilityCenters.page.tsx | 7 +- .../salaryCurrency/[[...contactId]].page.tsx | 7 +- .../settings/admin.page.test.tsx | 4 - .../[accountListId]/settings/admin.page.tsx | 7 +- .../settings/integrations/index.page.tsx | 4 - .../settings/manageAccounts.page.test.tsx | 4 - .../settings/manageAccounts.page.tsx | 7 +- .../settings/manageCoaches.page.test.tsx | 13 +- .../settings/manageCoaches.page.tsx | 9 +- .../settings/organizations.page.tsx | 5 - .../settings/preferences.page.tsx | 5 - .../tasks/[[...contactId]].page.tsx | 5 - .../tools/appeals/AppealsWrapper.tsx | 7 - .../[[...contactId]].page.test.tsx | 3 - .../[[...contactId]].page.test.tsx | 3 - .../[[...contactId]].page.test.tsx | 3 - .../[[...contactId]].page.test.tsx | 3 - .../contacts/[[...contactId]].page.test.tsx | 3 - .../people/[[...contactId]].page.test.tsx | 3 - pages/helpscout.css | 27 --- pages/print.css | 4 - .../CoachingDetail/Activity/Activity.tsx | 2 - .../ActivitySummary/ActivitySummary.tsx | 11 +- .../AppointmentResults/AppointmentResults.tsx | 11 +- .../CoachingDetail/HelpButton.test.tsx | 17 -- .../Coaching/CoachingDetail/HelpButton.tsx | 17 -- .../Helpscout/HelpscoutBeacon.test.tsx | 45 ----- src/components/Helpscout/HelpscoutBeacon.tsx | 27 --- .../Organization/ConnectOrganization.tsx | 10 - src/lib/helpScout.test.ts | 183 ------------------ src/lib/helpScout.ts | 110 ----------- 42 files changed, 14 insertions(+), 634 deletions(-) delete mode 100644 pages/helpscout.css delete mode 100644 src/components/Coaching/CoachingDetail/HelpButton.test.tsx delete mode 100644 src/components/Coaching/CoachingDetail/HelpButton.tsx delete mode 100644 src/components/Helpscout/HelpscoutBeacon.test.tsx delete mode 100644 src/components/Helpscout/HelpscoutBeacon.tsx delete mode 100644 src/lib/helpScout.test.ts delete mode 100644 src/lib/helpScout.ts diff --git a/README.md b/README.md index 4eb7ca134..04da5f34a 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,6 @@ Note: there is a test account you can use. Get this from another developer if yo - `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 - `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/next.config.js b/next.config.js index 07e076370..8d437e621 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,6 @@ 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, 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..f052b0cb9 100644 --- a/pages/_app.page.tsx +++ b/pages/_app.page.tsx @@ -21,7 +21,6 @@ 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 PrimaryLayout from 'src/components/Layouts/Primary'; import Loading from 'src/components/Loading'; import { RouterGuard } from 'src/components/RouterGuard/RouterGuard'; @@ -36,7 +35,6 @@ 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 './print.css'; export type PageWithLayout = NextPage & { @@ -170,7 +168,6 @@ const App = ({ - diff --git a/pages/accountLists/[accountListId].page.tsx b/pages/accountLists/[accountListId].page.tsx index bbc4df317..b1ed999e5 100644 --- a/pages/accountLists/[accountListId].page.tsx +++ b/pages/accountLists/[accountListId].page.tsx @@ -11,7 +11,6 @@ import { TaskModalEnum } from 'src/components/Task/Modal/TaskModal'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import useTaskModal from 'src/hooks/useTaskModal'; import makeSsrClient from 'src/lib/apollo/ssrClient'; -import { suggestArticles } from 'src/lib/helpScout'; import { GetDashboardDocument, GetDashboardQuery, @@ -33,10 +32,6 @@ const AccountListIdPage = ({ useState(null); const [dialogOpen, setDialogOpen] = useState(false); - useEffect(() => { - suggestArticles('HS_HOME_SUGGESTIONS'); - }, []); - useEffect(() => { if (!modal || dialogOpen) { return; diff --git a/pages/accountLists/[accountListId]/contacts/ContactsWrapper.tsx b/pages/accountLists/[accountListId]/contacts/ContactsWrapper.tsx index 729776471..b68b343c4 100644 --- a/pages/accountLists/[accountListId]/contacts/ContactsWrapper.tsx +++ b/pages/accountLists/[accountListId]/contacts/ContactsWrapper.tsx @@ -2,7 +2,6 @@ import { useRouter } from 'next/router'; import React, { useEffect, useMemo, useState } from 'react'; import { ContactsProvider } from 'src/components/Contacts/ContactsContext/ContactsContext'; import { ContactFilterSetInput } from 'src/graphql/types.generated'; -import { suggestArticles } from 'src/lib/helpScout'; import { sanitizeFilters } from 'src/lib/sanitizeFilters'; interface Props { @@ -45,12 +44,6 @@ export const ContactsWrapper: React.FC = ({ children }) => { }); }, [sanitizedFilters, isReady]); - useEffect(() => { - suggestArticles( - contactId ? 'HS_CONTACTS_CONTACT_SUGGESTIONS' : 'HS_CONTACTS_SUGGESTIONS', - ); - }, [contactId]); - return ( { const { t } = useTranslation(); const accountListId = useAccountListId(); const { appName } = useGetAppSettings(); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - return ( <> diff --git a/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx b/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx index df3626875..077d4fb14 100644 --- a/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx +++ b/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,6 @@ import { } from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; const DesignationAccountsReportPageWrapper = styled(Box)(({ theme }) => ({ backgroundColor: theme.palette.common.white, @@ -26,10 +25,6 @@ const DesignationAccountsReportPage: React.FC = () => { const [isNavListOpen, setNavListOpen] = useState(false); const [designationAccounts, setDesignationAccounts] = useState([]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleNavListToggle = () => { setNavListOpen(!isNavListOpen); }; diff --git a/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx index 20945c7fc..34ff82c32 100644 --- a/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx @@ -1,6 +1,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -15,7 +15,6 @@ import { } from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; import { getQueryParam } from 'src/utils/queryParam'; import { ContactsWrapper } from '../../contacts/ContactsWrapper'; @@ -31,10 +30,6 @@ const DonationsReportPage: React.FC = () => { const [designationAccounts, setDesignationAccounts] = useState([]); const [isNavListOpen, setNavListOpen] = useState(false); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const selectedContactId = getQueryParam(router.query, 'contactId'); const handleNavListToggle = () => { diff --git a/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx b/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx index 25b2651c5..5cd5b07f0 100644 --- a/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx +++ b/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import React, { ReactElement, useEffect, useState } from 'react'; +import React, { ReactElement, useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -14,7 +14,6 @@ import { } from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; const ExpectedMonthlyTotalReportPageWrapper = styled(Box)(({ theme }) => ({ backgroundColor: theme.palette.common.white, @@ -27,10 +26,6 @@ const ExpectedMonthlyTotalReportPage = (): ReactElement => { const [isNavListOpen, setNavListOpen] = useState(false); const [designationAccounts, setDesignationAccounts] = useState([]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleNavListToggle = () => { setNavListOpen(!isNavListOpen); }; diff --git a/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx index 277ee217f..0adaa6ba8 100644 --- a/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx @@ -1,6 +1,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -16,7 +16,6 @@ import { import { FourteenMonthReportCurrencyType } from 'src/graphql/types.generated'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; import { getQueryParam } from 'src/utils/queryParam'; import { ContactsWrapper } from '../../contacts/ContactsWrapper'; @@ -33,10 +32,6 @@ const PartnerCurrencyReportPage: React.FC = () => { const [isNavListOpen, setNavListOpen] = useState(false); const [designationAccounts, setDesignationAccounts] = useState([]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleNavListToggle = () => { setNavListOpen(!isNavListOpen); }; diff --git a/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx index bbdd7426b..eb1ac7e87 100644 --- a/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx @@ -1,6 +1,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import React, { useMemo, useRef, useState } from 'react'; import { sortBy } from 'lodash'; import { useTranslation } from 'react-i18next'; import { ReportContactFilterSetInput } from 'pages/api/graphql-rest.page.generated'; @@ -22,7 +22,6 @@ import { import { useAccountListId } from 'src/hooks/useAccountListId'; import { useDebouncedValue } from 'src/hooks/useDebounce'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; import { getQueryParam } from 'src/utils/queryParam'; import { useContactFiltersQuery } from '../../contacts/Contacts.generated'; import { ContactsWrapper } from '../../contacts/ContactsWrapper'; @@ -87,10 +86,6 @@ const PartnerGivingAnalysisReportPage: React.FC = () => { return [reportFilterGroup, ...groups]; }, [filterData]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleSelectContact = (contactId: string) => { router.push( `/accountLists/${accountListId}/reports/partnerGivingAnalysis/${contactId}`, diff --git a/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx b/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx index 0eba1be51..b5d0044ce 100644 --- a/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx +++ b/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,6 @@ import { } from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; const ResponsibilityCentersReportPageWrapper = styled(Box)(({ theme }) => ({ backgroundColor: theme.palette.common.white, @@ -26,10 +25,6 @@ const ResponsibilityCentersReportPage: React.FC = () => { const [isNavListOpen, setNavListOpen] = useState(false); const [designationAccounts, setDesignationAccounts] = useState([]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleNavListToggle = () => { setNavListOpen(!isNavListOpen); }; diff --git a/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx index b143d37ac..843902adc 100644 --- a/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx @@ -1,6 +1,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; import { useTranslation } from 'react-i18next'; @@ -16,7 +16,6 @@ import { import { FourteenMonthReportCurrencyType } from 'src/graphql/types.generated'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; import { getQueryParam } from 'src/utils/queryParam'; import { ContactsWrapper } from '../../contacts/ContactsWrapper'; @@ -33,10 +32,6 @@ const SalaryCurrencyReportPage: React.FC = () => { const [isNavListOpen, setNavListOpen] = useState(false); const [designationAccounts, setDesignationAccounts] = useState([]); - useEffect(() => { - suggestArticles('HS_REPORTS_SUGGESTIONS'); - }, []); - const handleNavListToggle = () => { setNavListOpen(!isNavListOpen); }; diff --git a/pages/accountLists/[accountListId]/settings/admin.page.test.tsx b/pages/accountLists/[accountListId]/settings/admin.page.test.tsx index 114019b27..dea1bcf0d 100644 --- a/pages/accountLists/[accountListId]/settings/admin.page.test.tsx +++ b/pages/accountLists/[accountListId]/settings/admin.page.test.tsx @@ -6,7 +6,6 @@ import { SnackbarProvider } from 'notistack'; import { I18nextProvider } from 'react-i18next'; import TestRouter from '__tests__/util/TestRouter'; import { GqlMockedProvider } from '__tests__/util/graphqlMocking'; -import { suggestArticles } from 'src/lib/helpScout'; import i18n from 'src/lib/i18n'; import theme from 'src/theme'; import Admin, { suggestedArticles } from './admin.page'; @@ -15,9 +14,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/settings/admin.page.tsx b/pages/accountLists/[accountListId]/settings/admin.page.tsx index e855faf64..fc402ad70 100644 --- a/pages/accountLists/[accountListId]/settings/admin.page.tsx +++ b/pages/accountLists/[accountListId]/settings/admin.page.tsx @@ -1,11 +1,10 @@ import { useRouter } from 'next/router'; -import React, { ReactElement, useEffect, useState } from 'react'; +import React, { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { enforceAdmin } from 'pages/api/utils/pagePropsHelpers'; import { ImpersonateUserAccordion } from 'src/components/Settings/Admin/ImpersonateUser/ImpersonateUserAccordion'; import { ResetAccountAccordion } from 'src/components/Settings/Admin/ResetAccount/ResetAccountAccordion'; import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/AccordionGroup'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from './Wrapper'; export const suggestedArticles = 'HS_SETTINGS_SERVICES_SUGGESTIONS'; @@ -19,10 +18,6 @@ const Admin = (): ReactElement => { : 'Impersonate User', ); - useEffect(() => { - suggestArticles(suggestedArticles); - }, []); - const handleAccordionChange = (panel: string) => { const panelLowercase = panel.toLowerCase(); setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase); diff --git a/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx b/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx index ae632395f..5ad22ca8e 100644 --- a/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx +++ b/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx @@ -17,7 +17,6 @@ import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/Accordion import { StickyBox } from 'src/components/Shared/Header/styledComponents'; import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from '../Wrapper'; const Integrations: React.FC = () => { @@ -65,9 +64,6 @@ const Integrations: React.FC = () => { const panelLowercase = panel.toLowerCase(); setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase); }; - useEffect(() => { - suggestArticles('HS_SETTINGS_SERVICES_SUGGESTIONS'); - }, []); useEffect(() => { if (onSetupTour) { diff --git a/pages/accountLists/[accountListId]/settings/manageAccounts.page.test.tsx b/pages/accountLists/[accountListId]/settings/manageAccounts.page.test.tsx index 17f1dc1f4..c57dd8faa 100644 --- a/pages/accountLists/[accountListId]/settings/manageAccounts.page.test.tsx +++ b/pages/accountLists/[accountListId]/settings/manageAccounts.page.test.tsx @@ -5,7 +5,6 @@ import { SnackbarProvider } from 'notistack'; import { I18nextProvider } from 'react-i18next'; import TestRouter from '__tests__/util/TestRouter'; import { GqlMockedProvider } from '__tests__/util/graphqlMocking'; -import { suggestArticles } from 'src/lib/helpScout'; import i18n from 'src/lib/i18n'; import theme from 'src/theme'; import ManageAccounts, { suggestedArticles } from './manageAccounts.page'; @@ -13,9 +12,6 @@ import ManageAccounts, { suggestedArticles } from './manageAccounts.page'; jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/settings/manageAccounts.page.tsx b/pages/accountLists/[accountListId]/settings/manageAccounts.page.tsx index 3d875d226..1e8de017b 100644 --- a/pages/accountLists/[accountListId]/settings/manageAccounts.page.tsx +++ b/pages/accountLists/[accountListId]/settings/manageAccounts.page.tsx @@ -1,12 +1,11 @@ import { useRouter } from 'next/router'; -import React, { ReactElement, useEffect, useState } from 'react'; +import React, { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { loadSession } from 'pages/api/utils/pagePropsHelpers'; import { ManageAccountAccessAccordion } from 'src/components/Settings/Accounts/ManageAccountAccess/ManageAccountAccessAccordion'; import { MergeAccountsAccordion } from 'src/components/Settings/Accounts/MergeAccounts/MergeAccountsAccordion'; import { MergeSpouseAccountsAccordion } from 'src/components/Settings/Accounts/MergeSpouseAccounts/MergeSpouseAccountsAccordion'; import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/AccordionGroup'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from './Wrapper'; export const suggestedArticles = 'HS_SETTINGS_SERVICES_SUGGESTIONS'; @@ -20,10 +19,6 @@ const ManageAccounts = (): ReactElement => { : 'Manage Account Access', ); - useEffect(() => { - suggestArticles('HS_SETTINGS_SERVICES_SUGGESTIONS'); - }, []); - const handleAccordionChange = (panel: string) => { const panelLowercase = panel.toLowerCase(); setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase); diff --git a/pages/accountLists/[accountListId]/settings/manageCoaches.page.test.tsx b/pages/accountLists/[accountListId]/settings/manageCoaches.page.test.tsx index 9282f2a59..732e23b1f 100644 --- a/pages/accountLists/[accountListId]/settings/manageCoaches.page.test.tsx +++ b/pages/accountLists/[accountListId]/settings/manageCoaches.page.test.tsx @@ -5,17 +5,13 @@ import { SnackbarProvider } from 'notistack'; import { I18nextProvider } from 'react-i18next'; import TestRouter from '__tests__/util/TestRouter'; import { GqlMockedProvider } from '__tests__/util/graphqlMocking'; -import { suggestArticles } from 'src/lib/helpScout'; import i18n from 'src/lib/i18n'; import theme from 'src/theme'; -import ManageCoaching, { suggestedArticles } from './manageCoaches.page'; +import ManageCoaching from './manageCoaches.page'; jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -49,13 +45,6 @@ describe('ManageCoaching', () => { }); }); - it('should fire suggestArticles on initial render', async () => { - render(); - await waitFor(() => - expect(suggestArticles).toHaveBeenCalledWith(suggestedArticles), - ); - }); - it('should open Coaching Access accordion', async () => { const { getAllByText } = render(); await waitFor(() => { diff --git a/pages/accountLists/[accountListId]/settings/manageCoaches.page.tsx b/pages/accountLists/[accountListId]/settings/manageCoaches.page.tsx index 771adf082..f154a57f9 100644 --- a/pages/accountLists/[accountListId]/settings/manageCoaches.page.tsx +++ b/pages/accountLists/[accountListId]/settings/manageCoaches.page.tsx @@ -1,14 +1,11 @@ import { useRouter } from 'next/router'; -import React, { ReactElement, useEffect, useState } from 'react'; +import React, { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { loadSession } from 'pages/api/utils/pagePropsHelpers'; import { ManageCoachesAccessAccordion } from 'src/components/Settings/Coaches/ManageCoachesAccess/ManageCoachesAccessAccordion'; import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/AccordionGroup'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from './Wrapper'; -export const suggestedArticles = 'HS_SETTINGS_SERVICES_SUGGESTIONS'; - const ManageCoaching = (): ReactElement => { const { t } = useTranslation(); const { query } = useRouter(); @@ -18,10 +15,6 @@ const ManageCoaching = (): ReactElement => { : 'Manage Account Coaching Access', ); - useEffect(() => { - suggestArticles(suggestedArticles); - }, []); - const handleAccordionChange = (panel: string) => { const panelLowercase = panel.toLowerCase(); setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase); diff --git a/pages/accountLists/[accountListId]/settings/organizations.page.tsx b/pages/accountLists/[accountListId]/settings/organizations.page.tsx index 4e6877189..da5951b0c 100644 --- a/pages/accountLists/[accountListId]/settings/organizations.page.tsx +++ b/pages/accountLists/[accountListId]/settings/organizations.page.tsx @@ -7,7 +7,6 @@ import { loadSession } from 'pages/api/utils/pagePropsHelpers'; import { ImpersonateUserAccordion } from 'src/components/Settings/Organization/ImpersonateUser/ImpersonateUserAccordion'; import { ManageOrganizationAccessAccordion } from 'src/components/Settings/Organization/ManageOrganizationAccess/ManageOrganizationAccessAccordion'; import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/AccordionGroup'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from './Wrapper'; import { SettingsOrganizationFragment, @@ -61,10 +60,6 @@ const Organizations = (): ReactElement => { setSelectedOrganization(organizations?.[0]); }, [organizations]); - useEffect(() => { - suggestArticles('HS_SETTINGS_SERVICES_SUGGESTIONS'); - }, []); - const handleAccordionChange = (panel: string) => { const panelLowercase = panel.toLowerCase(); setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase); diff --git a/pages/accountLists/[accountListId]/settings/preferences.page.tsx b/pages/accountLists/[accountListId]/settings/preferences.page.tsx index 5e4cd7192..555430342 100644 --- a/pages/accountLists/[accountListId]/settings/preferences.page.tsx +++ b/pages/accountLists/[accountListId]/settings/preferences.page.tsx @@ -33,7 +33,6 @@ import { StickyBox } from 'src/components/Shared/Header/styledComponents'; import { useAccountListId } from 'src/hooks/useAccountListId'; import { useGetTimezones } from 'src/hooks/useGetTimezones'; import { getCountries } from 'src/lib/data/countries'; -import { suggestArticles } from 'src/lib/helpScout'; import { SettingsWrapper } from './Wrapper'; const AccordionLoading = styled(Skeleton)(() => ({ @@ -80,10 +79,6 @@ const Preferences: React.FC = () => { const { data: userOrganizationAccountsData } = useGetUsersOrganizationsAccountsQuery(); - useEffect(() => { - suggestArticles('HS_SETTINGS_PREFERENCES_SUGGESTIONS'); - }, []); - useEffect(() => { if (onSetupTour) { setExpandedPanel(setupAccordions[0]); diff --git a/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx index 6086696b4..1def2309c 100644 --- a/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx @@ -31,7 +31,6 @@ import { useAccountListId } from 'src/hooks/useAccountListId'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import { useMassSelection } from 'src/hooks/useMassSelection'; import useTaskModal from 'src/hooks/useTaskModal'; -import { suggestArticles } from 'src/lib/helpScout'; import { sanitizeFilters } from 'src/lib/sanitizeFilters'; import theme from 'src/theme'; import { @@ -117,10 +116,6 @@ const TasksPage: React.FC = () => { } }, [isReady, contactId]); - useEffect(() => { - suggestArticles('HS_TASKS_SUGGESTIONS'); - }, []); - //#region Filters const urlFilters = query?.filters && JSON.parse(decodeURI(query.filters as string)); diff --git a/pages/accountLists/[accountListId]/tools/appeals/AppealsWrapper.tsx b/pages/accountLists/[accountListId]/tools/appeals/AppealsWrapper.tsx index 4290401e0..df6ef5e93 100644 --- a/pages/accountLists/[accountListId]/tools/appeals/AppealsWrapper.tsx +++ b/pages/accountLists/[accountListId]/tools/appeals/AppealsWrapper.tsx @@ -2,7 +2,6 @@ import { useRouter } from 'next/router'; import React, { useEffect, useMemo, useState } from 'react'; import { AppealsProvider } from 'src/components/Tool/Appeal/AppealsContext/AppealsContext'; import { ContactFilterSetInput } from 'src/graphql/types.generated'; -import { suggestArticles } from 'src/lib/helpScout'; import { sanitizeFilters } from 'src/lib/sanitizeFilters'; interface Props { @@ -39,12 +38,6 @@ export const AppealsWrapper: React.FC = ({ children }) => { const { appealId: appealIdParams, searchTerm, accountListId } = query; useEffect(() => { - // TODO: Fix these suggested Articles - suggestArticles( - appealIdParams - ? 'HS_CONTACTS_CONTACT_SUGGESTIONS' - : 'HS_CONTACTS_SUGGESTIONS', - ); if (appealIdParams === undefined) { push({ pathname: '/accountLists/[accountListId]/tools/appeals', diff --git a/pages/accountLists/[accountListId]/tools/fix/emailAddresses/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/fix/emailAddresses/[[...contactId]].page.test.tsx index 1ea547ae3..896a960d9 100644 --- a/pages/accountLists/[accountListId]/tools/fix/emailAddresses/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/fix/emailAddresses/[[...contactId]].page.test.tsx @@ -19,9 +19,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/tools/fix/mailingAddresses/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/fix/mailingAddresses/[[...contactId]].page.test.tsx index 7a84a17de..931eb9740 100644 --- a/pages/accountLists/[accountListId]/tools/fix/mailingAddresses/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/fix/mailingAddresses/[[...contactId]].page.test.tsx @@ -18,9 +18,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/tools/fix/phoneNumbers/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/fix/phoneNumbers/[[...contactId]].page.test.tsx index 23bae70e9..882fe6958 100644 --- a/pages/accountLists/[accountListId]/tools/fix/phoneNumbers/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/fix/phoneNumbers/[[...contactId]].page.test.tsx @@ -17,9 +17,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/tools/fix/sendNewsletter/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/fix/sendNewsletter/[[...contactId]].page.test.tsx index fc4913e12..ffc891b9b 100644 --- a/pages/accountLists/[accountListId]/tools/fix/sendNewsletter/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/fix/sendNewsletter/[[...contactId]].page.test.tsx @@ -18,9 +18,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/tools/merge/contacts/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/merge/contacts/[[...contactId]].page.test.tsx index 41f9531e4..d82e172d5 100644 --- a/pages/accountLists/[accountListId]/tools/merge/contacts/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/merge/contacts/[[...contactId]].page.test.tsx @@ -17,9 +17,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/accountLists/[accountListId]/tools/merge/people/[[...contactId]].page.test.tsx b/pages/accountLists/[accountListId]/tools/merge/people/[[...contactId]].page.test.tsx index c87f5cfcd..9423a7040 100644 --- a/pages/accountLists/[accountListId]/tools/merge/people/[[...contactId]].page.test.tsx +++ b/pages/accountLists/[accountListId]/tools/merge/people/[[...contactId]].page.test.tsx @@ -17,9 +17,6 @@ jest.mock('next-auth/react'); jest.mock('next/router', () => ({ useRouter: jest.fn(), })); -jest.mock('src/lib/helpScout', () => ({ - suggestArticles: jest.fn(), -})); jest.mock('notistack', () => ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/pages/helpscout.css b/pages/helpscout.css deleted file mode 100644 index 3184cb2a0..000000000 --- a/pages/helpscout.css +++ /dev/null @@ -1,27 +0,0 @@ -.BeaconFabButtonFrame { - right: 70px !important; - bottom: 30px !important; -} - -@media only screen and (max-width: 900px) { - .BeaconFabButtonFrame { - right: 40px !important; - bottom: 25px !important; - } -} - -@media only screen and (max-width: 600px) { - .BeaconFabButtonFrame { - right: 30px !important; - bottom: 30px !important; - } -} - -.BeaconContainer { - right: 20px !important; - bottom: 90px !important; - z-index: 1350 !important; -} -.BeaconFabButtonFrame { - z-index: 1500 !important; -} diff --git a/pages/print.css b/pages/print.css index f9442e4ca..0d5532bd7 100644 --- a/pages/print.css +++ b/pages/print.css @@ -18,8 +18,4 @@ header { display: none !important; } - - #beacon-container { - display: none; - } } diff --git a/src/components/Coaching/CoachingDetail/Activity/Activity.tsx b/src/components/Coaching/CoachingDetail/Activity/Activity.tsx index 7ba454b8c..e0aa9476d 100644 --- a/src/components/Coaching/CoachingDetail/Activity/Activity.tsx +++ b/src/components/Coaching/CoachingDetail/Activity/Activity.tsx @@ -36,7 +36,6 @@ import { } from 'src/lib/intlFormat'; import { MultilineSkeleton } from '../../../Shared/MultilineSkeleton'; import { AccountListTypeEnum, CoachingPeriodEnum } from '../CoachingDetail'; -import { HelpButton } from '../HelpButton'; import { useCoachingDetailActivityQuery } from './Activity.generated'; import { AppealProgress } from './AppealProgress'; @@ -263,7 +262,6 @@ export const Activity: React.FC = ({ - } /> diff --git a/src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx b/src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx index 9c8f5875f..8795736cb 100644 --- a/src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx +++ b/src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx @@ -1,6 +1,5 @@ import { useMemo } from 'react'; import { - Box, CardContent, CardHeader, Divider, @@ -18,7 +17,6 @@ import { useLocale } from 'src/hooks/useLocale'; import { dateFormatWithoutYear } from 'src/lib/intlFormat'; import { MultilineSkeleton } from '../../../Shared/MultilineSkeleton'; import { CoachingPeriodEnum } from '../CoachingDetail'; -import { HelpButton } from '../HelpButton'; import { AlignedTableCell, DividerRow, HeaderRow } from '../StyledComponents'; import { getResultColor } from '../helpers'; import { useActivitySummaryQuery } from './ActivitySummary.generated'; @@ -96,14 +94,7 @@ export const ActivitySummary: React.FC = ({ return ( - - {t('Activity Summary')} - - - } - /> + {loading ? ( diff --git a/src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx b/src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx index de8defa64..5933e3217 100644 --- a/src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx +++ b/src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx @@ -1,6 +1,5 @@ import { useMemo } from 'react'; import { - Box, CardContent, CardHeader, Divider, @@ -18,7 +17,6 @@ import { useLocale } from 'src/hooks/useLocale'; import { currencyFormat, dateFormatWithoutYear } from 'src/lib/intlFormat'; import { MultilineSkeleton } from '../../../Shared/MultilineSkeleton'; import { CoachingPeriodEnum } from '../CoachingDetail'; -import { HelpButton } from '../HelpButton'; import { AlignedTableCell, DividerRow, HeaderRow } from '../StyledComponents'; import { getResultColor } from '../helpers'; import { useAppointmentResultsQuery } from './AppointmentResults.generated'; @@ -79,14 +77,7 @@ export const AppointmentResults: React.FC = ({ return ( - - {t('Appointments and Results')} - - - } - /> + {loading ? ( diff --git a/src/components/Coaching/CoachingDetail/HelpButton.test.tsx b/src/components/Coaching/CoachingDetail/HelpButton.test.tsx deleted file mode 100644 index 0b50f1def..000000000 --- a/src/components/Coaching/CoachingDetail/HelpButton.test.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { render } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { showArticle } from 'src/lib/helpScout'; -import { HelpButton } from './HelpButton'; - -jest.mock('src/lib/helpScout'); - -describe('help button', () => { - it('opens the HelpScout article', () => { - const { getByRole } = render( - , - ); - - userEvent.click(getByRole('button', { name: 'Help' })); - expect(showArticle).toHaveBeenCalled(); - }); -}); diff --git a/src/components/Coaching/CoachingDetail/HelpButton.tsx b/src/components/Coaching/CoachingDetail/HelpButton.tsx deleted file mode 100644 index e84d23561..000000000 --- a/src/components/Coaching/CoachingDetail/HelpButton.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import QuestionMark from '@mui/icons-material/QuestionMark'; -import { IconButton } from '@mui/material'; -import { ArticleVar, showArticle } from 'src/lib/helpScout'; - -interface HelpButtonProps { - articleVar: ArticleVar; -} - -export const HelpButton: React.FC = ({ articleVar }) => ( - showArticle(articleVar)} - aria-label="Help" - > - - -); diff --git a/src/components/Helpscout/HelpscoutBeacon.test.tsx b/src/components/Helpscout/HelpscoutBeacon.test.tsx deleted file mode 100644 index 45ff67e08..000000000 --- a/src/components/Helpscout/HelpscoutBeacon.test.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { render, waitFor } from '@testing-library/react'; -import { GqlMockedProvider } from '__tests__/util/graphqlMocking'; -import { identifyUser } from 'src/lib/helpScout'; -import { GetUserQuery } from '../User/GetUser.generated'; -import HelpscoutBeacon from './HelpscoutBeacon'; - -jest.mock('src/lib/helpScout', () => ({ - callBeacon: jest.fn(), - destroy: jest.fn(), - initBeacon: jest.fn(), - identifyUser: jest.fn(), -})); - -describe('HelpscoutBeacon', () => { - it('identifies the current user', async () => { - render( - - mocks={{ - GetUser: { - user: { - id: 'user-1', - firstName: 'First', - lastName: 'Last', - keyAccounts: [ - { - email: 'first.last@cru.org', - }, - ], - }, - }, - }} - > - - , - ); - - await waitFor(() => - expect(identifyUser).toHaveBeenCalledWith( - 'user-1', - 'first.last@cru.org', - 'First Last', - ), - ); - }); -}); diff --git a/src/components/Helpscout/HelpscoutBeacon.tsx b/src/components/Helpscout/HelpscoutBeacon.tsx deleted file mode 100644 index b57794c81..000000000 --- a/src/components/Helpscout/HelpscoutBeacon.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import Script from 'next/script'; -import { useEffect } from 'react'; -import { useSession } from 'next-auth/react'; -import { callBeacon, identifyUser, initBeacon } from 'src/lib/helpScout'; - -const HelpscoutBeacon: React.FC = () => { - const { data: session } = useSession(); - - useEffect(() => { - initBeacon(); - - return () => { - callBeacon('destroy'); - }; - }, []); - - const user = session?.user; - useEffect(() => { - if (user) { - identifyUser(user.userID, user.email, user.name); - } - }, [user]); - - return + )} + {process.env.HELPJUICE_ORIGIN && ( + +window.helpjuiceSwiftyUrlMap = {};`, + }} + /> )} {process.env.HELPJUICE_ORIGIN && ( -