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: Reset sorting bar issue in Barchart #19371

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

codemaster08240328
Copy link
Contributor

SUMMARY

When enabling "sort bars" and disabling again, the order isn't reset to the original order.

It was because when we sort data from props, it made updates in redux store as well.

Solution: deep copy

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:

[DEV] Genders by State - 25 March 2022 - Watch Video



AFTER:

[DEV] Genders by State - 25 March 2022 - Watch Video



TESTING INSTRUCTIONS

  1. Goto charts page
  2. Select Genders by State chart
  3. Check sort bars under customize tab.
  4. Uncheck sort bars.
  5. See how chart is rendered.

ADDITIONAL INFORMATION

  • Has associated issue: bar chart: disabling "sort bars" doesn't reset sort order #12650
  • 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

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #19371 (c4e4566) into master (a4c261d) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #19371      +/-   ##
==========================================
- Coverage   66.59%   66.53%   -0.06%     
==========================================
  Files        1670     1672       +2     
  Lines       63888    63954      +66     
  Branches     6510     6519       +9     
==========================================
+ Hits        42544    42552       +8     
- Misses      19655    19711      +56     
- Partials     1689     1691       +2     
Flag Coverage Δ
javascript 51.25% <0.00%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
...nd/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js 0.00% <0.00%> (ø)
.../components/Header/HeaderActionsDropdown/index.jsx 67.79% <0.00%> (-3.64%) ⬇️
...frontend/src/dashboard/components/Header/index.jsx 60.92% <0.00%> (-0.46%) ⬇️
superset-frontend/src/preamble.ts 0.00% <0.00%> (ø)
superset-frontend/src/embedded/index.tsx 0.00% <0.00%> (ø)
...rc/dashboard/components/DashboardEmbedControls.tsx 8.16% <0.00%> (ø)
...ontend/src/dashboard/containers/DashboardRoute.tsx 0.00% <0.00%> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 5.31% <0.00%> (+0.05%) ⬆️
...rset-frontend/src/hooks/apiResources/dashboards.ts 36.36% <0.00%> (+3.03%) ⬆️

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 a4c261d...c4e4566. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM!

@rusackas rusackas merged commit 94e06c2 into apache:master Apr 13, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* fix: Reset sorting bar issue in Barchart

* improving performance

* fix lint error
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 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-Patch size/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants