Fix saved query in app state in discvoer#47849
Merged
flash1293 merged 3 commits intoelastic:masterfrom Oct 16, 2019
Merged
Conversation
Contributor
💔 Build Failed |
Contributor
|
@flash1293 this fix works, thanks for that. As for the approach, I'm not sure if relying on Angular's way of doing things is better because, as you mention, it might make clean up later difficult. |
Contributor
Author
|
Jenkins, test this. |
Contributor
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
Contributor
💚 Build Succeeded |
TinaHeiligers
approved these changes
Oct 11, 2019
Contributor
TinaHeiligers
left a comment
There was a problem hiding this comment.
Tested in Chrome and it works as expected.
Code looks fine.
LGTM!
Bargs
suggested changes
Oct 11, 2019
Contributor
Bargs
left a comment
There was a problem hiding this comment.
Fix looks good!
We have the same code in visualize and dashboard, do you mind updating those as well?
Contributor
💚 Build Succeeded |
flash1293
added a commit
to flash1293/kibana
that referenced
this pull request
Oct 16, 2019
flash1293
added a commit
that referenced
this pull request
Oct 16, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #46363
This bug got introduced in 0656e4f because it truthy-checks
$scope.savedQuerybefore loading a query which never gets populated because it references a$route.current.locals.savedQuerythat never gets resolved (line 223) - this line seems like a leftover to me.The fix in this PR solves the problem by fixing the condition when loading the query and making sure the search on initial page load is not triggered if a saved query is referenced because it will be loaded async and trigger a search itself.
There is another option to implement this - it would also be possible to resolve the query like index pattern and saved search are resolved as part of the
resolveprop of the route specification. I didn't chose that way because it relies on the angular way of doing things and might be more difficult to clean up later on - I expect this controller will be broken down and migrated away from angular in the near future anyway. Maybe there is a good reason to follow through with the initial implementation approach, happy to change this.