Skip to content
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(native-filters): sort selected values on blur #14842

Merged
merged 2 commits into from
May 27, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented May 26, 2021

SUMMARY

This is a follow up to #14486 and implements @mistercrunch 's suggestion to reorder selected values (#14486 (comment)). Previously, selected values were left in their original place in the native select filter. This change emulates that of the GitHub tag component, which places the selected values on top after the new values are persisted.

The plan is to add this functionality to the main Select component used throughout Superset in the future (probably as a prop that defaults to being disabled). However, to avoid causing potential functional or visual regressions in the application, this functionality will be kept only within the native filter component for now until it has been found to be fully stable.

BEFORE

Previously, the selected values stayed in their original positions after the dropdown was collapsed:
https://user-images.githubusercontent.com/33317356/119669257-97450780-be40-11eb-909c-34f81518354e.mp4

AFTER

Now the values are reordered when the dropdown is not visible:
https://user-images.githubusercontent.com/33317356/119669275-9b712500-be40-11eb-86e8-0ff621da784d.mp4

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #14842 (6beaecf) into master (80d22f5) will increase coverage by 0.00%.
The diff coverage is 87.50%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14842   +/-   ##
=======================================
  Coverage   77.54%   77.54%           
=======================================
  Files         963      963           
  Lines       49248    49262   +14     
  Branches     6197     6199    +2     
=======================================
+ Hits        38187    38199   +12     
- Misses      10860    10862    +2     
  Partials      201      201           
Flag Coverage Δ
javascript 72.49% <87.50%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/filters/components/Select/SelectFilterPlugin.tsx 68.18% <87.50%> (+3.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80d22f5...6beaecf. Read the comment docs.

@junlincc junlincc requested a review from kgabryje May 26, 2021 16:54
@junlincc junlincc added demo dashboard:native-filters Related to the native filters of the Dashboard labels May 26, 2021
@junlincc
Copy link
Member

junlincc commented May 26, 2021

this is awesome, @villebro

  1. "...+4" behavior is as expected 🟢

  2. inverse select is not applying properly in the indicator. Indicator should show the non-selected value in the Applied field. Explore is working properly. I suggest break it into 2 PRs.

Screen.Recording.2021-05-26.at.10.25.20.AM.mov

Screen Shot 2021-05-26 at 10 28 05 AM

Screen Shot 2021-05-26 at 10 32 26 AM

Screen Shot 2021-05-26 at 10 32 30 AM

@junlincc junlincc requested review from junlincc and removed request for kgabryje May 26, 2021 22:44
@junlincc
Copy link
Member

Thanks for splitting the PRs! @simcha90 @zhaoyongjie please help review, should be good to go! 🟢

@junlincc junlincc requested review from kgabryje, simcha90 and zhaoyongjie and removed request for junlincc May 27, 2021 05:13
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for this improvement.

@villebro villebro merged commit 2b4e0ec into apache:master May 27, 2021
@villebro villebro deleted the villebro/blur-sort branch May 27, 2021 06:36
@junlincc junlincc removed the demo label May 28, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* feat(native-filters): sort selected values on blur

* remove new icons
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* feat(native-filters): sort selected values on blur

* remove new icons
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* feat(native-filters): sort selected values on blur

* remove new icons
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels dashboard:native-filters Related to the native filters of the Dashboard preset-io size/M 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants