mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Don't prevent filterable rows from being filterable (#11628)
* Don't prevent filterable rows just because they don't have a field * Don't allow filtering on unfilterable fields * Move isFilterable to aggConfig
This commit is contained in:
parent
d5ee251dbd
commit
9509d9e89b
2 changed files with 8 additions and 4 deletions
|
@ -40,10 +40,10 @@ module.directive('kbnRows', function ($compile, $rootScope, getAppState, Private
|
|||
let $cellContent;
|
||||
|
||||
if (contents instanceof AggConfigResult) {
|
||||
const field = contents.aggConfig.getField();
|
||||
const isCellContentFilterable =
|
||||
contents.type === 'bucket'
|
||||
&& contents.aggConfig.getField()
|
||||
&& contents.aggConfig.getField().filterable;
|
||||
contents.aggConfig.isFilterable()
|
||||
&& (!field || field.filterable);
|
||||
|
||||
if (isCellContentFilterable) {
|
||||
$cell = createFilterableCell(contents);
|
||||
|
|
|
@ -163,8 +163,12 @@ export function VisAggConfigProvider(Private) {
|
|||
return this.type.params.write(this);
|
||||
};
|
||||
|
||||
AggConfig.prototype.isFilterable = function () {
|
||||
return _.isFunction(this.type.createFilter);
|
||||
};
|
||||
|
||||
AggConfig.prototype.createFilter = function (key) {
|
||||
if (!_.isFunction(this.type.createFilter)) {
|
||||
if (!this.isFilterable()) {
|
||||
throw new TypeError('The "' + this.type.title + '" aggregation does not support filtering.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue