diff --git a/src/legacy/core_plugins/data/public/expressions/expressions_service.ts b/src/legacy/core_plugins/data/public/expressions/expressions_service.ts index f22caf3d43ece..bb2ca806bbac3 100644 --- a/src/legacy/core_plugins/data/public/expressions/expressions_service.ts +++ b/src/legacy/core_plugins/data/public/expressions/expressions_service.ts @@ -24,13 +24,15 @@ import { Ast } from '@kbn/interpreter/common'; // the interpreter plugin itself once they are ready import { Registry } from '@kbn/interpreter/common'; import { Adapters } from 'ui/inspector'; -import { Query, Filters, TimeRange } from 'ui/embeddable'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; import { createRenderer } from './expression_renderer'; import { createRunFn } from './expression_runner'; +import { Query } from '../query'; export interface InitialContextObject { timeRange?: TimeRange; - filters?: Filters; + filters?: Filter[]; query?: Query; } diff --git a/src/legacy/core_plugins/embeddable_api/public/index.ts b/src/legacy/core_plugins/embeddable_api/public/index.ts index cdf0ce7e92ef3..7b80fe4b51664 100644 --- a/src/legacy/core_plugins/embeddable_api/public/index.ts +++ b/src/legacy/core_plugins/embeddable_api/public/index.ts @@ -29,7 +29,7 @@ export { isErrorEmbeddable, } from './embeddables'; -export { Query, TimeRange, ViewMode, QueryLanguageType, Trigger, IRegistry } from './types'; +export { ViewMode, Trigger, IRegistry } from './types'; export { actionRegistry, Action, ActionContext, IncompatibleActionError } from './actions'; diff --git a/src/legacy/core_plugins/embeddable_api/public/types.ts b/src/legacy/core_plugins/embeddable_api/public/types.ts index 521666acb0308..ebb51ac199c28 100644 --- a/src/legacy/core_plugins/embeddable_api/public/types.ts +++ b/src/legacy/core_plugins/embeddable_api/public/types.ts @@ -49,17 +49,3 @@ export enum ViewMode { EDIT = 'edit', VIEW = 'view', } -export interface TimeRange { - to: string; - from: string; -} - -export enum QueryLanguageType { - KUERY = 'kuery', - LUCENE = 'lucene', -} - -export interface Query { - language: QueryLanguageType; - query: string; -} diff --git a/src/legacy/core_plugins/interpreter/common/types/kibana_context.ts b/src/legacy/core_plugins/interpreter/common/types/kibana_context.ts index 4cd64d92743b0..89c976611c8f0 100644 --- a/src/legacy/core_plugins/interpreter/common/types/kibana_context.ts +++ b/src/legacy/core_plugins/interpreter/common/types/kibana_context.ts @@ -17,14 +17,16 @@ * under the License. */ -import { Filters, Query, TimeRange } from 'ui/visualize'; +import { Query } from 'src/legacy/core_plugins/data/public'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; const name = 'kibana_context'; export interface KibanaContext { type: typeof name; query?: Query; - filters?: Filters; + filters?: Filter[]; timeRange?: TimeRange; } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts index ef9cfaf05d626..205479032b36e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts @@ -20,8 +20,10 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { createAction } from 'redux-actions'; -import { Filters, Query, TimeRange } from 'ui/embeddable'; import { RefreshInterval } from 'ui/timefilter/timefilter'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { KibanaAction } from '../../selectors/types'; import { DashboardViewMode } from '../dashboard_view_mode'; import { PanelId } from '../selectors'; @@ -72,7 +74,7 @@ export interface UpdateRefreshConfigAction extends KibanaAction {} export interface UpdateFiltersAction - extends KibanaAction {} + extends KibanaAction {} export interface UpdateQueryAction extends KibanaAction {} @@ -108,5 +110,5 @@ export const updateTimeRange = createAction(ViewActionTypeKeys.UPDATE export const updateRefreshConfig = createAction( ViewActionTypeKeys.UPDATE_REFRESH_CONFIG ); -export const updateFilters = createAction(ViewActionTypeKeys.UPDATE_FILTERS); +export const updateFilters = createAction(ViewActionTypeKeys.UPDATE_FILTERS); export const updateQuery = createAction(ViewActionTypeKeys.UPDATE_QUERY); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx index 30a323ddb3393..6c1edb867280b 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx @@ -47,7 +47,7 @@ import * as filterActions from 'plugins/kibana/discover/doc_table/actions/filter // @ts-ignore import { FilterManagerProvider } from 'ui/filter_manager'; import { EmbeddableFactoriesRegistryProvider } from 'ui/embeddable/embeddable_factories_registry'; -import { ContextMenuActionsRegistryProvider, Query, EmbeddableFactory } from 'ui/embeddable'; +import { ContextMenuActionsRegistryProvider, EmbeddableFactory } from 'ui/embeddable'; import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; import { timefilter } from 'ui/timefilter'; @@ -63,7 +63,7 @@ import { Filter } from '@kbn/es-query'; import { TimeRange } from 'ui/timefilter/time_history'; import { IndexPattern } from 'ui/index_patterns'; import { IPrivate } from 'ui/private'; -import { StaticIndexPattern } from 'src/legacy/core_plugins/data/public'; +import { StaticIndexPattern, Query } from 'src/legacy/core_plugins/data/public'; import { SaveOptions } from 'ui/saved_objects/saved_object'; import moment from 'moment'; import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts index 99e6565389bdf..40dfd633d5e99 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts @@ -23,11 +23,12 @@ import _ from 'lodash'; import { stateMonitorFactory, StateMonitor } from 'ui/state_management/state_monitor_factory'; import { StaticIndexPattern } from 'ui/index_patterns'; import { AppStateClass as TAppStateClass } from 'ui/state_management/app_state'; -import { TimeRange, Query } from 'ui/embeddable'; import { Timefilter } from 'ui/timefilter'; import { Filter } from '@kbn/es-query'; import moment from 'moment'; import { RefreshInterval } from 'ui/timefilter/timefilter'; +import { Query } from 'src/legacy/core_plugins/data/public'; +import { TimeRange } from 'ui/timefilter/time_history'; import { DashboardViewMode } from './dashboard_view_mode'; import { FilterUtils } from './lib/filter_utils'; import { PanelUtils } from './panel/panel_utils'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts index c1fbae7015883..8c1a1585caab7 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts @@ -20,9 +20,10 @@ import { cloneDeep } from 'lodash'; import { Reducer } from 'redux'; -import { Filters, Query, TimeRange } from 'ui/embeddable'; -import { QueryLanguageType } from 'ui/embeddable/types'; import { RefreshInterval } from 'ui/timefilter/timefilter'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { ViewActions, ViewActionTypeKeys } from '../actions'; import { DashboardViewMode } from '../dashboard_view_mode'; import { PanelId, ViewState } from '../selectors'; @@ -67,7 +68,7 @@ const updateRefreshConfig = (view: ViewState, refreshConfig: RefreshInterval) => refreshConfig, }); -const updateFilters = (view: ViewState, filters: Filters) => ({ +const updateFilters = (view: ViewState, filters: Filter[]) => ({ ...view, filters: cloneDeep(filters), }); @@ -92,7 +93,7 @@ export const viewReducer: Reducer = ( filters: [], hidePanelTitles: false, isFullScreenMode: false, - query: { language: QueryLanguageType.LUCENE, query: '' }, + query: { language: 'lucene', query: '' }, timeRange: { to: 'now', from: 'now-15m' }, refreshConfig: { pause: true, value: 0 }, useMargins: true, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/selectors/dashboard.ts b/src/legacy/core_plugins/kibana/public/dashboard/selectors/dashboard.ts index 0fa28366e5834..47d771de41522 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/selectors/dashboard.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/selectors/dashboard.ts @@ -18,10 +18,12 @@ */ import _ from 'lodash'; -import { ContainerState, EmbeddableMetadata, Query, TimeRange } from 'ui/embeddable'; +import { ContainerState, EmbeddableMetadata } from 'ui/embeddable'; import { EmbeddableCustomization } from 'ui/embeddable/types'; import { Filter } from '@kbn/es-query'; import { RefreshInterval } from 'ui/timefilter/timefilter'; +import { Query } from 'src/legacy/core_plugins/data/public'; +import { TimeRange } from 'ui/timefilter/time_history'; import { DashboardViewMode } from '../dashboard_view_mode'; import { DashboardMetadata, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/selectors/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/selectors/types.ts index 8097758d0ef0a..befb6f6936105 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/selectors/types.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/selectors/types.ts @@ -17,9 +17,11 @@ * under the License. */ -import { EmbeddableMetadata, Query, TimeRange } from 'ui/embeddable'; +import { EmbeddableMetadata } from 'ui/embeddable'; import { Filter } from '@kbn/es-query'; import { RefreshInterval } from 'ui/timefilter/timefilter'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { DashboardViewMode } from '../dashboard_view_mode'; import { SavedDashboardPanelMap } from '../types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/types.ts index 5bb2f783b94a9..c9ffd653f1f06 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/types.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/types.ts @@ -17,10 +17,11 @@ * under the License. */ -import { Query, EmbeddableFactory } from 'ui/embeddable'; +import { EmbeddableFactory } from 'ui/embeddable'; import { AppState } from 'ui/state_management/app_state'; import { UIRegistry } from 'ui/registry/_registry'; import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { DashboardViewMode } from './dashboard_view_mode'; export interface EmbeddableFactoryRegistry extends UIRegistry { diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts index fe5b9994c574e..6976036b9b742 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts @@ -26,12 +26,13 @@ import { Embeddable, EmbeddableState, OnEmbeddableStateChanged, - TimeRange, } from 'ui/embeddable'; -import { Filters, Query } from 'ui/embeddable/types'; import { RequestAdapter } from 'ui/inspector/adapters'; import { Adapters } from 'ui/inspector/types'; import { getTime } from 'ui/timefilter/get_time'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import * as columnActions from '../doc_table/actions/columns'; import { SavedSearch } from '../types'; import searchTemplate from './search_template.html'; @@ -75,7 +76,7 @@ export class SearchEmbeddable extends Embeddable { private panelTitle: string = ''; private filtersSearchSource: SearchSource; private timeRange?: TimeRange; - private filters?: Filters; + private filters?: Filter[]; private query?: Query; private searchInstance?: JQLite; diff --git a/src/legacy/core_plugins/kibana/public/selectors/dashboard_selectors.ts b/src/legacy/core_plugins/kibana/public/selectors/dashboard_selectors.ts index 388483c5c1c03..85a702cb93296 100644 --- a/src/legacy/core_plugins/kibana/public/selectors/dashboard_selectors.ts +++ b/src/legacy/core_plugins/kibana/public/selectors/dashboard_selectors.ts @@ -17,8 +17,9 @@ * under the License. */ -import { Query, TimeRange } from 'ui/embeddable'; import { Filter } from '@kbn/es-query'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { DashboardViewMode } from '../dashboard/dashboard_view_mode'; import * as DashboardSelectors from '../dashboard/selectors'; import { PanelId } from '../dashboard/selectors/types'; diff --git a/src/legacy/core_plugins/kibana/public/store.ts b/src/legacy/core_plugins/kibana/public/store.ts index 47458bc5249fc..91aa57d8035f9 100644 --- a/src/legacy/core_plugins/kibana/public/store.ts +++ b/src/legacy/core_plugins/kibana/public/store.ts @@ -20,7 +20,6 @@ import { applyMiddleware, compose, createStore } from 'redux'; import thunk from 'redux-thunk'; -import { QueryLanguageType } from 'ui/embeddable/types'; import { DashboardViewMode } from './dashboard/dashboard_view_mode'; import { reducers } from './reducers'; @@ -39,7 +38,7 @@ export const store = createStore( filters: [], hidePanelTitles: false, isFullScreenMode: false, - query: { language: QueryLanguageType.LUCENE, query: '' }, + query: { language: 'lucene', query: '' }, timeRange: { from: 'now-15m', to: 'now' }, useMargins: true, viewMode: DashboardViewMode.VIEW, diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts index 7529f1e92678d..9c3a2cbe7e407 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts @@ -20,7 +20,6 @@ import _ from 'lodash'; import { ContainerState, Embeddable } from 'ui/embeddable'; import { OnEmbeddableStateChanged } from 'ui/embeddable/embeddable_factory'; -import { Filters, Query, TimeRange } from 'ui/embeddable/types'; import { StaticIndexPattern } from 'ui/index_patterns'; import { PersistedState } from 'ui/persisted_state'; import { VisualizeLoader } from 'ui/visualize/loader'; @@ -31,6 +30,9 @@ import { VisualizeUpdateParams, } from 'ui/visualize/loader/types'; import { i18n } from '@kbn/i18n'; +import { TimeRange } from 'ui/timefilter/time_history'; +import { Query } from 'src/legacy/core_plugins/data/public'; +import { Filter } from '@kbn/es-query'; export interface VisualizeEmbeddableConfiguration { onEmbeddableStateChanged: OnEmbeddableStateChanged; @@ -51,7 +53,7 @@ export class VisualizeEmbeddable extends Embeddable { private panelTitle?: string; private timeRange?: TimeRange; private query?: Query; - private filters?: Filters; + private filters?: Filter[]; constructor({ onEmbeddableStateChanged, diff --git a/src/legacy/ui/public/embeddable/index.ts b/src/legacy/ui/public/embeddable/index.ts index d4ec27eb5a03c..a4d3b08bb1093 100644 --- a/src/legacy/ui/public/embeddable/index.ts +++ b/src/legacy/ui/public/embeddable/index.ts @@ -21,4 +21,4 @@ export { EmbeddableFactory, OnEmbeddableStateChanged } from './embeddable_factor export * from './embeddable'; export * from './context_menu_actions'; export { EmbeddableFactoriesRegistryProvider } from './embeddable_factories_registry'; -export { ContainerState, EmbeddableState, Query, Filters, Filter, TimeRange } from './types'; +export { ContainerState, EmbeddableState } from './types'; diff --git a/src/legacy/ui/public/embeddable/types.ts b/src/legacy/ui/public/embeddable/types.ts index 05247443907d3..0f98b070dda78 100644 --- a/src/legacy/ui/public/embeddable/types.ts +++ b/src/legacy/ui/public/embeddable/types.ts @@ -19,32 +19,8 @@ import { Filter } from '@kbn/es-query'; import { RefreshInterval } from 'ui/timefilter/timefilter'; - -// Should go away soon once everyone imports from kbn/es-query -export { Filter } from '@kbn/es-query'; - -export interface TimeRange { - to: string; - from: string; -} - -export interface FilterMeta { - disabled: boolean; -} - -export type Filters = Filter[]; - -export enum QueryLanguageType { - KUERY = 'kuery', - LUCENE = 'lucene', -} - -// It's a string sometimes in old version formats, before Kuery came along and there -// was the language specifier. -export interface Query { - language: QueryLanguageType; - query: string; -} +import { TimeRange } from 'ui/timefilter/time_history'; +import { Query } from 'src/legacy/core_plugins/data/public'; export interface EmbeddableCustomization { [key: string]: object | string; diff --git a/src/legacy/ui/public/timefilter/get_time.ts b/src/legacy/ui/public/timefilter/get_time.ts index 8fdbd2a133349..eeb09cdfe3743 100644 --- a/src/legacy/ui/public/timefilter/get_time.ts +++ b/src/legacy/ui/public/timefilter/get_time.ts @@ -19,16 +19,12 @@ import dateMath from '@elastic/datemath'; import { Field, IndexPattern } from 'ui/index_patterns'; +import { TimeRange } from './time_history'; interface CalculateBoundsOptions { forceNow?: Date; } -interface TimeRange { - to: string; - from: string; -} - interface RangeFilter { gte?: string | number; lte?: string | number; @@ -68,7 +64,9 @@ export function getTime( if (!bounds) { return; } - const filter: Filter = { range: { [timefield.name]: { format: 'strict_date_optional_time' } } }; + const filter: Filter = { + range: { [timefield.name]: { format: 'strict_date_optional_time' } }, + }; if (bounds.min) { filter.range[timefield.name].gte = bounds.min.toISOString(); diff --git a/src/legacy/ui/public/vis/request_handlers/request_handlers.d.ts b/src/legacy/ui/public/vis/request_handlers/request_handlers.d.ts index 9b3687b92a541..f2475065a869c 100644 --- a/src/legacy/ui/public/vis/request_handlers/request_handlers.d.ts +++ b/src/legacy/ui/public/vis/request_handlers/request_handlers.d.ts @@ -17,11 +17,13 @@ * under the License. */ +import { TimeRange } from 'ui/timefilter/time_history'; +import { Query } from 'src/legacy/core_plugins/data/public'; +import { Filter } from '@kbn/es-query'; import { SearchSource } from '../../courier'; import { QueryFilter } from '../../filter_manager/query_filter'; import { Adapters } from '../../inspector/types'; import { PersistedState } from '../../persisted_state'; -import { Filters, Query, TimeRange } from '../../visualize'; import { AggConfigs } from '../agg_configs'; import { Vis } from '../vis'; @@ -30,7 +32,7 @@ export interface RequestHandlerParams { aggs: AggConfigs; timeRange?: TimeRange; query?: Query; - filters?: Filters; + filters?: Filter[]; forceFetch: boolean; queryFilter: QueryFilter; uiState?: PersistedState; diff --git a/src/legacy/ui/public/visualize/index.ts b/src/legacy/ui/public/visualize/index.ts index ed41c22aebda1..46a8968358294 100644 --- a/src/legacy/ui/public/visualize/index.ts +++ b/src/legacy/ui/public/visualize/index.ts @@ -18,4 +18,3 @@ */ export * from './loader'; -export { Filters, Query, TimeRange } from './loader/types'; diff --git a/src/legacy/ui/public/visualize/loader/types.ts b/src/legacy/ui/public/visualize/loader/types.ts index 410aab9fae83a..33aea5151762e 100644 --- a/src/legacy/ui/public/visualize/loader/types.ts +++ b/src/legacy/ui/public/visualize/loader/types.ts @@ -17,37 +17,14 @@ * under the License. */ +import { TimeRange } from 'ui/timefilter/time_history'; +import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { SearchSource } from '../../courier'; import { PersistedState } from '../../persisted_state'; import { AppState } from '../../state_management/app_state'; import { Vis } from '../../vis'; -export interface TimeRange { - from: string; - to: string; -} - -export interface FilterMeta { - disabled: boolean; -} - -export interface Filter { - meta: FilterMeta; - query?: object; -} - -export type Filters = Filter[]; - -export enum QueryLanguageType { - KUERY = 'kuery', - LUCENE = 'lucene', -} - -export interface Query { - language: QueryLanguageType; - query: string; -} - export interface VisSavedObject { vis: Vis; description?: string; @@ -96,7 +73,7 @@ export interface VisualizeLoaderParams { /** * Specifies the filters that should be applied to that visualization. */ - filters?: Filters; + filters?: Filter[]; /** * The query that should apply to that visualization. */ diff --git a/src/legacy/ui/public/visualize/loader/utils/query_geohash_bounds.ts b/src/legacy/ui/public/visualize/loader/utils/query_geohash_bounds.ts index 860a3a2689c9c..a8f881c9e05aa 100644 --- a/src/legacy/ui/public/visualize/loader/utils/query_geohash_bounds.ts +++ b/src/legacy/ui/public/visualize/loader/utils/query_geohash_bounds.ts @@ -22,11 +22,12 @@ import { get } from 'lodash'; import { toastNotifications } from 'ui/notify'; import { AggConfig } from 'ui/vis'; +import { Filter } from '@kbn/es-query'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { Vis } from '../../../vis'; -import { Filters, Query } from '../types'; interface QueryGeohashBoundsParams { - filters?: Filters; + filters?: Filter[]; query?: Query; } diff --git a/x-pack/plugins/ml/public/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/ml/public/components/full_time_range_selector/full_time_range_selector_service.ts index 17652f96a522d..32606d2db425e 100644 --- a/x-pack/plugins/ml/public/components/full_time_range_selector/full_time_range_selector_service.ts +++ b/x-pack/plugins/ml/public/components/full_time_range_selector/full_time_range_selector_service.ts @@ -7,10 +7,10 @@ import moment from 'moment'; import { i18n } from '@kbn/i18n'; -import { Query } from 'ui/embeddable'; import { IndexPattern } from 'ui/index_patterns'; import { toastNotifications } from 'ui/notify'; import { timefilter } from 'ui/timefilter'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { ml } from '../../services/ml_api_service'; export function setFullTimeRange(indexPattern: IndexPattern, query: Query) { diff --git a/x-pack/plugins/ml/public/components/full_time_range_selector/index.test.tsx b/x-pack/plugins/ml/public/components/full_time_range_selector/index.test.tsx index 91c477cb60234..41e8fa014907e 100644 --- a/x-pack/plugins/ml/public/components/full_time_range_selector/index.test.tsx +++ b/x-pack/plugins/ml/public/components/full_time_range_selector/index.test.tsx @@ -6,11 +6,9 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; - -import { Query } from 'ui/embeddable'; -import { QueryLanguageType } from 'ui/embeddable/types'; import { IndexPattern } from 'ui/index_patterns'; import { FullTimeRangeSelector } from './index'; +import { Query } from 'src/legacy/core_plugins/data/public'; // Create a mock for the setFullTimeRange function in the service. // The mock is hoisted to the top, so need to prefix the mock function @@ -30,7 +28,7 @@ describe('FullTimeRangeSelector', () => { }; const query: Query = { - language: QueryLanguageType.KUERY, + language: 'kuery', query: 'region:us-east-1', }; diff --git a/x-pack/plugins/ml/public/components/full_time_range_selector/index.tsx b/x-pack/plugins/ml/public/components/full_time_range_selector/index.tsx index 0e39a0fbc4521..9066fe0a0e8b9 100644 --- a/x-pack/plugins/ml/public/components/full_time_range_selector/index.tsx +++ b/x-pack/plugins/ml/public/components/full_time_range_selector/index.tsx @@ -7,9 +7,9 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { Query } from 'ui/embeddable'; import { IndexPattern } from 'ui/index_patterns'; import { EuiButton } from '@elastic/eui'; +import { Query } from 'src/legacy/core_plugins/data/public'; import { setFullTimeRange } from './full_time_range_selector_service'; interface Props {