diff --git a/x-pack/plugins/lens/public/app_plugin/app.test.tsx b/x-pack/plugins/lens/public/app_plugin/app.test.tsx index a10b0f436010f..c23bd463cb64d 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.test.tsx @@ -23,8 +23,8 @@ import { createMemoryHistory } from 'history'; import { esFilters, FilterManager, - IFieldType, IndexPattern, + IndexPatternField, Query, } from '../../../../../src/plugins/data/public'; import { TopNavMenuData } from '../../../../../src/plugins/navigation/public'; @@ -155,7 +155,7 @@ describe('Lens App', () => { it('updates global filters with store state', async () => { const services = makeDefaultServices(sessionIdSubject); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const pinnedField = ({ name: 'pinnedField' } as unknown) as IFieldType; + const pinnedField = ({ name: 'pinnedField' } as unknown) as IndexPatternField; const pinnedFilter = esFilters.buildExistsFilter(pinnedField, indexPattern); services.data.query.filterManager.getFilters = jest.fn().mockImplementation(() => { return []; @@ -653,8 +653,8 @@ describe('Lens App', () => { it('saves app filters and does not save pinned filters', async () => { const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; - const pinnedField = ({ name: 'pinnedField' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; + const pinnedField = ({ name: 'pinnedField' } as unknown) as IndexPatternField; const unpinned = esFilters.buildExistsFilter(field, indexPattern); const pinned = esFilters.buildExistsFilter(pinnedField, indexPattern); await act(async () => { @@ -835,7 +835,7 @@ describe('Lens App', () => { it('updates the filters when the user changes them', async () => { const { instance, services, lensStore } = await mountWith({}); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; expect(lensStore.getState()).toEqual({ lens: expect.objectContaining({ filters: [], @@ -890,7 +890,7 @@ describe('Lens App', () => { }), }); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; act(() => services.data.query.filterManager.setFilters([ esFilters.buildExistsFilter(field, indexPattern), @@ -1025,8 +1025,8 @@ describe('Lens App', () => { }) ); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; - const pinnedField = ({ name: 'pinnedField' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; + const pinnedField = ({ name: 'pinnedField' } as unknown) as IndexPatternField; const unpinned = esFilters.buildExistsFilter(field, indexPattern); const pinned = esFilters.buildExistsFilter(pinnedField, indexPattern); FilterManager.setFiltersStore([pinned], esFilters.FilterStateStore.GLOBAL_STATE); @@ -1082,8 +1082,8 @@ describe('Lens App', () => { }) ); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; - const pinnedField = ({ name: 'pinnedField' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; + const pinnedField = ({ name: 'pinnedField' } as unknown) as IndexPatternField; const unpinned = esFilters.buildExistsFilter(field, indexPattern); const pinned = esFilters.buildExistsFilter(pinnedField, indexPattern); FilterManager.setFiltersStore([pinned], esFilters.FilterStateStore.GLOBAL_STATE); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.test.tsx index e687c3ea44422..61e24e2d66347 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.test.tsx @@ -28,7 +28,11 @@ import { ReactWrapper } from 'enzyme'; import { DragDrop, ChildDragDropProvider } from '../../../drag_drop'; import { fromExpression } from '@kbn/interpreter/common'; import { coreMock } from 'src/core/public/mocks'; -import { esFilters, IFieldType, IndexPattern } from '../../../../../../../src/plugins/data/public'; +import { + esFilters, + IndexPattern, + IndexPatternField, +} from '../../../../../../../src/plugins/data/public'; import { UiActionsStart } from '../../../../../../../src/plugins/ui_actions/public'; import { uiActionsPluginMock } from '../../../../../../../src/plugins/ui_actions/public/mocks'; import { TriggerContract } from '../../../../../../../src/plugins/ui_actions/public/triggers'; @@ -416,7 +420,7 @@ describe('workspace_panel', () => { expect(expressionRendererMock).toHaveBeenCalledTimes(1); const indexPattern = ({ id: 'index1' } as unknown) as IndexPattern; - const field = ({ name: 'myfield' } as unknown) as IFieldType; + const field = ({ name: 'myfield' } as unknown) as IndexPatternField; await act(async () => { instance.setProps({ diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts index 1a3451bdb403b..2233c3117623a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts @@ -5,10 +5,12 @@ * 2.0. */ -import { IFieldType } from 'src/plugins/data/common'; -import { IndexPatternColumn, IncompleteColumn } from './operations'; -import { IndexPatternAggRestrictions } from '../../../../../src/plugins/data/public'; -import { DragDropIdentifier } from '../drag_drop/providers'; +import type { IndexPatternColumn, IncompleteColumn } from './operations'; +import type { + IndexPatternField as BaseIndexPatternField, + IndexPatternAggRestrictions, +} from '../../../../../src/plugins/data/public'; +import type { DragDropIdentifier } from '../drag_drop/providers'; export { FieldBasedIndexPatternColumn, @@ -57,7 +59,7 @@ export interface IndexPattern { hasRestrictions: boolean; } -export type IndexPatternField = IFieldType & { +export type IndexPatternField = BaseIndexPatternField & { displayName: string; aggregationRestrictions?: Partial; meta?: boolean;