fix(charts): Time range filters are not being applied to charts that were overwritten #23589
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
When
GENERIC_CHART_AXES
FF is on and we overwrite a chart, any filter coming from the dashboard is not saved (it gets removed since its marked asisExtra
). However, removing such filter doesn't have to mean we delete the original temporal filter if any, otherwise the dashboard wont be able to filter the chart again.This PR keeps the original
adhoc_filters
from the slice so when calling the PUT API it doesn't get removed. So any call toapi/v1/dashboard/{db_id}/charts
is consistent even after you overwrite the chart.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
GENERIC_CHART_AXES
FF is ONADDITIONAL INFORMATION
GENERIC_CHART_AXES