From ff3eed697cc028ca13e9b15a8e6f02375e8cf21f Mon Sep 17 00:00:00 2001 From: S T Date: Sat, 1 Jun 2024 00:53:06 -0700 Subject: [PATCH] content(Complete User Profile): Updated the language, commented out button (#598) closes #597 ## Note ### Tasks - Complete your user profile (associated financial institutions) - [x] Update small text in introduction to include link to email support staff and new URL for GLEIF. It would be best to swap in the whole block. ### Tasks - Complete your user profile (no associated financial institutions) - [x] Update small text in introduction to include link to email support staff and new URL for GLEIF. It would be best to swap in the whole block. - [x] Update body text under "Provide your financial institution details" to reference emailing support staff instead of "Add an additional financial institution" button/link. - [x] Change name of link/button to "Add an additional financial institution" - [x] Comment out "Add an additional financial institution" button/link - [x] For error alert links, remove numbering from "financial institution name" and "LEI" because there will only be one for MVP. You can comment out the numbering in code so that we can bring it back when we reveal the button/link post-MVP. - [x] Update text on error alert for "Your email domain" is not authorized (pre-clearance change). - [x] Add a breadcrumb to the warning alert notification screen that takes a user back to "Platform home" (un-authenticated). ## Notable Changes - content(Complete User Profile): Updated the language, commented out button - feat(complete user profile): toggle showing key index per error -- currently disabled - enhancement(Summary): breadcrumb is **standard** for all summaries -- if authenticated, routes to `/landing` otherwise `/` ## How to Test - Compare with the figma - Go through the two task lists above and verify each are correct; especially, last task. ## Screenshot - Normal Screenshot 2024-05-29 at 12 28 38 PM ## Screenshot - With Errors Screenshot 2024-05-29 at 12 28 47 PM ## Screenshot - Error Summary with breadcrumb Screenshot 2024-05-29 at 6 13 26 PM ## Screenshot - Warning Summary with breadcrumb Screenshot 2024-05-29 at 6 28 03 PM ## References https://github.com/cfpb/sbl-frontend/issues/578 --- src/components/FormErrorHeader.tsx | 8 +++++- .../AddFinancialInstitution.tsx | 8 +++++- .../ProfileForm/CreateProfileForm/index.tsx | 20 ++++++++++----- .../ProfileForm/Step1Form/Step1FormHeader.tsx | 21 ++++++++++++---- src/pages/Summary/Summary.data.tsx | 12 +++++++-- src/pages/Summary/Summary.tsx | 25 ++++++++++--------- 6 files changed, 67 insertions(+), 27 deletions(-) diff --git a/src/components/FormErrorHeader.tsx b/src/components/FormErrorHeader.tsx index bf41c1af0..449eb1069 100644 --- a/src/components/FormErrorHeader.tsx +++ b/src/components/FormErrorHeader.tsx @@ -2,6 +2,7 @@ import { Alert, List, ListItem } from 'design-system-react'; import type { PropsWithChildren } from 'react'; import type { FieldErrors, FieldValues } from 'react-hook-form'; import { Element, Link } from 'react-scroll'; +import { One } from 'utils/constants'; import getAllProperties from 'utils/getAllProperties'; import type { FormErrorKeyType } from 'utils/getFormErrorKeyLogic'; @@ -15,6 +16,7 @@ interface FormErrorHeaderProperties< errors?: FieldErrors; alertHeading?: string; formErrorHeaderObject: T; + showKeyIndexNumber?: boolean; } /** @@ -30,6 +32,7 @@ function FormErrorHeader< id, keyLogicFunc, formErrorHeaderObject, + showKeyIndexNumber, }: PropsWithChildren>): JSX.Element | null { if (!errors || Object.keys(errors).length === 0) return null; @@ -100,7 +103,9 @@ function FormErrorHeader< : 'Missing entry' }${ // eslint-disable-next-line @typescript-eslint/no-magic-numbers - typeof keyIndex === 'number' ? ` (${keyIndex + 1})` : '' + showKeyIndexNumber && typeof keyIndex === 'number' + ? ` (${keyIndex + One})` + : '' }`} @@ -116,6 +121,7 @@ function FormErrorHeader< FormErrorHeader.defaultProps = { alertHeading: 'There was a problem completing your user profile', errors: null, + showKeyIndexNumber: false, }; export default FormErrorHeader; diff --git a/src/pages/ProfileForm/CreateProfileForm/AddFinancialInstitution.tsx b/src/pages/ProfileForm/CreateProfileForm/AddFinancialInstitution.tsx index 03e07f733..ce12aeaad 100644 --- a/src/pages/ProfileForm/CreateProfileForm/AddFinancialInstitution.tsx +++ b/src/pages/ProfileForm/CreateProfileForm/AddFinancialInstitution.tsx @@ -9,15 +9,17 @@ interface AddFinancialInstitutionProperties { index: number; register: UseFormRegister; formErrors: FieldErrors; + isLast?: boolean; } function AddFinancialInstitution({ index, register, formErrors, + isLast, }: AddFinancialInstitutionProperties): JSX.Element { return ( -
+
@@ -123,11 +127,12 @@ function CreateProfileForm(): JSX.Element { Provide the name and LEI of the financial institution for which you are authorized to file. If you are authorized to file for an - additional financial institution, click “Add a financial - institution.” + additional financial institution,{' '} + email our support staff. {fields.map((field, index) => { const onRemoveThisInstitution = (): void => remove(index); + const isLast = fields.length - One === index; return (
{index !== 0 && ( @@ -141,15 +146,18 @@ function CreateProfileForm(): JSX.Element { index={index} register={register} formErrors={formErrors} + isLast={isLast} />
); })} -
+ {/* TODO: Re-enable button post-mvp */} + {/* https://github.com/cfpb/sbl-frontend/issues/596 */} + {/*
- Add a financial institution + Add an additional financial institution -
+
*/}