Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into bug/8…
Browse files Browse the repository at this point in the history
…063/no-safari-crash
  • Loading branch information
stacey-gammon committed Sep 19, 2016
2 parents 7dbb786 + f2c7abe commit 8578666
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cli_plugin/install/__tests__/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('kibana cli', function () {

const expected = [
command,
`https://download.elastic.co/kibana/${command}/${command}-1234.zip`
`https://artifacts.elastic.co/download/kibana-plugins/${command}/${command}-1234.zip`
];

expect(settings.urls).to.eql(expected);
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { arch, platform } from 'os';
function generateUrls({ version, plugin }) {
return [
plugin,
`https://download.elastic.co/kibana/${plugin}/${plugin}-${version}.zip`
`https://artifacts.elastic.co/download/kibana-plugins/${plugin}/${plugin}-${version}.zip`
];
}

Expand Down
15 changes: 13 additions & 2 deletions src/ui/public/courier/data_source/search_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SearchRequestProvider from '../fetch/request/search';
import SegmentedRequestProvider from '../fetch/request/segmented';
import SearchStrategyProvider from '../fetch/strategy/search';

export default function SearchSourceFactory(Promise, Private) {
export default function SearchSourceFactory(Promise, Private, config) {
let SourceAbstract = Private(AbstractDataSourceProvider);
let SearchRequest = Private(SearchRequestProvider);
let SegmentedRequest = Private(SegmentedRequestProvider);
Expand Down Expand Up @@ -150,8 +150,19 @@ export default function SearchSourceFactory(Promise, Private) {

switch (key) {
case 'filter':
let verifiedFilters = val;
if (config.get('courier:ignoreFilterIfFieldNotInIndex')) {
if (!_.isArray(val)) val = [val];
verifiedFilters = val.filter(function (el) {
if ('meta' in el && 'index' in state) {
const field = state.index.fields.byName[el.meta.key];
if (!field) return false;
}
return true;
});
}
// user a shallow flatten to detect if val is an array, and pull the values out if it is
state.filters = _([ state.filters || [], val ])
state.filters = _([ state.filters || [], verifiedFilters ])
.flatten()
// Yo Dawg! I heard you needed to filter out your filters
.reject(function (filter) {
Expand Down
7 changes: 7 additions & 0 deletions src/ui/settings/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export default function defaultSettingsProvider() {
'elasticsearch. This setting attempts to prevent the list of segments from getting too long, which might ' +
'cause requests to take much longer to process'
},
'courier:ignoreFilterIfFieldNotInIndex': {
value: false,
description: 'This configuration enhances support for dashboards containing visualizations accessing dissimilar indexes. ' +
'When set to false, all filters are applied to all visualizations. ' +
'When set to true, filter(s) will be ignored for a visualization ' +
'when the visualization\'s index does not contain the filtering field.'
},
'fields:popularLimit': {
value: 10,
description: 'The top N most popular fields to show',
Expand Down

0 comments on commit 8578666

Please sign in to comment.