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): fix Select filter crashing when changing filter type #15090

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jun 10, 2021

SUMMARY

When user changed filter type from "Time range" to "Value", the filter crashed. The reason was that in Value filter we assumed that filterState.value is either an array or undefined. When we switched filter type from "Time range", filterState.value was actually a string, which caused a crash. This PR fixes it by resetting dataMaskSelected for given filter in FilterBar to it's initial value when filter's type is changed

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
https://user-images.githubusercontent.com/15073128/121539232-c5f8db80-ca05-11eb-9c47-a35ace7124e8.mov
After:
https://user-images.githubusercontent.com/15073128/121539403-f17bc600-ca05-11eb-949d-a1787379db4a.mov

TESTING INSTRUCTIONS

  1. Set DASHBOARD_NATIVE_FILTERS feature flag to True
  2. Add a time range filter
  3. Change filter's type to Value
  4. Verify that filter didn't crash and it's initial value equals to filter's default value (or empty if default value is not specified)

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: @junlincc @villebro

@codecov
Copy link

codecov bot commented Jun 10, 2021

Codecov Report

Merging #15090 (a64feb8) into master (c0eff8f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head a64feb8 differs from pull request most recent head 730aa1d. Consider uploading reports for the commit 730aa1d to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15090   +/-   ##
=======================================
  Coverage   77.62%   77.62%           
=======================================
  Files         967      967           
  Lines       49702    49709    +7     
  Branches     6338     6339    +1     
=======================================
+ Hits        38579    38586    +7     
  Misses      10920    10920           
  Partials      203      203           
Flag Coverage Δ
javascript 72.50% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...board/components/nativeFilters/FilterBar/index.tsx 91.57% <100.00%> (+0.66%) ⬆️

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 c0eff8f...730aa1d. Read the comment docs.

@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Jun 10, 2021
@rusackas
Copy link
Member

/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=True

@github-actions
Copy link
Contributor

@rusackas Ephemeral environment spinning up at http://52.42.239.244:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

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! Thanks for the fix!

@rusackas rusackas merged commit 3456dd5 into apache:master Jun 11, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@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 size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants