From d09fa699e7de8f0a330acd82e30216b85fc5d0cd Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Thu, 24 Oct 2024 09:08:15 -0700 Subject: [PATCH 1/4] Replace hardcoded help link --- pages/login.page.test.tsx | 5 ++++- pages/login.page.tsx | 6 +++++- src/components/Welcome/Welcome.stories.tsx | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pages/login.page.test.tsx b/pages/login.page.test.tsx index b66a9ec1b..b2abddf0c 100644 --- a/pages/login.page.test.tsx +++ b/pages/login.page.test.tsx @@ -176,7 +176,10 @@ describe('Login - OKTA', () => { name: /find help/i, }); await waitFor(() => { - expect(findHelpLink).toHaveAttribute('href', 'https://help.mpdx.org'); + expect(findHelpLink).toHaveAttribute( + 'href', + process.env.HELPJUICE_KNOWLEDGE_BASE_URL, + ); }); }); }); diff --git a/pages/login.page.tsx b/pages/login.page.tsx index 2bb3274d4..dfbd9796b 100644 --- a/pages/login.page.tsx +++ b/pages/login.page.tsx @@ -67,7 +67,11 @@ const Login = ({ - + {(process.env.HELPJUICE_KNOWLEDGE_BASE_URL || + process.env.HELPJUICE_ORIGIN) && ( + + )} {isOkta && ( From a5c8610047138ed9a173f6274aaa06f07614ee4f Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Thu, 24 Oct 2024 11:16:02 -0700 Subject: [PATCH 3/4] Fix test --- .../Contacts/ContactsLeftPanel/ContactsLeftPanel.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Contacts/ContactsLeftPanel/ContactsLeftPanel.test.tsx b/src/components/Contacts/ContactsLeftPanel/ContactsLeftPanel.test.tsx index 542382ff2..7e754f092 100644 --- a/src/components/Contacts/ContactsLeftPanel/ContactsLeftPanel.test.tsx +++ b/src/components/Contacts/ContactsLeftPanel/ContactsLeftPanel.test.tsx @@ -9,6 +9,7 @@ import { ContactsContext, ContactsType, } from 'src/components/Contacts/ContactsContext/ContactsContext'; +import { StatusEnum } from 'src/graphql/types.generated'; import { UserOptionQuery } from 'src/hooks/UserPreference.generated'; import theme from 'src/theme'; import { ContactsLeftPanel } from './ContactsLeftPanel'; @@ -44,6 +45,7 @@ const mocks = { nodes: [ { name: 'Contact 1', + status: StatusEnum.PartnerFinancial, primaryAddress: { geo: '10,20', }, From 57bdd07b651b987e0ea829ca2ebb952f9918f4a4 Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Thu, 24 Oct 2024 11:23:12 -0700 Subject: [PATCH 4/4] Add variable for helpUrl --- pages/login.page.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pages/login.page.tsx b/pages/login.page.tsx index ea48b9105..4fa97213c 100644 --- a/pages/login.page.tsx +++ b/pages/login.page.tsx @@ -37,6 +37,9 @@ const Login = ({ } }, []); + const helpUrl = + process.env.HELPJUICE_KNOWLEDGE_BASE_URL || process.env.HELPJUICE_ORIGIN; + return ( <> @@ -64,16 +67,11 @@ const Login = ({ > {signInButtonText} - {(process.env.HELPJUICE_KNOWLEDGE_BASE_URL || - process.env.HELPJUICE_ORIGIN) && ( + {helpUrl && (