Skip to content

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Aug 26, 2021
1 parent 13e363a commit 39cbc2e
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import _ from 'lodash';
import { IndexPattern, IndexPatternField } from '../../../../../src/plugins/data/common';
import type { IndexPattern, IndexPatternField } from 'src/plugins/data/common';
import { AGG_TYPE, JOIN_FIELD_NAME_PREFIX, TOP_TERM_PERCENTAGE_SUFFIX } from '../constants';

export type BucketProperties = Record<string | number, unknown>;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/public/classes/fields/es_doc_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import type { IndexPatternField } from 'src/plugins/data/public';
import { FIELD_ORIGIN } from '../../../common/constants';
import { ESTooltipProperty } from '../tooltips/es_tooltip_property';
import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property';
import { indexPatterns } from '../../../../../../src/plugins/data/public';
import { IndexPatternField } from '../../../../../../src/plugins/data/public';
import { IField, AbstractField } from './field';
import { IESSource } from '../sources/es_source';
import { IVectorSource } from '../sources/vector_source';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ import React, { Fragment, Component } from 'react';

import { FormattedMessage } from '@kbn/i18n/react';
import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import {
IndexPatternField,
IndexPattern,
indexPatterns,
} from '../../../../../../../src/plugins/data/public';
import type { IndexPatternField, IndexPattern } from 'src/plugins/data/public';
import { indexPatterns } from '../../../../../../../src/plugins/data/public';
import { MetricsEditor } from '../../../components/metrics_editor';
import { getIndexPatternService } from '../../../kibana_services';
import { GeoLineForm } from './geo_line_form';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
import React, { Component } from 'react';
import { EuiPanel } from '@elastic/eui';

import type { IndexPattern, IndexPatternField } from 'src/plugins/data/public';
import { SCALING_TYPES } from '../../../../../common/constants';
import { GeoFieldSelect } from '../../../../components/geo_field_select';
import { GeoIndexPatternSelect } from '../../../../components/geo_index_pattern_select';
import { getGeoFields, getTermsFields, getSortFields } from '../../../../index_pattern_util';
import { ESSearchSourceDescriptor } from '../../../../../common/descriptor_types';
import {
IndexPattern,
IndexPatternField,
SortDirection,
} from '../../../../../../../../src/plugins/data/common';
import { SortDirection } from '../../../../../../../../src/plugins/data/public';
import { TopHitsForm } from './top_hits_form';
import { OnSourceChangeArgs } from '../../source';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import React, { ChangeEvent, Component, Fragment } from 'react';
import { EuiFormRow, EuiSelect } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { IndexPatternField } from 'src/plugins/data/public';
import { SingleFieldSelect } from '../../../../components/single_field_select';
import { getIndexPatternService } from '../../../../kibana_services';
// @ts-expect-error
import { ValidatedRange } from '../../../../components/validated_range';
import { DEFAULT_MAX_INNER_RESULT_WINDOW } from '../../../../../common/constants';
import { loadIndexSettings } from '../util/load_index_settings';
import { OnSourceChangeArgs } from '../../source';
import { IndexPatternField, SortDirection } from '../../../../../../../../src/plugins/data/public';
import { SortDirection } from '../../../../../../../../src/plugins/data/public';

interface Props {
indexPatternId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import React, { Component, Fragment } from 'react';
import { EuiFormRow, EuiTitle, EuiPanel, EuiSpacer, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import type { IndexPatternField } from 'src/plugins/data/public';
import { FIELD_ORIGIN } from '../../../../../common/constants';
import { TooltipSelector } from '../../../../components/tooltip_selector';

import { getIndexPatternService } from '../../../../kibana_services';
import { getTermsFields, getSortFields, getSourceFields } from '../../../../index_pattern_util';
import { SortDirection, IndexPatternField } from '../../../../../../../../src/plugins/data/public';
import { SortDirection } from '../../../../../../../../src/plugins/data/public';
import { ESDocField } from '../../../fields/es_doc_field';
import { OnSourceChangeArgs } from '../../source';
import { TopHitsForm } from './top_hits_form';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/

import { getDocValueAndSourceFields } from './get_docvalue_source_fields';
import { IndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns/index_patterns';
import { IndexPatternField } from '../../../../../../../../src/plugins/data/common/index_patterns/fields';
import type { IndexPatternField, IndexPattern } from 'src/plugins/data/public';

function createMockIndexPattern(fields: IndexPatternField[]): IndexPattern {
const indexPattern = {
Expand All @@ -29,9 +28,8 @@ describe('getDocValueAndSourceFields', () => {
createMockIndexPattern([
{
name: 'foobar',
// @ts-expect-error runtimeField not added yet to IndexPatternField. API tbd
runtimeField: {},
},
runtimeField: { type: 'keyword' },
} as IndexPatternField,
]),
['foobar'],
'epoch_millis'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IndexPatternField, IndexPattern } from '../../../../../../src/plugins/data/public';
import type { IndexPatternField, IndexPattern } from 'src/plugins/data/public';
import { ESTooltipProperty } from './es_tooltip_property';
import { TooltipProperty } from './tooltip_property';
import { AbstractField } from '../fields/field';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/public/components/geo_field_select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
import { EuiFormRow } from '@elastic/eui';
import type { IndexPatternField } from 'src/plugins/data/common';
import { SingleFieldSelect } from './single_field_select';
import { IndexPatternField } from '../../../../../src/plugins/data/common';

interface Props {
value: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { i18n } from '@kbn/i18n';
import { EuiButtonEmpty, EuiComboBoxOptionOption, EuiFieldText, EuiFormRow } from '@elastic/eui';

import { FormattedMessage } from '@kbn/i18n/react';
import type { IndexPatternField } from 'src/plugins/data/public';
import { MetricSelect } from './metric_select';
import { SingleFieldSelect } from '../single_field_select';
import { AggDescriptor } from '../../../common/descriptor_types';
import { AGG_TYPE, DEFAULT_PERCENTILE } from '../../../common/constants';
import { getTermsFields } from '../../index_pattern_util';
import { IndexPatternField } from '../../../../../../src/plugins/data/public';
import { ValidatedNumberInput } from '../validated_number_input';

function filterFieldsForAgg(fields: IndexPatternField[], aggType: AGG_TYPE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import React, { Component, Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiButtonEmpty, EuiComboBoxOptionOption, EuiSpacer, EuiTextAlign } from '@elastic/eui';
import type { IndexPatternField } from 'src/plugins/data/public';
import { MetricEditor } from './metric_editor';
import { DEFAULT_METRIC } from '../../classes/sources/es_agg_source';
import { IndexPatternField } from '../../../../../../src/plugins/data/public';
import { AggDescriptor, FieldedAggDescriptor } from '../../../common/descriptor_types';
import { AGG_TYPE } from '../../../common/constants';

Expand Down
20 changes: 10 additions & 10 deletions x-pack/plugins/maps/public/index_pattern_util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ import { IndexPatternField } from 'src/plugins/data/public';
describe('getSourceFields', () => {
test('Should remove multi fields from field list', () => {
const fields = [
({
{
name: 'agent',
type: 'string',
} as unknown) as IndexPatternField,
({
} as IndexPatternField,
{
name: 'agent.keyword',
subType: {
multi: {
parent: 'agent',
},
},
type: 'string',
} as unknown) as IndexPatternField,
} as IndexPatternField,
];
const sourceFields = getSourceFields(fields);
expect(sourceFields).toEqual([{ name: 'agent', type: 'string' }]);
Expand All @@ -41,29 +41,29 @@ describe('getSourceFields', () => {
describe('Gold+ licensing', () => {
const testStubs = [
{
field: ({
field: {
name: 'location',
type: 'geo_point',
aggregatable: true,
} as unknown) as IndexPatternField,
} as IndexPatternField,
supportedInBasic: true,
supportedInGold: true,
},
{
field: ({
field: {
name: 'location',
type: 'geo_shape',
aggregatable: false,
} as unknown) as IndexPatternField,
} as IndexPatternField,
supportedInBasic: false,
supportedInGold: false,
},
{
field: ({
field: {
name: 'location',
type: 'geo_shape',
aggregatable: true,
} as unknown) as IndexPatternField,
} as IndexPatternField,
supportedInBasic: false,
supportedInGold: true,
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/public/index_pattern_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IndexPatternField, IndexPattern } from 'src/plugins/data/public';
import type { IndexPatternField, IndexPattern } from 'src/plugins/data/public';
import { i18n } from '@kbn/i18n';
import { getIndexPatternService } from './kibana_services';
import { indexPatterns } from '../../../../src/plugins/data/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import _ from 'lodash';
import { SavedObject } from 'kibana/server';
import { IndexPatternField } from 'src/plugins/data/public';
import type { IndexPatternField } from 'src/plugins/data/public';
import {
ES_GEO_FIELD_TYPE,
LAYER_TYPE,
Expand Down

0 comments on commit 39cbc2e

Please sign in to comment.