-
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
feat: upgrade react-select and make multi-select sortable #9628
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9628 +/- ##
==========================================
- Coverage 71.01% 66.10% -4.92%
==========================================
Files 586 592 +6
Lines 30635 30634 -1
Branches 3159 3238 +79
==========================================
- Hits 21756 20250 -1506
- Misses 8768 10197 +1429
- Partials 111 187 +76
Continue to review full report at Codecov.
|
@ktmud thanks for taking this on. It's no easy task. Let me know if I can help! |
74a1180
to
aa9e0d8
Compare
69c63e7
to
c419639
Compare
a19a6ec
to
3106d17
Compare
superset-frontend/cypress-base/cypress/integration/explore/control.test.js
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/integration/explore/visualizations/histogram.js
Show resolved
Hide resolved
0b0a699
to
7d0cd07
Compare
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.
@ All, this is finally ready for review! Apologies in advance for the giant diff.
Added some comments as pointers. For starters, the most important file to look at is https://github.com/apache/incubator-superset/pull/9628/files#diff-650ab8c9d74299035d13f427d0eaf5df
superset-frontend/cypress-base/cypress/integration/explore/control.test.js
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/integration/explore/chart.test.js
Show resolved
Hide resolved
...frontend/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx
Show resolved
Hide resolved
superset-frontend/spec/javascripts/explore/components/MetricsControl_spec.jsx
Show resolved
Hide resolved
8948497
to
d803d81
Compare
Upgrade `react-select`, replace `react-virtualized-select` with a custom solution implemented with `react-window`. Future plans include deprecate `react-virtualized` used in other places, too. Migrate all react-select related components to `src/Components/Select`.
TODO: add typing support for AsyncSelect props.
d803d81
to
3bfabac
Compare
Codecov Report
@@ Coverage Diff @@
## master #9628 +/- ##
==========================================
+ Coverage 71.02% 71.13% +0.10%
==========================================
Files 583 589 +6
Lines 30615 30797 +182
Branches 3162 3241 +79
==========================================
+ Hits 21745 21907 +162
- Misses 8759 8779 +20
Partials 111 111
Continue to review full report at Codecov.
|
LGTM. |
This property for AdhocMetric has been removed by apache/superset#9628
* feat: upgrade react-select v1.3.0 to v3.1.0 Upgrade `react-select`, replace `react-virtualized-select` with a custom solution implemented with `react-window`. Future plans include deprecate `react-virtualized` used in other places, too. Migrate all react-select related components to `src/Components/Select`. * Fix new list view * Fix tests * Address PR comments * Fix a flacky Cypress test * Adjust styles for Select in CRUD ListView * Fix loadOptions for owners select in chart PropertiesModal TODO: add typing support for AsyncSelect props. * Address PR comments; allow isMulti in SelectControl, too * Clean up NaN in table filter values * Fix flacky test
CATEGORY
SUMMARY
In order to enable easy reordering of selected metrics/columns, we need to upgrade
react-select
v1 and v3.This PR has done a lot of cleanups and refactoring to make this happen:
react-select
from1.3.0
to3.1.0
.react-virtualized-select
with a custom implementation based onreact-window
. Inspired by but simpler than react-windowed-select: we did not handle grouped options, but added typing.src/components/Select
andSupersetStyledSelect
as the all-in-one entrypoint to all Superset styled selects. It also handles API backward compatibility for the purpose of: 1). increase usability; 2) keep changes in dependent modules minimal.WindowedSelect
) will be used only when options list is long (currently > 100).src/components/StyledSelect
currently used in the new ListView will be deprecated.Since this is a fairly large change, it'd be highly appreciated if anyone who has worked on
react-select
orSelectControl
component in Superset before could take a close look to these changes.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
I know I have made a promise to keep all original styles, but the UI did change a bit in the end, especially the multi-value labels. The new default UI from
react-select
do make some sense and I don't want to add more complexity to the code just for overriding them.Before:
After:
Another difference is that in FilterBox, selected filter values will not have bars indicate frequency. The original design doesn't make much sense anyway since each selected value is not of equal length and it kind of interferes with legibility.
Before:
After:
TEST PLAN
CI & Manual tests.
ADDITIONAL INFORMATION
REVIEWERS
@kristw @graceguo-supercat @evans @villebro @suddjian @mistercrunch @etr2460 @nytai