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

fix: Reordering native filters ignored by filter bar #22362

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Dec 7, 2022

SUMMARY

When user was tried to reorder native filters placed in overflow dropdown in horizontal bar, the visual changes were not applied and filters were rendered in the same order as before. The problem was using a key property around rendered filter - since the key={id} wasn't changing when filters were reordered, React ignored the change and didn't redraw the filters.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-12-07.at.20.11.14.mov

After:

Screen.Recording.2022-12-07.at.20.07.04.mov

TESTING INSTRUCTIONS

  1. Enable HORIZONTAL_FILTERS_BAR ff
  2. Add some filters, enough to make the overflow button appear
  3. Reorder filters rendered in the overflow dropdown
  4. Verify that those filters are indeed reordered after saving

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Dec 7, 2022
@michael-s-molina
Copy link
Member

@kgabryje There's still a problem with reordering when overflowed and not-overflowed elements are involved.

Screen.Recording.2022-12-07.at.2.25.46.PM.mov

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #22362 (5922be4) into master (0dbaaad) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master   #22362      +/-   ##
==========================================
- Coverage   66.77%   66.77%   -0.01%     
==========================================
  Files        1847     1847              
  Lines       70558    70559       +1     
  Branches     7735     7736       +1     
==========================================
  Hits        47114    47114              
  Misses      21444    21444              
- Partials     2000     2001       +1     
Flag Coverage Δ
javascript 53.83% <66.66%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...rontend/src/components/DropdownContainer/index.tsx 72.83% <ø> (ø)
...Filters/FilterBar/FiltersDropdownContent/index.tsx 25.00% <ø> (ø)
...s/FilterBar/FiltersOutOfScopeCollapsible/index.tsx 20.00% <ø> (ø)
...ilters/FilterBar/FilterControls/FilterControls.tsx 67.30% <66.66%> (-1.32%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@michael-s-molina michael-s-molina merged commit da64fa2 into apache:master Dec 7, 2022
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Dec 10, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 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 preset:2022.49 size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants