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): handle undefined control value gracefully #16468

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

villebro
Copy link
Member

SUMMARY

If filter.controlValues is undefined (the case of metadata from when native filters wasn't yet stable), the Filter Tab will crash. This ensures that the component doesn't crash if controlValues isn't defined. This was the only case of controlValues that I was able to find where we didn't check for ?.

Closes #16438

TESTING INSTRUCTIONS

  1. Create a native value filter in version 1.1.0.
  2. Upgrade to 1.3.0.
  3. watch the Filter Tab crash when in Dashboard mode.

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

@junlincc junlincc added the rush! Requires immediate attention label Aug 26, 2021
@villebro villebro changed the title fix(native-filters): add handle undefined control value gracefully fix(native-filters): handle undefined control value gracefully Aug 26, 2021
@villebro villebro requested a review from simcha90 August 26, 2021 16:49
@codecov
Copy link

codecov bot commented Aug 26, 2021

Codecov Report

Merging #16468 (c2bd792) into master (18be181) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16468   +/-   ##
=======================================
  Coverage   76.63%   76.64%           
=======================================
  Files        1002     1002           
  Lines       53637    53647   +10     
  Branches     6853     6857    +4     
=======================================
+ Hits        41104    41116   +12     
+ Misses      12294    12292    -2     
  Partials      239      239           
Flag Coverage Δ
javascript 70.83% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...hboard/components/nativeFilters/FilterBar/utils.ts 75.00% <100.00%> (ø)
superset-frontend/src/filters/utils.ts 85.18% <0.00%> (-8.15%) ⬇️
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 40.88% <0.00%> (-0.53%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 80.89% <0.00%> (-0.22%) ⬇️
superset-frontend/src/views/CRUD/types.ts 100.00% <0.00%> (ø)
superset-frontend/src/components/Select/Select.tsx 76.57% <0.00%> (ø)
...perset-frontend/src/explore/components/Control.tsx 76.47% <0.00%> (ø)
...d/src/explore/components/DatasourcePanel/index.tsx 73.95% <0.00%> (ø)
...controls/DndColumnSelectControl/DndSelectLabel.tsx 77.27% <0.00%> (ø)
...ontrols/DndColumnSelectControl/DndColumnSelect.tsx 47.56% <0.00%> (ø)
... 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 18be181...c2bd792. Read the comment docs.

@villebro villebro added the v1.3 label Aug 27, 2021
@villebro villebro merged commit 147637a into apache:master Aug 27, 2021
@villebro villebro deleted the villebro/native-empty branch August 27, 2021 11:03
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Aug 29, 2021
* upstream/master:
  fix: create example DB if needed (apache#16451)
  fix(native-filters): add handle undefined control value gracefully (apache#16468)
  Revert "chore: Changes the DatabaseSelector to use the new Select component (apache#16334)" (apache#16478)
  fix(explore): JS error for creating new metrics from columns (apache#16477)
  fix: queryEditor bug (apache#16452)
  docs: make code snippet usable with required imports (apache#16473)
  perf(dashboard): decouple redux props from dashboard components (apache#16421)
  perf(dashboard): reduce number of rerenders of Charts (apache#16444)
villebro added a commit that referenced this pull request Sep 6, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
@mistercrunch mistercrunch added 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.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-io rush! Requires immediate attention size/XS v1.3 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native filter]select filter on dashboard with NULL values fails
4 participants