From b26f44c7d3d42ccfa1a75d8700a5a82b1f1ae907 Mon Sep 17 00:00:00 2001 From: Kevin Foong Date: Tue, 25 Jun 2024 15:36:44 +0800 Subject: [PATCH 1/3] chore: replace outdated esrv id link --- .../AuthSettingsSection/EsrvcIdBox.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx index 36309201b8..4d080b8604 100644 --- a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx +++ b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx @@ -15,6 +15,7 @@ import { FormAuthType, FormSettings } from '~shared/types/form' import FormErrorMessage from '~components/FormControl/FormErrorMessage' import Input from '~components/Input' +import Link from '~components/Link' import Spinner from '~components/Spinner' import { useMutateFormSettings } from '../../mutations' @@ -65,9 +66,17 @@ export const EsrvcIdBox = ({ case FormAuthType.SP: case FormAuthType.CP: case FormAuthType.MyInfo: - return 'Contact askNDI@tech.gov.sg for your e-service ID' + return ( + + Contact{' '} + + Singpass partner support + {' '} + for your e-Service ID + + ) default: - return '' + return null } }, [settings.authType]) @@ -81,9 +90,7 @@ export const EsrvcIdBox = ({ return (
- - {renderedHelperText} - + {renderedHelperText} e-service ID: From 10b037d707f096591ebbd1bdaba90ecc9da7175f Mon Sep 17 00:00:00 2001 From: Kevin Foong Date: Tue, 25 Jun 2024 16:45:24 +0800 Subject: [PATCH 2/3] fix: remove memo from low cost component --- .../settings/components/AuthSettingsSection/EsrvcIdBox.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx index 4d080b8604..5eda59345d 100644 --- a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx +++ b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx @@ -61,7 +61,7 @@ export const EsrvcIdBox = ({ return errors.esrvcId ? reset() : onSubmit() }, [errors, onSubmit, reset]) - const renderedHelperText = useMemo(() => { + const renderHelperTextComponent = () => { switch (settings.authType) { case FormAuthType.SP: case FormAuthType.CP: @@ -78,7 +78,7 @@ export const EsrvcIdBox = ({ default: return null } - }, [settings.authType]) + } const placeHolder = useMemo( () => @@ -90,7 +90,7 @@ export const EsrvcIdBox = ({ return ( - {renderedHelperText} + {renderHelperTextComponent()} e-service ID: From b549278906a6960879066760c574340119cc7832 Mon Sep 17 00:00:00 2001 From: Kevin Foong Date: Wed, 26 Jun 2024 16:05:10 +0800 Subject: [PATCH 3/3] fix: move link to constants file, move out helper text as own component --- .../AuthSettingsSection/EsrvcHelperText.tsx | 31 +++++++++++++++++++ .../AuthSettingsSection/EsrvcIdBox.tsx | 25 ++------------- shared/constants/links.ts | 2 ++ 3 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcHelperText.tsx diff --git a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcHelperText.tsx b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcHelperText.tsx new file mode 100644 index 0000000000..d76f176e5b --- /dev/null +++ b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcHelperText.tsx @@ -0,0 +1,31 @@ +import { Text } from '@chakra-ui/react' + +import { SINGPASS_PARTNER_SUPPORT_LINK } from '~shared/constants/links' +import { FormAuthType } from '~shared/types/form' + +import Link from '~components/Link' + +interface EsrvcHelperTextProps { + authType: FormAuthType +} + +export const EsrvcHelperText = ({ + authType, +}: EsrvcHelperTextProps): JSX.Element => { + switch (authType) { + case FormAuthType.SP: + case FormAuthType.CP: + case FormAuthType.MyInfo: + return ( + + Contact{' '} + + Singpass partner support + {' '} + for your e-Service ID + + ) + default: + return <> + } +} diff --git a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx index 5eda59345d..9d0bdb565e 100644 --- a/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx +++ b/frontend/src/features/admin-form/settings/components/AuthSettingsSection/EsrvcIdBox.tsx @@ -7,7 +7,6 @@ import { InputGroup, InputRightElement, Stack, - Text, VisuallyHidden, } from '@chakra-ui/react' @@ -15,11 +14,12 @@ import { FormAuthType, FormSettings } from '~shared/types/form' import FormErrorMessage from '~components/FormControl/FormErrorMessage' import Input from '~components/Input' -import Link from '~components/Link' import Spinner from '~components/Spinner' import { useMutateFormSettings } from '../../mutations' +import { EsrvcHelperText } from './EsrvcHelperText' + interface EsrvcIdBoxProps { settings: FormSettings isDisabled: boolean @@ -61,25 +61,6 @@ export const EsrvcIdBox = ({ return errors.esrvcId ? reset() : onSubmit() }, [errors, onSubmit, reset]) - const renderHelperTextComponent = () => { - switch (settings.authType) { - case FormAuthType.SP: - case FormAuthType.CP: - case FormAuthType.MyInfo: - return ( - - Contact{' '} - - Singpass partner support - {' '} - for your e-Service ID - - ) - default: - return null - } - } - const placeHolder = useMemo( () => `Enter ${ @@ -90,7 +71,7 @@ export const EsrvcIdBox = ({ return ( - {renderHelperTextComponent()} + e-service ID: diff --git a/shared/constants/links.ts b/shared/constants/links.ts index 2bf18b30f8..568100f2d7 100644 --- a/shared/constants/links.ts +++ b/shared/constants/links.ts @@ -2,5 +2,7 @@ export const SUPPORT_FORM_LINK = 'https://go.gov.sg/formsg-support' export const PUBLIC_PAYMENTS_GUIDE_LINK = 'https://go.gov.sg/formsg-guide-payments' +export const SINGPASS_PARTNER_SUPPORT_LINK = + 'https://go.gov.sg/formsg-singpass-contact' export const SGID_VALID_ORG_PAGE = 'https://docs.id.gov.sg/faq-users#as-a-government-officer-why-am-i-not-able-to-login-to-my-work-tool-using-sgid'