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(native-filters): chartsInScope were not recalculated in some cases #15498

Merged
merged 2 commits into from Jul 1, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jul 1, 2021

SUMMARY

In DashboardContainer we recalculated chartsInScope only when scopes changed. However, when we deleted a filter and added a new one with the same scope, scopes were equal so we didn't calculate chartsInScope for the new filter. That resulted in undefined error. This PR adds filter's ID to scopes so that we sync chartsInScope when scopes change and when new filters are created

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
https://user-images.githubusercontent.com/15073128/124115398-0defa900-da6e-11eb-97c7-1d08df3fd70c.mp4

After:
https://user-images.githubusercontent.com/15073128/124115617-5018ea80-da6e-11eb-97cf-5daeb622cec7.mov

TESTING INSTRUCTIONS

  1. Add a native filter
  2. Delete that filter and add a new one with the same scope
  3. Verify that charts highlighting on filter focus works as expected

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

CC: @villebro

@kgabryje kgabryje requested a review from villebro July 1, 2021 11:15
@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #15498 (d3daeb4) into master (e5d4765) will increase coverage by 0.04%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15498      +/-   ##
==========================================
+ Coverage   76.97%   77.01%   +0.04%     
==========================================
  Files         975      975              
  Lines       50869    50859      -10     
  Branches     6746     6740       -6     
==========================================
+ Hits        39154    39168      +14     
+ Misses      11500    11475      -25     
- Partials      215      216       +1     
Flag Coverage Δ
javascript 71.85% <20.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
...ashboard/components/gridComponents/ChartHolder.jsx 74.73% <ø> (ø)
...components/DashboardBuilder/DashboardContainer.tsx 83.67% <20.00%> (-0.33%) ⬇️
superset-frontend/src/dataMask/actions.ts 42.85% <0.00%> (-35.72%) ⬇️
superset-frontend/src/dataMask/reducer.ts 65.30% <0.00%> (-6.13%) ⬇️
...board/components/nativeFilters/FilterBar/index.tsx 83.17% <0.00%> (-1.09%) ⬇️
...odal/FiltersConfigForm/FilterScope/FilterScope.tsx 91.11% <0.00%> (+2.22%) ⬆️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 73.11% <0.00%> (+2.93%) ⬆️
...odal/FiltersConfigForm/FilterScope/ScopingTree.tsx 93.75% <0.00%> (+3.12%) ⬆️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 75.34% <0.00%> (+5.34%) ⬆️
...nts/controls/DateFilterControl/DateFilterLabel.tsx 66.66% <0.00%> (+8.94%) ⬆️
... and 1 more

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 e5d4765...d3daeb4. Read the comment docs.

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Jul 1, 2021
@kgabryje kgabryje merged commit 0ff3253 into apache:master Jul 1, 2021
amitmiran137 pushed a commit that referenced this pull request Jul 4, 2021
#15498)

* fix(native-filters): chartsInScope were not recalculated in some cases

* Small refactor

(cherry picked from commit 0ff3253)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
apache#15498)

* fix(native-filters): chartsInScope were not recalculated in some cases

* Small refactor
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
apache#15498)

* fix(native-filters): chartsInScope were not recalculated in some cases

* Small refactor
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
apache#15498)

* fix(native-filters): chartsInScope were not recalculated in some cases

* Small refactor
@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 size/S v1.3 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants