Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 5, 2020
1 parent dc83371 commit bd866a9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/maps/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const EMS_XYZ = 'EMS_XYZ'; // identifies a custom TMS source. Name is a l
export enum FIELD_ORIGIN {
SOURCE = 'source',
JOIN = 'join',
};
}

export const SOURCE_DATA_ID_ORIGIN = 'source';
export const META_ID_ORIGIN_SUFFIX = 'meta';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IESSource } from './es_source';
import { AbstractESSource } from './es_source';
import { AGG_TYPE } from '../../../common/constants';


export interface IESAggSource extends IESSource {
getAggKey(aggType: AGG_TYPE, fieldName: string): string;
getAggLabel(aggType: AGG_TYPE, fieldName: string): string;
Expand Down
13 changes: 3 additions & 10 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 @@ -55,16 +55,9 @@ export class AbstractESAggSource extends AbstractESSource {

getMetricFields() {
const metrics = this._metricFields.filter(esAggField => esAggField.isValid());
if (metrics.length === 0) {
metrics.push(
new ESAggMetricField({
aggType: AGG_TYPE.COUNT,
source: this,
origin: this.getOriginForField(),
})
);
}
return metrics;
return metrics.length === 0
? esAggFieldsFactory({ type: AGG_TYPE.COUNT }, this, this.getOriginForField())
: metrics;
}

getAggKey(aggType, fieldName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export class DynamicStyleProperty extends AbstractStyleProperty {

async getFieldMetaRequest() {
if (this.isOrdinal()) {
const fieldMetaOptions = this.getFieldMetaOptions();
return this._field.getOrdinalFieldMetaRequest();
} else if (this.isCategorical()) {
return this._field.getCategoricalFieldMetaRequest();
Expand Down

0 comments on commit bd866a9

Please sign in to comment.