-
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
visualize should apply saved query and filters #12789
Conversation
jenkins, test this |
CI failed twice on same test: https://kibana-ci.elastic.co/job/elastic+kibana+pull-request+multijob-selenium/5969/console
|
jenkins, test this |
failing on new test this time
https://kibana-ci.elastic.co/job/elastic+kibana+pull-request+multijob-selenium/5988/console |
searchSource.set('filter', appState.filters); | ||
if (!appState.linked) searchSource.set('query', appState.query); | ||
searchSource.set('filter', _.union(searchSource.initialState.filter, appState.filters)); | ||
if (!appState.linked) searchSource.set('query', _.union([searchSource.initialState.query], [appState.query])); |
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.
I don't think we should be merging this with a union of arrays. The problem is that we get other bugs:
- saving twice, will then save the visualization with an array in the searchSourceJSON.
- a side-effect is that the query-string of the visualization can no longer be restored correctly in the UI control
- Another issue is, when the query is undefined, it gets merged into the object as null, creating malformed queries
- This in turn causes errors with the query, breaking both dashboards and visualizations.
The test failures may be related to my comments above, but don't know 100% for sure. How did this even work pre-refactor?!? I can't really find an example of where the merging of these queries is governed. |
closes #12784