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(explore): handle null control sections #20142

Merged
merged 2 commits into from
May 20, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented May 20, 2022

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

The recent PR #20097 added explicit support for null-valued control panel sections. However, due to lacking TS coverage and type declarations in the codebase, these weren't always being checked properly. This caused Explore to fail to render when opening a Mixted timeseries chart with the GENERIC_CHART_AXES feature flag disabled.

This PR adds some missing types and filtering using the new type guard introduced in the aforementioned PR to ensure null sections are always skipped. A null value is also added to a control panel section fixture to make sure it doesn't break the utils.

Tip: enable "Hide whitespace" when reviewing the diff:
image

Note that this regression uncovered a pretty serious mistyping of the chart control panel config registry, but fixing it is beyond the scope of this PR.

TESTING INSTRUCTIONS

  1. Disable the GENERIC_CHART_AXES feature flag
  2. Open a mixed timeseries chart
  3. Notice Explore fail to render

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

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM

@pull-request-size pull-request-size bot added size/L and removed size/M labels May 20, 2022
@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #20142 (cd9d795) into master (0bcc21b) will not change coverage.
The diff coverage is 90.00%.

@@           Coverage Diff           @@
##           master   #20142   +/-   ##
=======================================
  Coverage   66.46%   66.46%           
=======================================
  Files        1721     1721           
  Lines       64512    64512           
  Branches     6806     6806           
=======================================
  Hits        42875    42875           
  Misses      19905    19905           
  Partials     1732     1732           
Flag Coverage Δ
javascript 51.33% <90.00%> (ø)

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

Impacted Files Coverage Δ
...perset-frontend/src/utils/getControlsForVizType.js 92.85% <87.50%> (ø)
...ntend/src/explore/controlUtils/getControlConfig.ts 100.00% <100.00%> (ø)
superset-frontend/src/explore/fixtures.tsx 66.66% <100.00%> (ø)

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 0bcc21b...cd9d795. Read the comment docs.

@villebro villebro merged commit e766f8c into apache:master May 20, 2022
@villebro villebro deleted the villebro/filter-null-sections branch May 20, 2022 16:07
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* fix(explore): handle null control sections

* fix type and add null to test fixture
@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-io size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants