refactor: [M3-6920] - Replace react-select with Autocomplete in 'Billing' - #10681
Conversation
|
Coverage Report: ❌ |
react-select with Autocomplete comp…react-select with Autocomplete in 'Billing'
| placeholder=" " | ||
| /> | ||
| <Select | ||
| <Autocomplete |
There was a problem hiding this comment.
Should we hide the label, remove padding, and disableClearable to keep parity with the current UI?
| <Autocomplete | |
| <Autocomplete | |
| disableClearable | |
| textFieldProps={{ | |
| hideLabel: true, | |
| noMarginTop: true, | |
| }} |
There was a problem hiding this comment.
I updated the styles to match the other panels in the page, which removed extra white space around the Header and outline the panel. The labels for the select components are there to improve a11y (waiting feedback from UX). I added the disableClearable prop.
| export interface Item<T = string, L = string> { | ||
| label: L; | ||
| value: T; | ||
| } |
There was a problem hiding this comment.
I'd be in favor or removing this type and using as const on the options. It allows us to avoid this extra type and allows us to use Typescript's inference
const transactionTypeOptions = [
{ label: 'Invoices', value: 'invoice' },
{ label: 'Payments', value: 'payment' },
{ label: 'All Transaction Types', value: 'all' },
] as const;
const transactionDateOptions = [
{ label: '30 Days', value: '30 Days' },
{ label: '60 Days', value: '60 Days' },
{ label: '90 Days', value: '90 Days' },
{ label: '6 Months', value: '6 Months' },
{ label: '12 Months', value: '12 Months' },
{ label: 'All Time', value: 'All Time' },
] as constThere was a problem hiding this comment.
I tried implementing the types per your suggestion and struggled a bit with making things work as expected and updating the tests to match the new implementation. This latest changes fall somewhere in the middle between your suggestion and my previous changes. Please review them, if you still believe things could be done better, I'd be happy to hop on a quick huddle to discuss where I got lost.
@hana-linode I can reduce some of the white space on the Billing & Payment History header. The other sections do not have interactive elements which is the key difference in this section with the select components.
I understand your points, however, not having labels on interactive elements is a ding on a11y. It's also mentioned in the epic link as part of the reasons for moving away from |
|
@carrillo-erik Do we have alternate UX implementations? |
|
@hana-linode @bnussman-akamai |
| */ | ||
| export const getCutoffFromDateRange = ( | ||
| range: DateRange, | ||
| range: TransactionDateOptions, |
There was a problem hiding this comment.
Can we just pass in the value instead of an object to keep the cases more explicit?
| const { data: regions } = useRegionsQuery({ | ||
| transformRegionLabel: isGeckoGAEnabled, | ||
| }); |
There was a problem hiding this comment.
I'm a little confused on why this is in the diff





Description 📝
This PR helps remove part of the
react-selectdependency for accessibility reasons and to consolidate our usage of third-party libraries. In particular, it replaces theEnhanced Selectwith our more versatile MUI-basedAutocompletecomponent within theBillingfeature.Changes 🔄
List any change relevant to the reviewer.
react-selectwithAutocompletecomponent within theBillingfeature.default exportswithnamed exports.Preview 📷
Target release date 🗓️
07/22/2024
How to test 🧪
Verification steps
(How to verify changes)
As an Author I have considered 🤔
Check all that apply