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

[Page] Update your financial institution profile #222

Closed
9 of 25 tasks
Tracked by #82
meissadia opened this issue Feb 1, 2024 · 0 comments · Fixed by #276, #282, #283 or #322
Closed
9 of 25 tasks
Tracked by #82

[Page] Update your financial institution profile #222

meissadia opened this issue Feb 1, 2024 · 0 comments · Fixed by #276, #282, #283 or #322
Assignees

Comments

@meissadia
Copy link
Collaborator

meissadia commented Feb 1, 2024

  • Phase 1-3 - (Review first) [Page] Update Institution profile - Phase 1,2,3 #276
    • Phase 1 - can you get all the page inputs
    • Phase 2 - can you submit / emulate a submission to the endpoint
    • Phase 3 - can you pull in existing data
  • Phase 3 (part II) - (Review second) Update FI profile - phase3 (part II) #282
    • Bug: Clear form button doesn't work, need to refactor the way we generate defaultValues
    • Bug: Default checked for checkboxes does not register in the DTO. May be fixed with the ^ above ^ defaultValues refactor.
    • Bug?: User can resize the Additional details TextArea outside of grey bounding box. Do we need to restrict this?
  • Phase 2 (Part II) - (Review third) Update FI profile - mail api integration #283
    • Send form data via Mail API
  • Phase 4 - can you get the most basic field level validations correct (required, length, numbers)
    • Institution Type - Other
      • Should the text input for this be disabled when Other is not checked?
      • Instructions for how to format (comma separated) input in the Other text input?
    • Address typescript exceptions/issues
    • Utilize @shindigira 's awesome Zod integration to simplify and consolidate type definitions/derivations
  • Phase 5 - can you get design approval for the form

Issues that need to be addressed

  • Feat: Add Crumbtrail to /summary page so users have a way to navigate away from the page
  • Bug: Page wrapper does not match whatever we use for View Institution... causing a noticeable shift in page content when navigating between View... and Update....
  • TypeScript: Revisit disabled linter errors
  • Data submission (formatFinancialProfileObject): Do further comparison against defaultValues to determine which data was changed, so that we only send SBL Help the info they actually need to update
    • Debug why changes to DSR-Checkbox values are not registering in react-hook-form
    • Debug why changes to DSR-TextArea values are not registering in react-hook-form
@meissadia meissadia self-assigned this Feb 1, 2024
meissadia added a commit that referenced this issue Feb 9, 2024
Part of #222 

This PR is primarily to rename the "InstitutionsDetails" page to
"ViewInstitutionProfile" in order to better align with other profile
pages (view/update of institution/user) we are building.

Since it touches so many files it made sense to break this task into a
separate PR for easier review.

## Changes

- Rename "InstitutionsDetails" to "ViewInstitutionProfile"
- Address ESLint errors
  - Destructure properties (Unicorn)
  - No magic numbers
- Address Typescript errors
  - Update Zod schemas 


## How to test this PR

