Skip to content

Commit

Permalink
ts lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 6, 2020
1 parent 468994d commit 2467231
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { IField } from '../fields/field';
import { IESAggSource } from './es_agg_source';

// TODO extend AbstractESAggSource once its merged
export interface IESTermSource {
export interface IESTermSource extends IESAggSource {
getTermField(): IField;
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,22 @@ export class ESTooltipProperty implements ITooltipProperty {
}

isFilterable(): boolean {
const field = this._getIndexPatternField();
const indexPatternField = this._getIndexPatternField();
return (
field &&
(field.type === 'string' ||
field.type === 'date' ||
field.type === 'ip' ||
field.type === 'number')
!!indexPatternField &&
(indexPatternField.type === 'string' ||
indexPatternField.type === 'date' ||
indexPatternField.type === 'ip' ||
indexPatternField.type === 'number')
);
}

async getESFilters(): Promise<unknown> {
return [
esFilters.buildPhraseFilter(
this._getIndexPatternField(),
this.getRawValue(),
this._indexPattern
),
];
async getESFilters(): Promise<unknown[]> {
const indexPatternField = this._getIndexPatternField();
if (!indexPatternField) {
return [];
}

return [esFilters.buildPhraseFilter(indexPatternField, this.getRawValue(), this._indexPattern)];
}
}

0 comments on commit 2467231

Please sign in to comment.