Skip to content

Commit

Permalink
Ensure saved filters from searchSource are always passed to response …
Browse files Browse the repository at this point in the history
…handlers (#33074) (#33317)
  • Loading branch information
lukeelmers authored Mar 15, 2019
1 parent c4e62fd commit bfdd116
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ui/public/visualize/loader/visualize_data_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,21 @@ export class VisualizeDataLoader {
typeof this.vis.params.showMetricsAtAllLevels !== 'undefined'
? !this.vis.params.showMetricsAtAllLevels
: !this.vis.isHierarchical();

const filters = params.filters || [];
const savedFilters = params.searchSource.getField('filter') || [];

const query = params.query || params.searchSource.getField('query');

// searchSource is only there for courier request handler
const requestHandlerResponse = await this.requestHandler({
partialRows: this.vis.type.requiresPartialRows || this.vis.params.showPartialRows,
minimalColumns,
metricsAtAllLevels: this.vis.isHierarchical(),
visParams: this.vis.params,
...params,
filters: params.filters
? params.filters.filter(filter => !filter.meta.disabled)
: undefined,
query,
filters: filters.concat(savedFilters).filter(f => !f.meta.disabled),
});

// No need to call the response handler when there have been no data nor has been there changes
Expand Down

0 comments on commit bfdd116

Please sign in to comment.