1. Verify app loads
2. Verify that you can load an Institution Profile (ex:
http://localhost:8899/institution/TESTBANK123)

## Screenshots
- No visual changes
@meissadia meissadia linked a pull request Feb 26, 2024 that will close this issue
7 tasks
meissadia added a commit that referenced this issue Mar 6, 2024
Phase 1-3 of #222 

## Changes
- Creates `Update your financial institution profile` page
- Presents all of the associated input fields
- Populates input fields with pre-existing Institution data
- Upon `Submit`, simulates a successful submission and displays the
corresponding `/summary` confirmation page

---------

Co-authored-by: shindigira <shindigira@gmail.com>
@meissadia meissadia reopened this Mar 6, 2024
meissadia added a commit that referenced this issue Mar 13, 2024
Part 2 of #222 

## Changes
- Populates form's `defaultValues` with existing Institution data
- Implements `Clear form` functionality
- Removes previous method of providing form input defaults
- Removes vague `id=stuff`
- Temp fix for TextArea resizing issue

## TODO
- Lots of Typescript stuff (Will work to address these issues in my next
PR)

## How to test this PR
1. In browser console, ensure routing is enabled
(`setIsRoutingEnabled(true)`)
1. Login with a user who has an associated institution
2. Click on the institution to `View` it's profile
3. Click on `Update your financial institution profile`
5. Modify a single field
6. Hit the `Clear form` button, observe that the edited data is reset
5. Modify a single field
8. Hit `Submit`
9. Verify you are redirected to the `/summary` route and shown a
simulated "Success" confirmation
10. In console, look for `data to be submitted (before format)` and
confirm the field you edited reflects the data you entered

---------

Co-authored-by: shindigira <shindigira@gmail.com>
meissadia added a commit that referenced this issue Mar 20, 2024
Part 3 of #222 

<img width="1226" alt="Screenshot 2024-02-29 at 4 05 55 PM"
src="https://github.com/cfpb/sbl-frontend/assets/2592907/9dd7c191-a102-44ff-9709-3758d9e72f5b">


## Changes

- Formats form data for email submission
- Triggers Mail API call upon submission
- Replace "Simulated" submission with actual Mail API call

## Planned improvements
- [ ] Data submission (formatFinancialProfileObject): Do further
comparison against `defaultValues` to determine which data was changed,
so that we only send SBL Help the info they actually need to update.
This may also be resolved if we can address the [`forwardRef`
errors](cfpb/design-system-react#316) we've
been seeing, which may fix the issue of changes to these fields not
being registered in `react-hook-form`

## How to test this PR

1. In `console` ensure routing is enabled: `setIsRoutingEnabled(true)`
1. Login as a user with an associated institution
2. Click on the Institution to `View institution profile`
3. Click on `Update institution profile`
4. Change some Institution data
5. Hit submit
6. Hopefully an email gets generated 🤞🏾 
7. In `console`, you should also see the data that will be sent. 
<img width="549" alt="Screenshot 2024-02-28 at 5 41 29 PM"
src="https://github.com/cfpb/sbl-frontend/assets/2592907/f0515aae-b02b-473c-88b3-4a7a9a881536">

## Notes
- Submission data format (decoded)
``` decoded
{
     "tax_id": "tax_id",
     "rssd_id": "rss_id",
     "parent_legal_name": "parent-name",
     "parent_lei": "parent_lei",
     "parent_rssd_id": "parent-rssd",
     "top_holder_legal_name": "top-name",
     "top_holder_lei": "top-lei",
     "top_holder_rssd_id": "top-rssd",
     "sbl_institution_types": "bankSavings,minorityDepository,other",
     "sbl_institution_types_other": "Test SBL Type",
     "additional_details": "details"
}
```
- Submission data format (encoded)
```
tax_id=tax_id&rssd_id=rss_id&parent_legal_name=parent-name&parent_lei=parent_lei&parent_rssd_id=parent-rssd&top_holder_legal_name=top-name&top_holder_lei=top-lei&top_holder_rssd_id=top-rssd&sbl_institution_types=bankSavings%2CminorityDepository%2Cother&sbl_institution_types_other=Test+SBL+Type&additional_details=details
```

---------

Co-authored-by: shindigira <shindigira@gmail.com>
@meissadia meissadia reopened this Mar 20, 2024
@meissadia meissadia linked a pull request Mar 22, 2024 that will close this issue
3 tasks
meissadia added a commit that referenced this issue Mar 28, 2024
Phase 4 of #222 

## Changes
- Eliminates the majority of ESLint exception previously applied in the
UpdateFinancialProfile folder
- Updates type structures used to manage the UFP form
- Validates TIN
- Validates RSSD ID
- Ensures at least one Type of financial institution is selected
- Ensures that if Type - `Other` is selected, a description is entered
in the checkbox
- Clears the description textbox and disables it if Type - `Other` is
deselected
- Ensures *some* Institution data has been modified before allowing the
user to submit the form
- Note: Disabling the `Submit` button requires more extensive
modifications due to struggles I've had getting `react-hook-form` to
recognize changes to the `Type of financial institution` and `Additional
details` fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment