fix: chart empty state & result panel when multiple queries are executed display incorrectly #20816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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