Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e16f5fa
content: Updated Step2 denied domain error message
shindigira Jan 12, 2024
41c8a69
content: updated content text regarding input field description text
shindigira Jan 12, 2024
4fe05cd
style: accesibility changed to entirely around FI group
shindigira Jan 17, 2024
5b786c9
style: removed interferring styles
shindigira Jan 17, 2024
cda6a6a
fix: trim leading and trailing white space
shindigira Jan 17, 2024
077ff53
chore: set default string empty
shindigira Jan 17, 2024
c07cc4b
chore: created a SectionIntro
shindigira Jan 17, 2024
864db06
chore: reformatted SectionIntro
shindigira Jan 17, 2024
10f64ca
Merge branch 'main' of github.com:cfpb/sbl-frontend into 85-part-2
shindigira Jan 18, 2024
98213e7
chore: defensive coding
shindigira Jan 18, 2024
42f238e
chore: removed unused code
shindigira Jan 18, 2024
f60e46b
style: added href to allow cursor:pointer on error links
shindigira Jan 19, 2024
4bf7005
chore: added eslint ignore exception
shindigira Jan 19, 2024
04a86a8
style: temp red border usage around checkbox
shindigira Jan 19, 2024
de6ec46
chore: revert step1formerrorheader messages
shindigira Jan 22, 2024
7b6e206
Merge branch 'main' of github.com:cfpb/sbl-frontend into 85-part-2
shindigira Jan 24, 2024
e447867
feat: Updated DSR with Checkbox status stylings
shindigira Jan 24, 2024
201a18b
Merge branch 'main' of github.com:cfpb/sbl-frontend into 85-part-2
shindigira Jan 25, 2024
97f5545
fix: Clear Form no longer unmounts Associated Financial Data
shindigira Jan 26, 2024
b462a63
chore: removed comment
shindigira Jan 26, 2024
6694cb7
style(fix): added -15px negative margin -- 45px below TextIntroduction
shindigira Jan 26, 2024
ce661c0
Revert "style(fix): added -15px negative margin -- 45px below TextInt…
shindigira Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/components/FieldGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
interface FieldGroupProperties {
children: ReactNode
children: ReactNode;
}

function FieldGroup({ children }: FieldGroupProperties): JSX.Element {
return (
<div
className="bg-[#F7F8F9] p-[1.875rem] !border !border-solid !border-cfpbBorderColor"
>
{children}
</div>
)
<div className='max-w-[48.125rem] !border !border-solid !border-cfpbBorderColor bg-[#F7F8F9] p-[1.875rem]'>
{children}
</div>
);
}

export default FieldGroup;
export default FieldGroup;
15 changes: 7 additions & 8 deletions src/components/FormParagraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ interface FormParagraphProperties {
}

/**
*
*
* @returns FormParagraph
*/
function FormParagraph({ children, className}: FormParagraphProperties): JSX.Element {
return (
<p className={`max-w-[41.875rem] ${className}`}>
{children}
</p>
)
function FormParagraph({
children,
className = '',
}: FormParagraphProperties): JSX.Element {
return <p className={`max-w-[41.875rem] ${className}`}>{children}</p>;
}

export default FormParagraph;
export default FormParagraph;
21 changes: 21 additions & 0 deletions src/components/SectionIntro.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Heading } from 'design-system-react';
import FormParagraph from 'components/FormParagraph';

interface SectionIntroProperties {
heading: ReactNode;
children: ReactNode;
}

function SectionIntro({
heading = '',
children = '',
}: SectionIntroProperties): JSX.Element {
return (
<div className='mb-[1.625rem] max-w-[48.125rem]'>
<Heading type='2'>{heading}</Heading>
<FormParagraph>{children}</FormParagraph>
</div>
);
}

export default SectionIntro;
14 changes: 1 addition & 13 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ https://v1.tailwindcss.com/docs/adding-base-styles#using-css */
}
}

[type='text']:focus {
box-shadow: none;
}

:focus:not(#financialInstitutions) {
outline: 1px dotted #0072ce !important;
outline-offset: 3px;
}
/* TODO: Incorporate this in the DSR to match the TextInput dotted bordering based on state */

/* Checkbox Border error styling - workaround */
.m-form-field__checkbox.error-checkbox .a-label::before, .m-form-field__radio .a-label::before {
@apply !border-errorColor !border-2
}

