Skip to content

Commit 95d704c

Browse files
author
spalger
committed
[aggParams/field] support aggParamType#scriptable
1 parent 2dbb462 commit 95d704c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/ui/public/agg_types/buckets/significant_terms.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default function SignificantTermsAggDefinition(Private) {
1616
params: [
1717
{
1818
name: 'field',
19+
scriptable: false,
1920
filterFieldTypes: 'string'
2021
},
2122
{

src/ui/public/agg_types/buckets/terms.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export default function TermsAggDefinition(Private) {
4343
params: [
4444
{
4545
name: 'field',
46-
scriptable: true,
4746
filterFieldTypes: ['number', 'boolean', 'date', 'ip', 'string']
4847
},
4948
{

src/ui/public/agg_types/param_types/field.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function FieldAggParamFactory(Private, $filter) {
1414
}
1515

1616
FieldAggParam.prototype.editor = editorHtml;
17-
FieldAggParam.prototype.scriptable = false;
17+
FieldAggParam.prototype.scriptable = true;
1818
FieldAggParam.prototype.filterFieldTypes = '*';
1919

2020
/**
@@ -36,6 +36,10 @@ export default function FieldAggParamFactory(Private, $filter) {
3636

3737
fields = fields.filter(f => f.aggregatable);
3838

39+
if (!this.scriptable) {
40+
fields = fields.filter(field => !field.scripted);
41+
}
42+
3943
if (this.filterFieldTypes) {
4044
fields = $filter('fieldType')(fields, this.filterFieldTypes);
4145
}

0 commit comments

Comments
 (0)