|
8 | 8 | import React, { FC, useMemo } from 'react'; |
9 | 9 | import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; |
10 | 10 | import { i18n } from '@kbn/i18n'; |
11 | | -import { JOB_FIELD_TYPES, JobFieldType } from '../../../../../common'; |
| 11 | +import { JOB_FIELD_TYPES_OPTIONS, JobFieldType } from '../../../../../common'; |
12 | 12 | import { FieldTypeIcon } from '../../../common/components/field_type_icon'; |
13 | 13 | import { MultiSelectPicker, Option } from '../../../common/components/multi_select_picker'; |
14 | 14 |
|
15 | | -const ML_JOB_FIELD_TYPES_OPTIONS = { |
16 | | - [JOB_FIELD_TYPES.BOOLEAN]: { name: 'Boolean', icon: 'tokenBoolean' }, |
17 | | - [JOB_FIELD_TYPES.DATE]: { name: 'Date', icon: 'tokenDate' }, |
18 | | - [JOB_FIELD_TYPES.GEO_POINT]: { name: 'Geo point', icon: 'tokenGeo' }, |
19 | | - [JOB_FIELD_TYPES.GEO_SHAPE]: { name: 'Geo shape', icon: 'tokenGeo' }, |
20 | | - [JOB_FIELD_TYPES.IP]: { name: 'IP address', icon: 'tokenIP' }, |
21 | | - [JOB_FIELD_TYPES.KEYWORD]: { name: 'Keyword', icon: 'tokenKeyword' }, |
22 | | - [JOB_FIELD_TYPES.NUMBER]: { name: 'Number', icon: 'tokenNumber' }, |
23 | | - [JOB_FIELD_TYPES.TEXT]: { name: 'Text', icon: 'tokenString' }, |
24 | | - [JOB_FIELD_TYPES.UNKNOWN]: { name: 'Unknown' }, |
25 | | -}; |
26 | | - |
27 | 15 | export const DatavisualizerFieldTypeFilter: FC<{ |
28 | 16 | indexedFieldTypes: JobFieldType[]; |
29 | 17 | setVisibleFieldTypes(q: string[]): void; |
30 | 18 | visibleFieldTypes: string[]; |
31 | 19 | }> = ({ indexedFieldTypes, setVisibleFieldTypes, visibleFieldTypes }) => { |
32 | 20 | const options: Option[] = useMemo(() => { |
33 | 21 | return indexedFieldTypes.map((indexedFieldName) => { |
34 | | - const item = ML_JOB_FIELD_TYPES_OPTIONS[indexedFieldName]; |
| 22 | + const item = JOB_FIELD_TYPES_OPTIONS[indexedFieldName]; |
35 | 23 |
|
36 | 24 | return { |
37 | 25 | value: indexedFieldName, |
|
0 commit comments