-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
chore: Split Select component into Async and Sync components #20466
chore: Split Select component into Async and Sync components #20466
Conversation
Changed files to reference AsyncSelect if needed
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
Thanks for the PR @cccs-RyanK! Some suggestions to complete this PR and the first phase: 1 - You can include this line in
And then import the component with:
2 - Don't forget to remove the imports of the sync Select when changing to AsyncSelect. 3 - Remove the 4 - Remove the 5 - Remove the tests in 6 - Split the Select Storybook ( Thanks again! This will really reduce code complexity! |
For anyone interested, here are the phases for improving the component: My suggestion is that we implement each phase in a specific PR. |
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.
Second review completed 👍🏼
We also need to remove any references to loadOptions
(async) in the Select.test.tsx
😉
superset-frontend/src/components/Datasource/DatasourceEditor.jsx
Outdated
Show resolved
Hide resolved
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.
Thanks for the changes @cccs-RyanK! I think it's just a matter of fixing CI errors now.
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
…c-and-Sync-Components
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
Codecov Report
@@ Coverage Diff @@
## master #20466 +/- ##
==========================================
- Coverage 66.85% 66.84% -0.02%
==========================================
Files 1754 1755 +1
Lines 65757 65996 +239
Branches 6952 7030 +78
==========================================
+ Hits 43964 44115 +151
- Misses 20029 20092 +63
- Partials 1764 1789 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
LGTM. Thank you for all the work @cccs-RyanK! I can't wait for the next phases!
…20466) * Created AsyncSelect Component Changed files to reference AsyncSelect if needed * modified import of AsyncSelect, removed async tests and prefixes from select tests * fixed various import and lint warnings * fixing lint errors * fixed frontend test errors * fixed alertreportmodel tests * removed accidental import * fixed lint errors * updated async select (cherry picked from commit 1109fe5)
…20466) * Created AsyncSelect Component Changed files to reference AsyncSelect if needed * modified import of AsyncSelect, removed async tests and prefixes from select tests * fixed various import and lint warnings * fixing lint errors * fixed frontend test errors * fixed alertreportmodel tests * removed accidental import * fixed lint errors * updated async select
SUMMARY
Splits the Synchronous and Asynchronous behaviour of the Select component into two separate components. It's very clear that the behaviors are different and we can significantly reduce code complexity if we treat them as different components.
This task was outlined as a part of this PR by @michael-s-molina : #20143
Most of the use cases for the select component are synchronous at the moment, so the default "Select" component will remain the synchronous Select. "AsyncSelect" is the new component for asynchronous use cases. For this PR, the files remain identical to ensure nothing will be broken, but references to the Select Component that have asynchronous options have been changed to reference AsyncSelect.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION