-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task: [Sign & Submit] Display field-level alerts as Errors instead of Warnings #1066
base: main
Are you sure you want to change the base?
Conversation
… intro paragraph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
alertStatus?: AlertFieldLevelType; | ||
} | ||
|
||
export function DisplayField({ | ||
label, | ||
value, | ||
className, | ||
fallbackValue, | ||
alertStatus, | ||
}: DisplayFieldProperties): JSX.Element { | ||
const resultingValue = value ?? fallbackValue; | ||
const showAlert = [LAPSED, NOT_PROVIDED].includes(resultingValue as string); | ||
|
||
return ( | ||
<div className={classNames('display-field', className)}> | ||
{label ? ( | ||
<Heading className='h4 break-all' type='3'> | ||
<Heading className='h4' type='3'> | ||
{label} | ||
</Heading> | ||
) : undefined} | ||
<p className='u-mt10 break-all'>{resultingValue}</p> | ||
<p className='u-mt10'>{resultingValue}</p> | ||
<AlertFieldLevel | ||
status='warning' | ||
status={alertStatus} | ||
isVisible={showAlert} | ||
message={NotProvidedAlertMessage[label as string]} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow field-level alerts to be displayed as either error
or warning
@@ -194,6 +195,7 @@ export function FilingSubmit(): JSX.Element { | |||
heading='Confirm your financial institution identifying information' | |||
data={institution} | |||
description={getDescriptionForSignAndSubmitSection()} | |||
alertStatus='error' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show Sign and Submit
page alerts as "errors"
isError: boolean; | ||
}): JSXElement { | ||
const { lei } = useParams(); | ||
const isRoutingEnabled = getIsRoutingEnabled(); | ||
const navigate = useNavigate(); | ||
|
||
const dataIsMissing = isError || !data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these checks for !data
are to appease the linter
Closes #1053
Sorry, this turned into a stir fry with lots of language updates mixed in.
Changes
data
when API calls failScreenshots