-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
feat: Select component (Iteration 1) #15121
Conversation
@geido First thoughts:
|
This is just to simplify the review and to avoid that the new implementation would appear as changes made on the original file. Once this PR is merged, we can just rename it.
I have enhanced the storybook to provide an Async Select dedicated story. However, I am looking to do more improvements there as soon as I am done with the rest of the implementation.
I am definitely going to if the number of changes to the state should increase.
I tried, however, typescript still complains. I am avoiding dedicating too much time to this and leaving it for when the main implementation is completed.
This is now done. Thank you! |
allowNewOptions?: boolean; | ||
ariaLabel: string; | ||
header?: ReactNode; | ||
name?: string; // discourage usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why this a prop we don't want to use anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's has been a discussion for this prop. The consensus is that aria-label
is a better option
/testenv up |
Codecov Report
@@ Coverage Diff @@
## master #15121 +/- ##
==========================================
- Coverage 77.40% 77.16% -0.25%
==========================================
Files 969 971 +2
Lines 50013 50170 +157
Branches 6431 6483 +52
==========================================
Hits 38712 38712
- Misses 11098 11255 +157
Partials 203 203
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@rusackas Container image not yet published for this PR. Please try again when build is complete. |
@rusackas Ephemeral environment creation failed. Please check the Actions logs for details. |
@rusackas Ephemeral environment spinning up at http://54.185.132.105:8080. Credentials are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything majorly wrong. Looks good to go for the next iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this first iteration is great. Thanks for organizing the work so well.
We don't have any conflicts with the other Select component and the new Select is only being used in the Storybook so we can merge it and continue to iteration 2.
Ephemeral environment shutdown and build artifacts deleted. |
+💯 This is some awesome foundational work, which is going to put Superset on a much more clean and consistent path with these components. Thank you also for the great pre-coding audit process of all the features and props that our "select party" offered. For those who haven't seen it, this new component aims to (eventually) replace all of these: |
* Implement initial structure * Add aria-label * Rename files * Refactor single mode new options * Clean up * Add select at every corner in storybook * Clean up * Add pagination * Move selected options at the top * Clean up * Add license * Refactor * Improve pagination * Fetch when allowNewOptions * Clean up
* Implement initial structure * Add aria-label * Rename files * Refactor single mode new options * Clean up * Add select at every corner in storybook * Clean up * Add pagination * Move selected options at the top * Clean up * Add license * Refactor * Improve pagination * Fetch when allowNewOptions * Clean up
* Implement initial structure * Add aria-label * Rename files * Refactor single mode new options * Clean up * Add select at every corner in storybook * Clean up * Add pagination * Move selected options at the top * Clean up * Add license * Refactor * Improve pagination * Fetch when allowNewOptions * Clean up
SUMMARY
This PR introduces a new Select component based on the Antdesign Select. The goal of the refactoring is to eliminate all the various instances of selects throughout the codebase and merge them into one, while getting rid of the react-select entirely.
PROPS
At the moment only some of the Antd props have been exposed in the interface on top of the custom props. This is to make sure that the Select component is used with the intended behaviors. However, as the implementation of the new component goes, we might realize that other default props should be exposed.
number OR number[]
LabeledValue OR LabeledValue[]
Default:
() => document.body
CUSTOM FEATURES
Few abilities have been added on top of the default Antd Select component, as follows:
ASYNC SELECT
The Select component now has the ability to fetch data. The
options
property can accept aPromise
. The Select component will do this for you:paginatedFetch
is set and will automatically run the fetch by passing the current page as the user scrolls through the optionsWHAT'S MISSING (Upcoming in Iteration 2)
This first iteration should be merged as it does not affect any existing functionality. @michael-s-molina will take over the "WHAT'S MISSING" and any other change request in a separate PR as soon as this is merged (Iteration 2).