-
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
[Discover] Fix navigating back when changing index pattern #84061
[Discover] Fix navigating back when changing index pattern #84061
Conversation
…-23-discover-fix-navigate-back-on-index-pattern-change
@@ -301,8 +302,7 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||
$scope.state.sort, | |||
config.get(MODIFY_COLUMNS_ON_SWITCH) | |||
); | |||
await replaceUrlAppState(nextAppState); | |||
$route.reload(); |
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.
so switching the index pattern is now pushing to the browser history
@@ -264,7 +264,8 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||
if (!_.isEqual(newStatePartial, oldStatePartial)) { | |||
$scope.$evalAsync(async () => { | |||
if (oldStatePartial.index !== newStatePartial.index) { | |||
//in case of index switch the route has currently to be reloaded, legacy | |||
//in case of index pattern switch the route has currently to be reloaded, legacy | |||
$route.reload(); |
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.
when there is a change of index pattern in URL, the route is reloaded, so the new index pattern is selected ... reload is necessary because of other legacy dependencies, and will be no longer necessary in the future, when moving to react router
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
…-back-on-index-pattern-change
💚 Build SucceededMetrics [docs]Async chunks
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.
After doing yarn kbn clean
it works fine for me. Tested in Chrome and Firefox on Mac OS.
* master: [Security Solution] Exceptions Cypress tests (elastic#81759) [ML] Fix spaces job ID check (elastic#84404) [Security Solution][Detections] Handle dupes when processing threshold rules (elastic#83062) skip flaky suite (elastic#84440) skip flaky suite (elastic#84445) [APM] Fix missing `service.node.name` (elastic#84269) Upgrade fp-ts to 2.8.6 (elastic#83866) Added data streams privileges to better control delete actions in UI (elastic#83573) Improve short-url redirect validation (elastic#84366) TSVB offsets (elastic#83051) [Discover] Fix navigating back when changing index pattern (elastic#84061) [Logs UI] Polish the UI for the log entry examples in the anomaly table (elastic#82139) [Logs UI] Limit the height of the "view in context" container (elastic#83178) [Application Usage] Update `schema` with new `fleet` rename (elastic#84327) fix identation in list (elastic#84301)
Summary
This PR restores the functionality of Discover to navigate back and forth selected index patterns using the browser back and forward button.
How to test
Fixes #79872
Checklist