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: chart empty state & result panel when multiple queries are executed display incorrectly #20816

Merged

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

Depending on the number of queries being executed for a given chart, we are displaying the results in panels at the bottom (explore).
This causes some issues, because the "Show Totals" and pagination features add extra queries, leading, for instance, a table to display more than one result panel, which is incorrect.

The same issue appears for the chart empty state, since having multiple queries can make the state not to appear, as expected.

We currently have a getQueryCount util that is used in some (but not all) places. This PR moves that value to the chart metadata and then queries it in all the necessary places to solve the issue mentioned above.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

old.mov

After:

new.mov

TESTING INSTRUCTIONS

  1. Create a chart table
  2. Enable Show Totals
  3. Update the chart

Ensure the results panel show only a single result.
Repeat the process above, but for a Mixed Timeseries chart. Ensure you can see two results panels.

For the chart above, add some filters that would yield no results.
Update the chart and ensure you can see the empty state.

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

@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #20816 (7fe22e4) into master (af1bddf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 7fe22e4 differs from pull request most recent head 18443b3. Consider uploading reports for the commit 18443b3 to get more accurate results

@@           Coverage Diff           @@
##           master   #20816   +/-   ##
=======================================
  Coverage   66.30%   66.30%           
=======================================
  Files        1758     1757    -1     
  Lines       66802    66804    +2     
  Branches     7056     7058    +2     
=======================================
+ Hits        44294    44296    +2     
  Misses      20710    20710           
  Partials     1798     1798           
Flag Coverage Δ
javascript 51.98% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
.../plugin-chart-echarts/src/MixedTimeseries/index.ts 25.00% <ø> (ø)
...perset-ui-core/src/chart/components/SuperChart.tsx 100.00% <100.00%> (ø)
...superset-ui-core/src/chart/models/ChartMetadata.ts 100.00% <100.00%> (ø)
...nents/DataTablesPane/components/useResultsPane.tsx 97.50% <100.00%> (+0.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

@zhaoyongjie zhaoyongjie self-requested a review July 22, 2022 06:57
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

Good job, Thanks for moving the queryCount to the chart metadata.

@zhaoyongjie zhaoyongjie merged commit 279ab95 into apache:master Jul 22, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants