mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
The query bar used to be hidden in the presence of a linked search because unlike filters, queries didn't get merged when flattening a SearchSource hierarchy. That means a query in the query bar would override the query in the linked search. This is no longer the case. As of 6.0 we include all queries in the SearchSource hierarchy in the final request, so there's no longer any reason to hide the query bar. Since filters created via a Vis show up in the query bar when Kuery is selected, these filters now appear correctly even when there's a linked search in the vis editor. Previously when unlinking a saved search visualize would insert the query and filters from the saved search into app state before removing the SearchSource from the hierarcy. This posed a problem because combining two lucene query strings isn't as easy as combing two sets of filters. We decided this behavior was a bit counterintuitive anyway. If the user wants to unlink the saved search, they probably want to discard it, not combine it with their local changes. So I've also updated the unlinking functionality to discard the saved search.
This commit is contained in:
parent
07879f9b10
commit
ebb36b284d
5 changed files with 9 additions and 14 deletions
|
@ -18,7 +18,6 @@
|
|||
ng-show="chrome.getVisible()"
|
||||
class="fullWidth"
|
||||
>
|
||||
<!-- Block searching if the Visualization is linked to a Saved Search. -->
|
||||
<div ng-if="vis.type.requiresSearch && state.linked">
|
||||
Linked to Saved Search “{{ savedVis.savedSearch.title }}”
|
||||
|
||||
|
@ -31,8 +30,7 @@
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Allow searching if there is no linked Saved Search. -->
|
||||
<div ng-if="vis.type.requiresSearch && !state.linked && vis.type.options.showQueryBar" class="fullWidth">
|
||||
<div ng-if="vis.type.requiresSearch && vis.type.options.showQueryBar" class="fullWidth">
|
||||
<query-bar
|
||||
query="state.query"
|
||||
app-name="'visualize'"
|
||||
|
@ -47,7 +45,7 @@
|
|||
|
||||
<!-- Filters. -->
|
||||
<filter-bar
|
||||
ng-if="vis.type.options.showFilterBar && state.query.language === 'lucene' && !state.linked"
|
||||
ng-if="vis.type.options.showFilterBar && state.query.language === 'lucene'"
|
||||
state="state"
|
||||
index-patterns="[indexPattern]"
|
||||
></filter-bar>
|
||||
|
|
|
@ -297,9 +297,9 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
|
|||
delete savedVis.savedSearchId;
|
||||
parent.set('filter', _.union(searchSource.getOwn('filter'), parent.getOwn('filter')));
|
||||
|
||||
// copy over all state except "aggs" and filter, which is already copied
|
||||
// copy over all state except "aggs", "query" and "filter"
|
||||
_(parent.toJSON())
|
||||
.omit('aggs')
|
||||
.omit(['aggs', 'filter', 'query'])
|
||||
.forOwn(function (val, key) {
|
||||
searchSource.set(key, val);
|
||||
})
|
||||
|
@ -308,6 +308,8 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
|
|||
$state.query = searchSource.get('query');
|
||||
$state.filters = searchSource.get('filter');
|
||||
searchSource.inherits(parentsParent);
|
||||
|
||||
$scope.fetch();
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
|
@ -10,9 +10,7 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) {
|
|||
|
||||
if (queryFilter && vis.editorMode) {
|
||||
searchSource.set('filter', queryFilter.getFilters());
|
||||
if (!appState.linked) {
|
||||
searchSource.set('query', appState.query);
|
||||
}
|
||||
searchSource.set('query', appState.query);
|
||||
}
|
||||
|
||||
const shouldQuery = () => {
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
* of this container using padding.
|
||||
*/
|
||||
.kuiLocalNavRow--secondary {
|
||||
height: 40px; /* 1 */
|
||||
padding: 0 $localNavSideSpacing 0; /* 1 */
|
||||
padding: 0 $localNavSideSpacing 10px; /* 1 */
|
||||
align-items: flex-start; /* 1 */
|
||||
}
|
||||
|
|
4
ui_framework/dist/ui_framework.css
vendored
4
ui_framework/dist/ui_framework.css
vendored
|
@ -2065,9 +2065,7 @@ main {
|
|||
* of this container using padding.
|
||||
*/
|
||||
.kuiLocalNavRow--secondary {
|
||||
height: 40px;
|
||||
/* 1 */
|
||||
padding: 0 10px 0;
|
||||
padding: 0 10px 10px;
|
||||
/* 1 */
|
||||
-webkit-box-align: start;
|
||||
-webkit-align-items: flex-start;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue