refactor: [M3-6908] - Replace react-select in Profile
Description ๐
This PR helps remove part of the react-select dependency for accessibility reasons and to consolidate our usage of third-party libraries. In particular, it replaces the EnhancedSelect with our more versatile MUI-based Autocomplete component within the Profile feature.
Changes ๐
- Introduce a new
sxPopperComponentprop (optional) for theAutocompletewhich allows custom CSS styling for thePopperComponent. - The
PhoneVerificationdepended heavily on thereact-selectinstance, and by removing it, the previous styling required to be redone. This was the reason for introducing the newsxPopperComponentprop. - Update
TimezoneFormtoTimeZoneForm. - Update
defaultexports withnamedexports and correspondinglazy()imports.
Target release date ๐๏ธ
09/03/2024
How to test ๐งช
Verification steps
(How to verify changes)
- Verify that the
Profilefeature works as expected. - Inspect the
Profilepages for any visual regressions.
As an Author I have considered ๐ค
Check all that apply
- [x] ๐ Doing a self review
- [ ] โ Our contribution guidelines
- [ ] ๐ค Splitting feature into small PRs
- [x] โ Adding a changeset
- [x] ๐งช Providing/Improving test coverage
- [ ] ๐ Removing all sensitive information from the code and PR description
- [ ] ๐ฉ Using a feature flag to protect the release
- [ ] ๐ฃ Providing comprehensive reproduction steps
- [ ] ๐ Providing or updating our documentation
- [ ] ๐ Scheduling a pair reviewing session
- [ ] ๐ฑ Providing mobile support
- [ ] โฟ Providing accessibility support
Coverage Report: โ
Base Coverage: 86.64%
Current Coverage: 86.64%
@mjac0bs
There's one more failure that is legit and a result of these changes:
security-questions.spec.ts. It's still looking for the enhanced select.
I've fixed the issue with the test looking for the old enhanced select component and is now passing locally.
I'm seeing a lot of console warnings about uncontrolled vs controlled when changing the values of the Autocomplete fields. I'd check to see how we're handling this in other uses of Autocomplete throughout the app.
These have been addressed with my latest changes. Thank you for inspecting the browser console and pointing these out.
@carrillo-erik Looks like there's a merge conflict that will need to be resolved. I'll take a final pass at this once this branch is up to date and Chandra's UX feedback is addressed. Thanks for addressing initial feedback.