Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Sep 25, 2020
1 parent 972a2bc commit dbd57f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ describe('createFiltersFromValueClick', () => {
});

test('handles an event when aggregations type is a terms', async () => {
if (dataPoints[0].table.columns[0].meta) {
if (!dataPoints[0].table.columns[0].meta.params) {
dataPoints[0].table.columns[0].meta.params = {};
}
dataPoints[0].table.columns[0].meta.params!.type = 'terms';
}
(dataPoints[0].table.columns[0].meta.sourceParams as any).type = 'terms';
const filters = await createFiltersFromValueClickAction({ data: dataPoints });

expect(filters.length).toEqual(1);
Expand Down
18 changes: 16 additions & 2 deletions src/plugins/expressions/common/expression_types/specs/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { map, pick, zipObject } from 'lodash';
import { ExpressionTypeDefinition } from '../types';
import { PointSeries, PointSeriesColumn } from './pointseries';
import { ExpressionValueRender } from './render';
import { ES_FIELD_TYPES } from '../../../../data/common';

type State = string | number | boolean | null | undefined | SerializableState;

Expand All @@ -43,7 +42,22 @@ export const isDatatable = (datatable: unknown): datatable is Datatable =>
/**
* This type represents the `type` of any `DatatableColumn` in a `Datatable`.
*/
export type DatatableColumnType = ES_FIELD_TYPES;
export type DatatableColumnType =
| '_source'
| 'attachment'
| 'boolean'
| 'date'
| 'geo_point'
| 'geo_shape'
| 'ip'
| 'murmur3'
| 'number'
| 'string'
| 'unknown'
| 'conflict'
| 'object'
| 'nested'
| 'histogram';

/**
* This type represents a row in a `Datatable`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
*/

import { i18n } from '@kbn/i18n';
import {
ExpressionFunctionDefinition,
Datatable,
DatatableColumn,
} from 'src/plugins/expressions';
import { ExpressionFunctionDefinition, Datatable, DatatableColumn } from 'src/plugins/expressions';
import { IndexPatternColumn } from './operations';

interface RemapArgs {
Expand Down

0 comments on commit dbd57f4

Please sign in to comment.