/* Workaround for styling the institution details on Profile-Form */
.m-form-field__checkbox .invisible::before {
visibility: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,8 @@ function AssociatedFinancialInstitution({
id={`${fiObject.name} ${fiObject.lei}`}
className={`${hasError ? 'error-checkbox' : ''}`}
label={
<div className=''>
<Paragraph className='font-medium'>{fiObject.name}</Paragraph>
</div>
}
checked={fiObject.checked}
name={fiObject.lei}
onChange={onCheckHandler}
{...rest}
/>
<Checkbox
id={`${fiObject.name} ${fiObject.lei}`}
labelClassName='invisible'
label={
<div className='visible'>
<div>
<Paragraph className='mb-0 font-medium'>{fiObject.name}</Paragraph>
<Paragraph className='mb-0'>LEI: {fiObject.lei}</Paragraph>
<Paragraph className='mb-0'>TIN: {fiObject.tax_id}</Paragraph>
{fiObject.rssd_id ? (
Expand All @@ -50,6 +38,10 @@ function AssociatedFinancialInstitution({
) : null}
</div>
}
checked={fiObject.checked}
name={fiObject.lei}
onChange={onCheckHandler}
{...rest}
/>
</div>
);
Expand Down
31 changes: 12 additions & 19 deletions src/pages/ProfileForm/Step1Form/Step1Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import AssociatedFinancialInstitutions from './AssociatedFinancialInstitutions';
import NoDatabaseResultError from './NoDatabaseResultError';
import FormParagraph from 'components/FormParagraph';
import FieldGroup from 'components/FieldGroup';
import SectionIntro from 'components/SectionIntro';

import { Button, Link, Paragraph, Heading } from 'design-system-react';

Expand Down Expand Up @@ -188,19 +189,16 @@ function Step1Form(): JSX.Element {
<div className='mb-[3.75rem] mt-[2.84375rem]'>
<Step1FormHeader />
</div>
<div className='mb-[1.875rem] mt-[2.8125rem] w-full'>
<div className='mb-[2.8125rem] mt-[2.8125rem] w-full'>
<Element name='step1FormErrorHeader' id='step1FormErrorHeader'>
<Step1FormErrorHeader errors={formErrors} />
</Element>
</div>
<div className='mb-[1.625rem] mt-[2.8125rem]'>
<Heading type='2'>Provide your identifying information</Heading>
<FormParagraph>
Type your first name and last name in the fields below. Your email
address is automatically populated from{' '}
<Link href='#'>Login.gov</Link>.
</FormParagraph>
</div>
<SectionIntro heading='Provide your identifying information'>
{' '}
Type your first name and last name in the fields below. Your email
address is automatically populated from <Link href='#'>Login.gov</Link>.
</SectionIntro>
<form onSubmit={handleSubmit(onSubmit)}>
<div className='mb-[3.75rem]'>
<FieldGroup>
Expand Down Expand Up @@ -237,16 +235,11 @@ function Step1Form(): JSX.Element {
<Element name='financialInstitutions'>
{isSalesforce ? null : (
<>
<div className='mb-[1.625rem]'>
<Heading type='2'>
Select the institution you are authorized to file for
</Heading>
<FormParagraph>
If there is a match between your email domain and the email
domain of a financial institution in our system you will see a
list of matches below.
</FormParagraph>
</div>
<SectionIntro heading='Select the institution you are authorized to file for'>
If there is a match between your email domain and the email
domain of a financial institution in our system you will see a
list of matches below.
</SectionIntro>
<FieldGroup>
<AssociatedFinancialInstitutions
errors={formErrors}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/ProfileForm/Step2Form/Step2FormHeader.data.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Link } from 'design-system-react';

export enum ScenarioHeader {
Error = 'Unable to complete your user profile',
Status = 'User profile submission status',
}

export enum Scenario {
// Success1,
// Warning1,
Expand Down
40 changes: 25 additions & 15 deletions src/pages/ProfileForm/Step2Form/Step2FormHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
import { Alert } from 'design-system-react';
import { Step2FormHeaderMessages, Scenario } from './Step2FormHeader.data';
import {
Step2FormHeaderMessages,
Scenario,
ScenarioHeader,
} from './Step2FormHeader.data';

interface Step2FormHeaderProperties {
scenario: Scenario
scenario: Scenario;
}

/**
*
*
* @returns Header for Step2Form
*/
function Step2FormHeader({ scenario = Scenario.Success1A }: Step2FormHeaderProperties): JSX.Element {
function Step2FormHeader({
scenario = Scenario.Error1,
}: Step2FormHeaderProperties): JSX.Element {
return (
<div id="Step2FormHeader" className="max-w-[670px] mb-[45px]">
<h1 className="mb-[30px]">{Step2FormHeaderMessages[scenario].type === "error" ? "Unable to complete registration" : "User profile submission status"}</h1>
<Alert
message={Step2FormHeaderMessages[scenario].message}
status={Step2FormHeaderMessages[scenario].type}
>
{Step2FormHeaderMessages[scenario].children}
</Alert>
</div>
)
<div id='Step2FormHeader' className='mb-[2.8125rem] max-w-[41.875rem]'>
<h1 className='mb-[1.875rem]'>
{Step2FormHeaderMessages[scenario].type === 'error'
? ScenarioHeader.Error
: ScenarioHeader.Status}
</h1>
<Alert
message={Step2FormHeaderMessages[scenario].message}
status={Step2FormHeaderMessages[scenario].type}
>
{Step2FormHeaderMessages[scenario].children}
</Alert>
</div>
);
}

export default Step2FormHeader;
export default Step2FormHeader;
9 changes: 5 additions & 4 deletions src/pages/ProfileForm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,17 @@ export type InstitutionDetailsApiCheckedType = CheckedState &
InstitutionDetailsApiType;

export const validationSchema = z.object({
firstName: z.string().min(1, {
firstName: z.string().trim().min(1, {
message:
'You must enter your first name to complete your user profile and access the system.',
'You must enter your first name to complete your user profile and access the platform.',
}),
lastName: z.string().min(1, {
lastName: z.string().trim().min(1, {
message:
'You must enter your last name to complete your user profile and access the system.',
'You must enter your last name to complete your user profile and access the platform.',
}),
email: z
.string()
.trim()
.min(5, { message: 'You must have a valid email address' })
.email({
message: 'You must have a valid email address and in the correct format.',
Expand Down