mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
316ddaf53f
commit
383437d3df
16 changed files with 17 additions and 16 deletions
|
@ -186,7 +186,7 @@ export function CoordinateMapsVisualizationProvider(Notifier, Private) {
|
|||
return;
|
||||
}
|
||||
|
||||
const indexPatternName = agg.vis.indexPattern.id;
|
||||
const indexPatternName = agg._indexPattern.id;
|
||||
const field = agg.fieldName();
|
||||
const filter = { meta: { negate: false, index: indexPatternName } };
|
||||
filter[filterName] = { ignore_unmapped: true };
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('editor', function () {
|
|||
]
|
||||
});
|
||||
|
||||
const $el = $('<vis-editor-agg-params agg="agg" index-pattern="vis.indexPattern" group-name="groupName"></vis-editor-agg-params>');
|
||||
const $el = $('<vis-editor-agg-params agg="agg" index-pattern="agg._indexPattern" group-name="groupName"></vis-editor-agg-params>');
|
||||
const $parentScope = $injector.get('$rootScope').$new();
|
||||
|
||||
agg = $parentScope.agg = vis.aggs.bySchemaName.segment[0];
|
||||
|
|
|
@ -28,5 +28,5 @@ export function createFilterDateHistogram(agg, key) {
|
|||
gte: start.valueOf(),
|
||||
lt: start.add(interval).valueOf(),
|
||||
format: 'epoch_millis'
|
||||
}, agg.vis.indexPattern);
|
||||
}, agg._indexPattern);
|
||||
}
|
||||
|
|
|
@ -31,5 +31,5 @@ export function createFilterDateRange(agg, key) {
|
|||
if (range.to) filter.lt = +range.to;
|
||||
if (range.to && range.from) filter.format = 'epoch_millis';
|
||||
|
||||
return buildRangeFilter(agg.params.field, filter, agg.vis.indexPattern);
|
||||
return buildRangeFilter(agg.params.field, filter, agg._indexPattern);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,6 @@ export function createFilterFilters(aggConfig, key) {
|
|||
const filter = dslFilters[key];
|
||||
|
||||
if (filter) {
|
||||
return buildQueryFilter(filter.query, aggConfig.vis.indexPattern.id);
|
||||
return buildQueryFilter(filter.query, aggConfig._indexPattern.id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ export function createFilterHistogram(aggConfig, key) {
|
|||
return buildRangeFilter(
|
||||
aggConfig.params.field,
|
||||
{ gte: value, lt: value + aggConfig.params.interval },
|
||||
aggConfig.vis.indexPattern,
|
||||
aggConfig._indexPattern,
|
||||
aggConfig.fieldFormatter()(key)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -32,5 +32,5 @@ export function createFilterIpRange(aggConfig, key) {
|
|||
};
|
||||
}
|
||||
|
||||
return buildRangeFilter(aggConfig.params.field, { gte: range.from, lte: range.to }, aggConfig.vis.indexPattern);
|
||||
return buildRangeFilter(aggConfig.params.field, { gte: range.from, lte: range.to }, aggConfig._indexPattern);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ export function createFilterRange(aggConfig, key) {
|
|||
return buildRangeFilter(
|
||||
aggConfig.params.field,
|
||||
key,
|
||||
aggConfig.vis.indexPattern,
|
||||
aggConfig._indexPattern,
|
||||
aggConfig.fieldFormatter()(key)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ export const dateHistogramBucketAgg = new BucketAggType({
|
|||
name: 'field',
|
||||
filterFieldTypes: 'date',
|
||||
default: function (agg) {
|
||||
return agg.vis.indexPattern.timeFieldName;
|
||||
return agg._indexPattern.timeFieldName;
|
||||
},
|
||||
onChange: function (agg) {
|
||||
if (_.get(agg, 'params.interval.val') === 'auto' && !agg.fieldIsTimeField()) {
|
||||
|
|
|
@ -43,7 +43,7 @@ export const dateRangeBucketAgg = new BucketAggType({
|
|||
name: 'field',
|
||||
filterFieldTypes: 'date',
|
||||
default: function (agg) {
|
||||
return agg.vis.indexPattern.timeFieldName;
|
||||
return agg._indexPattern.timeFieldName;
|
||||
}
|
||||
}, {
|
||||
name: 'ranges',
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<div class="hintbox" ng-if="!indexedFields.length">
|
||||
<p>
|
||||
<i class="fa fa-danger text-danger"></i>
|
||||
<strong>No Compatible Fields:</strong> The "{{ vis.indexPattern.title }}" index pattern does not contain any of the following field types: {{ agg.type.params.byName.field.filterFieldTypes | commaList:false }}
|
||||
<strong>No Compatible Fields:</strong> The "{{ agg._indexPattern.title }}" index pattern does not contain any of the following field types: {{ agg.type.params.byName.field.filterFieldTypes | commaList:false }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
<div ng-show="agg.params.orderAgg" class="vis-editor-agg-order-agg">
|
||||
<vis-editor-agg-params
|
||||
index-pattern="vis.indexPattern"
|
||||
index-pattern="agg._indexPattern"
|
||||
agg="agg.params.orderAgg"
|
||||
ng-if="agg.params.orderAgg"
|
||||
group-name="'metrics'">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<div ng-if="agg.params.metricAgg === 'custom'" class="vis-editor-agg-order-agg">
|
||||
<ng-form name="customMetricForm">
|
||||
<vis-editor-agg-params
|
||||
index-pattern="vis.indexPattern"
|
||||
index-pattern="agg._indexPattern"
|
||||
agg="agg.params.customMetric"
|
||||
group-name="'metrics'">
|
||||
</vis-editor-agg-params>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<ng-form name="{{aggType}}Form">
|
||||
<vis-editor-agg-params
|
||||
agg="agg.params[aggType]"
|
||||
index-pattern="vis.indexPattern"
|
||||
index-pattern="agg._indexPattern"
|
||||
group-name="'{{aggGroup}}'">
|
||||
</vis-editor-agg-params>
|
||||
</ng-form>
|
||||
|
|
|
@ -137,7 +137,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
editor: null,
|
||||
filterFieldTypes: [ 'number', 'date', 'ip', 'string' ],
|
||||
default: function (agg) {
|
||||
return agg.vis.indexPattern.timeFieldName;
|
||||
return agg._indexPattern.timeFieldName;
|
||||
},
|
||||
write: _.noop // prevent default write, it is handled below
|
||||
},
|
||||
|
@ -187,7 +187,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
const path = agg.params.field.name;
|
||||
|
||||
let values = _(hits).map(hit => {
|
||||
return path === '_source' ? hit._source : agg.vis.indexPattern.flattenHit(hit, true)[path];
|
||||
return path === '_source' ? hit._source : agg._indexPattern.flattenHit(hit, true)[path];
|
||||
})
|
||||
.flatten()
|
||||
.value();
|
||||
|
|
|
@ -65,6 +65,7 @@ class AggConfig {
|
|||
constructor(vis, opts = {}) {
|
||||
this.id = String(opts.id || AggConfig.nextId(vis.aggs));
|
||||
this.vis = vis;
|
||||
this._indexPattern = vis.indexPattern;
|
||||
this._opts = opts;
|
||||
this.enabled = typeof opts.enabled === 'boolean' ? opts.enabled : true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue