Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

meissadia
Copy link
Collaborator

@meissadia meissadia commented Nov 18, 2024

Closes #1053

Sorry, this turned into a stir fry with lots of language updates mixed in.

Changes

  • [Sign and Submit] Display missing LEI, TIN, or Type of FI as errors
  • task: Address linting errors associated with empty Institution data when API calls fail
  • fix: Language updates which have been verified by Natalia here
  • fix: More language updates which have been verified by Natalia here

Screenshots

  • [Sign and Submit] Display missing LEI, TIN, or Type of FI as errors
    • screencapture-localhost-8899-filing-2024-123456789TESTBANK123-submit-2024-11-18-11_43_49

Copy link

@natalia-fitzgerald natalia-fitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment on lines +53 to 78
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]}
/>
Copy link
Collaborator Author

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'
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sign & Submit] Verify alerts for missing Institution info
2 participants