Skip to content

Commit

Permalink
Revert "Show query and filter bars even when there's a linked search (e…
Browse files Browse the repository at this point in the history
…lastic#14212)"

This reverts commit 3aee7c2.
  • Loading branch information
chrisronline committed Oct 4, 2017
1 parent 9c89215 commit aa568db
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/core_plugins/kibana/public/visualize/editor/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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 &ldquo;{{ savedVis.savedSearch.title }}&rdquo;
&nbsp;
Expand All @@ -30,7 +31,8 @@
</a>
</div>

<div ng-if="vis.type.requiresSearch && vis.type.options.showQueryBar" class="fullWidth">
<!-- Allow searching if there is no linked Saved Search. -->
<div ng-if="vis.type.requiresSearch && !state.linked && vis.type.options.showQueryBar" class="fullWidth">
<query-bar
query="state.query"
app-name="'visualize'"
Expand All @@ -45,7 +47,7 @@

<!-- Filters. -->
<filter-bar
ng-if="vis.type.options.showFilterBar && state.query.language === 'lucene'"
ng-if="vis.type.options.showFilterBar && state.query.language === 'lucene' && !state.linked"
state="state"
index-patterns="[indexPattern]"
></filter-bar>
Expand Down
6 changes: 2 additions & 4 deletions src/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,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", "query" and "filter"
// copy over all state except "aggs" and filter, which is already copied
_(parent.toJSON())
.omit(['aggs', 'filter', 'query'])
.omit('aggs')
.forOwn(function (val, key) {
searchSource.set(key, val);
})
Expand All @@ -298,8 +298,6 @@ 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();
Expand Down
4 changes: 3 additions & 1 deletion src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) {

if (queryFilter && vis.editorMode) {
searchSource.set('filter', queryFilter.getFilters());
searchSource.set('query', appState.query);
if (!appState.linked) {
searchSource.set('query', appState.query);
}
}

const shouldQuery = () => {
Expand Down
4 changes: 3 additions & 1 deletion ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,9 @@ main {
* of this container using padding.
*/
.kuiLocalNavRow--secondary {
padding: 0 10px 10px;
height: 40px;
/* 1 */
padding: 0 10px 0;
/* 1 */
-webkit-box-align: start;
-webkit-align-items: flex-start;
Expand Down
3 changes: 2 additions & 1 deletion ui_framework/src/components/local_nav/_local_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* of this container using padding.
*/
.kuiLocalNavRow--secondary {
padding: 0 $localNavSideSpacing 10px; /* 1 */
height: 40px; /* 1 */
padding: 0 $localNavSideSpacing 0; /* 1 */
align-items: flex-start; /* 1 */
}

0 comments on commit aa568db

Please sign in to comment.