-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard] Fix Time Range Regression #159337
[Dashboard] Fix Time Range Regression #159337
Conversation
Pinging @elastic/kibana-presentation (Team:Presentation) |
@elasticmachine merge upstream |
…on/kibana into fix/dashboardTimeRange
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally + code review. Everything worked great this time, couldn't find any more weird edge cases - LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test addition 🎉
*/ | ||
const initialTimeRange: TimeRange = (() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments here make the logic super easy to follow 👍 Makes sense to me
Fixed Dashboard loading with a saved time range when the URL also contains a time range. (cherry picked from commit f60d43e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Fixed Dashboard loading with a saved time range when the URL also contains a time range. (cherry picked from commit f60d43e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.8`: - [[Dashboard] Fix Time Range Regression (#159337)](#159337) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Devon Thomson","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-15T20:10:55Z","message":"[Dashboard] Fix Time Range Regression (#159337)\n\nFixed Dashboard loading with a saved time range when the URL also contains a time range.","sha":"f60d43e27b7c28e73f13b122453ac27c8e2e62bd","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","Team:Presentation","loe:hours","impact:critical","backport:prev-minor","v8.9.0","v8.8.2"],"number":159337,"url":"https://github.com/elastic/kibana/pull/159337","mergeCommit":{"message":"[Dashboard] Fix Time Range Regression (#159337)\n\nFixed Dashboard loading with a saved time range when the URL also contains a time range.","sha":"f60d43e27b7c28e73f13b122453ac27c8e2e62bd"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159337","number":159337,"mergeCommit":{"message":"[Dashboard] Fix Time Range Regression (#159337)\n\nFixed Dashboard loading with a saved time range when the URL also contains a time range.","sha":"f60d43e27b7c28e73f13b122453ac27c8e2e62bd"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
Fixes #157164.
Fixes #151555.
The linked issue was a regression caused by #144332. In short, when the Dashboard was saved with a time range, but the URL had an explicit time range set in the
_g
param, the dashboard loading would set the input time range to the saved time, but set the time picker range to the explicit URL time.This PR fixes this bug, adds a jest test to ensure the input is properly set in this case, and extends the functional test to check both the value of the time picker and that the time was applied to the charts on the dashboard.
Additionally, this PR fixes an issue where changing the global time then pressing back would restore the default time (15 minutes) rather than the time saved with the Dashboard.
Checklist
Delete any items that are not applicable to this PR.