Skip to content
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

Show query and filter bars even when there's a linked search #14212

Merged
merged 3 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core_plugins/kibana/public/visualize/editor/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>

<!-- Allow searching if there is no linked Saved Search. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to remove this comment now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point :)

<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'"
Expand All @@ -47,7 +47,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>
Expand Down
6 changes: 4 additions & 2 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" and filter, which is already copied
// copy over all state except "aggs", "query" and "filter"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we could ditch it entirely but it turns out we still need some things, like the index.

_(parent.toJSON())
.omit('aggs')
.omit(['aggs', 'filter', 'query'])
.forOwn(function (val, key) {
searchSource.set(key, val);
})
Expand All @@ -298,6 +298,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();
Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
4 changes: 1 addition & 3 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -2135,9 +2135,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;
Expand Down
3 changes: 1 addition & 2 deletions ui_framework/src/components/local_nav/_local_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}