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

[User Profile] - Layout View - Initial User Profile Form, Frontend Validation Schema #27

Merged
merged 27 commits into from
Aug 24, 2023

Conversation

shindigira
Copy link
Contributor

@shindigira shindigira commented Aug 17, 2023

Closes #26
Closes #28

Changes

  • [feat] Created a link to the Profile Form
  • [feat] Created a route to the Profile Form
  • [feat] Started a Profile Form Component
  • [chore] Added react-hook-form, zod and @hookform/resolvers
  • [style] Started initial form look
  • [chore] form update with available fields
  • [chore] Started a store folder for hooks
  • [style] Utilized the CFPB style for the User Profile form buttons
  • [feat] First Name and Last Name implemented on the User Profile
  • [feat] User Profile email becomes auto-populated with the logged-in user email
  • [feat] Added zustand and immer for state management
  • [chore] Renamed the initial User Profile form as a Step1Form
  • [chore] Utilized User Profile state management via Zustand
  • [chore] Added 'login.gov' notice to email field
  • [feat] Added red borders on fields failing the validation
  • [feat] Added mock associated financial data for the validation schema
  • [chore] Created the InputEntry component
  • [chore] Created the ProfileForm.data.ts to place data and mock data
  • [feat] Added react-select and @types/react-select packages
  • [feat] Included all the initial validation schema fields
  • [feat] Included error messages for associated financial data
  • [chore] Included the svgr plugin to be able to import svg files

Changes:
- [feat] Created a link to the Profile Form
- [feat] Created a route to the Profile Form
- [feat] Started a Profile Form Component
Changes:
- [chore] Added `react-hook-form`, `zod` and `@hookform/resolvers`
- [style] Started initial form look
Changes:
- [chore] form update with available fields
Changes:
- [chore] Started a `store` folder for hooks
- [style] Utilized the CFPB style for the User Profile form buttons
- [feat] First Name and Last Name implemented on the User Profile
Changes:
- [feat]: Added `zustand` and `immer` for state management
- [chore]: Renamed the initial User Profile form as a Step1Form
- [chore]: Utilized User Profile state management via Zustand
Changes:

- [chore]: Created the `InputEntry` component
- [chore]: Created the `ProfileForm.data.ts` to place data and mock data
- [feat]: Added `react-select` and `@types/react-select` packages
Changes:
- [feat] Included all the initial validation schema fields
- [feat] Included error messages for associated financial data
- [chore] Included the `svgr` plugin to be able to import svg files
@shindigira shindigira changed the title [WIP] [User Profile] - Layout View - Initial User Profile Form [User Profile] - Layout View - Initial User Profile Form Aug 19, 2023
Changes:
- [chore] added error and disabled color class in the tailwind config
- [chore] added the correct error icon
@shindigira shindigira changed the title [User Profile] - Layout View - Initial User Profile Form [User Profile] - Layout View - Initial User Profile Form, Frontend Validation Schema Aug 22, 2023
Copy link
Collaborator

@meissadia meissadia left a comment

Choose a reason for hiding this comment

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

  • This text feels a bit vertically cramped, could we increase the line height? Font also seems a bit smaller than the mockup.
Screenshot 2023-08-22 at 1 38 28 PM

  • I see this error box in the mockup but not in the UI when I hit submit
    Screenshot 2023-08-22 at 1 40 49 PM

src/App.tsx Outdated Show resolved Hide resolved
src/pages/ProfileForm/Step1Form.tsx Outdated Show resolved Hide resolved
lastName: "",
email: email ?? "",
financialInstitutions: [],
// fiData: fiData ?? []
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// fiData: fiData ?? []

Comment on lines +94 to +99
const onSubmit: SubmitHandler<ValidationSchema> = (data) => {
console.log('data:', data);
}

console.log('errors:', errors)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing there is no API endpoint for this data yet? This PR is just the UI?

Suggested change
const onSubmit: SubmitHandler<ValidationSchema> = (data) => {
console.log('data:', data);
}
console.log('errors:', errors)
const onSubmit: SubmitHandler<ValidationSchema> = (data) => {
console.log('data:', data);
}
console.log('errors:', errors)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@meissadia Not wired to a backend yet. Will mock some API calls soon.

src/pages/ProfileForm/Step1Form.tsx Outdated Show resolved Hide resolved
Comment on lines +179 to +180
// console.log("getValues:", getValues())
// console.log('onclick errors', errors);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// console.log("getValues:", getValues())
// console.log('onclick errors', errors);

src/pages/ProfileForm/Step1FormHeader.tsx Outdated Show resolved Hide resolved
{/* <h1>Complete your user profile</h1>
<p className="lead-paragraph">In order to complete your user profile and access the filing platform your financial institution must have a Legal Entity Identifier (LEI). Visit the Global LEI Foundation (GLEIF) website for information on how to obtain an LEI for your institution.</p> */}
<h1 className="text-[26px] md:text-[30px] font-semibold leading-tight mb-[0.44117647em]">Complete your user profile</h1>
<p className="text-[18px] md:text-[20px] font-normal leading-tight mb-[30px]">In order to complete your user profile and access the filing platform your financial institution must have a Legal Entity Identifier (LEI). Visit the Global LEI Foundation (GLEIF) website for information on how to obtain an LEI for your institution.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unintended duplicate paragraphs indicating user must have an LEI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

Comment on lines +110 to +112
<div className="ml-5 mr-5">
<div className="max-w-[1200px] mx-auto mb-12">
<div className="max-w-[770px] mx-auto">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it too early to turn these Tailwinded wrappers into reusable Form components? i.e. Do you think these styles would be used in other Steps and we could abstract this into a <FormWrapper> or something like that?

Fine if not...just contemplating how to make things more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in 843c4bf

@natalia-fitzgerald
Copy link

@shindigira
Just to be sure you're pulling from the latest mock-up here it is. There's a difference with the inline error message (outdated design had a heading and paragraph text and updated design just has paragraph text). The size of that text should be 16px (standard paragraph styling).
LEI search returns no results

@shindigira
Copy link
Contributor Author

@shindigira Just to be sure you're pulling from the latest mock-up here it is. There's a difference with the inline error message (outdated design had a heading and paragraph text and updated design just has paragraph text). The size of that text should be 16px (standard paragraph styling).

@natalia-fitzgerald
Resolved in this PR #32. Check the screenshot to make sure this everything is correct.

@shindigira
Copy link
Contributor Author

  • This text feels a bit vertically cramped, could we increase the line height? Font also seems a bit smaller than the mockup.
Screenshot 2023-08-22 at 1 38 28 PM
  • I see this error box in the mockup but not in the UI when I hit submit
    Screenshot 2023-08-22 at 1 40 49 PM

@meissadia Resolved in this PR #32.

shindigira and others added 4 commits August 24, 2023 02:53
- Removed `console.log`

Co-authored-by: Meis <[email protected]>
Removed duplicate button

Co-authored-by: Meis <[email protected]>
Removed duplicate paragraph

Co-authored-by: Meis <[email protected]>
@shindigira
Copy link
Contributor Author

Merging this PR and focusing on on the follow-up PR #32 that will address any remaining issues.

@shindigira shindigira merged commit 9e33de0 into main Aug 24, 2023
1 of 2 checks passed
@shindigira shindigira added the UI Tasks involving visual elements label Aug 30, 2023
@meissadia meissadia deleted the 26-initial-user-profile-form branch September 6, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Tasks involving visual elements
Projects
None yet
3 participants