mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[aggParams/field] support aggParamType#scriptable
This commit is contained in:
parent
2dbb462bc1
commit
95d704c37c
3 changed files with 6 additions and 2 deletions
|
@ -16,6 +16,7 @@ export default function SignificantTermsAggDefinition(Private) {
|
|||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
scriptable: false,
|
||||
filterFieldTypes: 'string'
|
||||
},
|
||||
{
|
||||
|
|
|
@ -43,7 +43,6 @@ export default function TermsAggDefinition(Private) {
|
|||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
scriptable: true,
|
||||
filterFieldTypes: ['number', 'boolean', 'date', 'ip', 'string']
|
||||
},
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function FieldAggParamFactory(Private, $filter) {
|
|||
}
|
||||
|
||||
FieldAggParam.prototype.editor = editorHtml;
|
||||
FieldAggParam.prototype.scriptable = false;
|
||||
FieldAggParam.prototype.scriptable = true;
|
||||
FieldAggParam.prototype.filterFieldTypes = '*';
|
||||
|
||||
/**
|
||||
|
@ -36,6 +36,10 @@ export default function FieldAggParamFactory(Private, $filter) {
|
|||
|
||||
fields = fields.filter(f => f.aggregatable);
|
||||
|
||||
if (!this.scriptable) {
|
||||
fields = fields.filter(field => !field.scripted);
|
||||
}
|
||||
|
||||
if (this.filterFieldTypes) {
|
||||
fields = $filter('fieldType')(fields, this.filterFieldTypes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue