Skip to content

Commit

Permalink
remove unused implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Jan 16, 2020
1 parent 742f332 commit 6be988d
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,8 @@ export class AbstractESAggSource extends AbstractESSource {
return this.getMetricFieldForName(name);
}

createField({ fieldName, label }) {
//if there is a corresponding field with a custom label, use that one.
if (!label) {
const matchField = this._metricFields.find(field => field.getName() === fieldName);
if (matchField) {
label = matchField.getLabel();
}
}

if (fieldName === COUNT_PROP_NAME) {
return new ESAggMetricField({
aggType: COUNT_AGG_TYPE,
label: label,
source: this,
origin: this.getOriginForField(),
});
}
//this only works because aggType is a fixed set and does not include the `_of_` string
const [aggType, docField] = fieldName.split(AGG_DELIMITER);
const esDocField = new ESDocField({ fieldName: docField, source: this });
return new ESAggMetricField({
label: label,
esDocField,
aggType,
source: this,
origin: this.getOriginForField(),
});
createField() {
throw new Error('Cannot create a new field from just a fieldname for an es_agg_source.');
}

hasMatchingMetricField(fieldName) {
Expand Down

0 comments on commit 6be988d

Please sign in to comment.