From 17ffceb9addef5aec644ee06f12b84243c96ef1b Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Tue, 12 Apr 2022 12:02:09 +0500 Subject: [PATCH 01/13] feat: move autocomplete logic from data plugin to unified search --- packages/kbn-optimizer/limits.yml | 2 +- .../src/field_value_match/index.tsx | 2 +- .../src/field_value_match_any/index.tsx | 2 +- .../src/field_value_wildcard/index.tsx | 2 +- .../use_field_value_autocomplete/index.ts | 2 +- .../resources/base/bin/kibana-docker | 4 +- src/plugins/controls/kibana.json | 3 +- .../public/__stories__/controls.stories.tsx | 2 +- src/plugins/controls/public/services/data.ts | 1 - src/plugins/controls/public/services/index.ts | 2 + .../controls/public/services/kibana/data.ts | 3 +- .../controls/public/services/kibana/index.ts | 2 + .../public/services/kibana/unified_search.ts | 26 ++ .../public/services/storybook/data.ts | 11 +- .../public/services/storybook/index.ts | 2 + .../services/storybook/unified_search.ts | 25 ++ .../controls/public/services/stub/index.ts | 3 +- .../public/services/unified_search.ts | 13 + src/plugins/controls/public/types.ts | 2 + .../options_list_suggestions_route.ts | 4 +- src/plugins/controls/server/plugin.ts | 6 +- src/plugins/controls/tsconfig.json | 3 +- src/plugins/data/config.ts | 22 -- src/plugins/data/kibana.json | 2 +- src/plugins/data/public/index.ts | 19 +- src/plugins/data/public/mocks.ts | 14 - src/plugins/data/public/plugin.ts | 9 - src/plugins/data/public/types.ts | 7 - src/plugins/data/server/index.ts | 5 +- src/plugins/data/server/mocks.ts | 6 - src/plugins/data/server/plugin.ts | 6 - .../input_control_vis/public/plugin.ts | 17 +- src/plugins/unified_search/config.ts | 25 +- src/plugins/unified_search/kibana.json | 5 +- .../autocomplete/autocomplete_service.ts | 6 +- .../collectors/create_usage_collector.ts | 0 .../public/autocomplete/collectors/index.ts | 0 .../public/autocomplete/collectors/types.ts | 0 .../public/autocomplete/index.ts | 0 .../providers/kql_query_suggestion/README.md | 0 .../__fixtures__/index_pattern_response.json | 0 .../kql_query_suggestion/conjunction.test.ts | 3 +- .../kql_query_suggestion/conjunction.tsx | 21 +- .../kql_query_suggestion/field.test.ts | 9 +- .../providers/kql_query_suggestion/field.tsx | 8 +- .../providers/kql_query_suggestion/index.ts | 10 +- .../lib/escape_kuery.test.ts | 0 .../kql_query_suggestion/lib/escape_kuery.ts | 0 .../kql_query_suggestion/operator.test.ts | 5 +- .../kql_query_suggestion/operator.tsx | 50 ++-- .../sort_prefix_first.test.ts | 0 .../kql_query_suggestion/sort_prefix_first.ts | 0 .../providers/kql_query_suggestion/types.ts | 9 +- .../kql_query_suggestion/value.test.ts | 3 +- .../providers/kql_query_suggestion/value.ts | 12 +- .../providers/query_suggestion_provider.ts | 4 +- .../value_suggestion_provider.test.ts | 6 +- .../providers/value_suggestion_provider.ts | 9 +- .../filter_editor/phrase_suggestor.tsx | 4 +- src/plugins/unified_search/public/index.ts | 19 +- src/plugins/unified_search/public/mocks.ts | 20 ++ src/plugins/unified_search/public/plugin.ts | 24 +- .../query_bar_top_row.test.tsx | 8 + .../query_string_input.test.tsx | 8 + .../query_string_input/query_string_input.tsx | 15 +- src/plugins/unified_search/public/services.ts | 4 + .../typeahead/suggestion_component.test.tsx | 2 +- .../public/typeahead/suggestion_component.tsx | 2 +- .../typeahead/suggestions_component.test.tsx | 2 +- .../typeahead/suggestions_component.tsx | 2 +- .../unified_search/public/typeahead/types.ts | 2 +- src/plugins/unified_search/public/types.ts | 13 +- .../autocomplete/autocomplete_service.ts | 0 .../server/autocomplete/index.ts | 0 .../server/autocomplete/routes.ts | 0 .../server/autocomplete/terms_agg.test.ts | 0 .../server/autocomplete/terms_agg.ts | 2 +- .../server/autocomplete/terms_enum.test.ts | 0 .../server/autocomplete/terms_enum.ts | 2 +- .../autocomplete/value_suggestions_route.ts | 2 +- .../server/config_deprecations.test.ts | 18 +- .../server/config_deprecations.ts | 12 + .../unified_search/server/data_views/index.ts | 9 + src/plugins/unified_search/server/index.ts | 40 +++ src/plugins/unified_search/server/mocks.ts | 23 ++ src/plugins/unified_search/server/plugin.ts | 50 ++++ src/plugins/unified_search/tsconfig.json | 4 +- .../test_suites/core_plugins/rendering.ts | 10 +- x-pack/plugins/apm/kibana.json | 3 +- .../components/shared/kuery_bar/index.tsx | 10 +- x-pack/plugins/apm/public/plugin.ts | 4 +- .../fleet/.storybook/context/stubs.tsx | 2 + x-pack/plugins/fleet/kibana.json | 2 +- .../components/agent_logs/filter_dataset.tsx | 6 +- .../agent_logs/filter_log_level.tsx | 6 +- .../fleet/public/mock/plugin_dependencies.ts | 2 + x-pack/plugins/fleet/public/plugin.ts | 2 + .../public/components/search_bar.test.tsx | 2 + .../autocomplete_field/autocomplete_field.tsx | 2 +- .../autocomplete_field/suggestion_item.tsx | 5 +- .../containers/with_kuery_autocompletion.tsx | 10 +- .../metrics_explorer/components/kuery_bar.tsx | 2 +- x-pack/plugins/lens/kibana.json | 3 +- .../dimension_panel/dimension_editor.tsx | 1 + .../dimension_panel/dimension_panel.test.tsx | 3 + .../dimension_panel/dimension_panel.tsx | 2 + .../droppable/droppable.test.ts | 2 + .../dimension_panel/reference_editor.test.tsx | 2 + .../dimension_panel/reference_editor.tsx | 2 + .../public/indexpattern_datasource/index.ts | 9 +- .../indexpattern.test.ts | 2 + .../indexpattern_datasource/indexpattern.tsx | 4 + .../definitions/date_histogram.test.tsx | 3 + .../definitions/filters/filters.test.tsx | 2 + .../formula/editor/formula_editor.tsx | 8 +- .../formula/editor/math_completion.test.ts | 20 +- .../formula/editor/math_completion.ts | 18 +- .../operations/definitions/index.ts | 2 + .../definitions/last_value.test.tsx | 2 + .../definitions/percentile.test.tsx | 2 + .../definitions/ranges/ranges.test.tsx | 3 + .../definitions/static_value.test.tsx | 2 + .../definitions/terms/terms.test.tsx | 2 + x-pack/plugins/lens/public/plugin.ts | 2 + .../components/builder/builder.stories.tsx | 2 +- .../builder/entry_renderer.stories.tsx | 2 +- .../builder/entry_renderer.test.tsx | 4 +- .../components/builder/entry_renderer.tsx | 2 +- .../builder/exception_item_renderer.test.tsx | 4 +- .../builder/exception_item_renderer.tsx | 2 +- .../builder/exception_items_renderer.test.tsx | 4 +- .../builder/exception_items_renderer.tsx | 2 +- x-pack/plugins/lists/tsconfig.json | 1 + x-pack/plugins/maps/public/kibana_services.ts | 2 +- x-pack/plugins/ml/kibana.json | 3 +- x-pack/plugins/ml/public/application/app.tsx | 2 +- .../application/util/dependency_cache.ts | 4 +- x-pack/plugins/ml/public/plugin.ts | 3 + x-pack/plugins/monitoring/kibana.json | 2 +- .../kuery_bar/autocomplete_field.tsx | 2 +- .../public/components/kuery_bar/index.tsx | 3 +- .../components/kuery_bar/suggestion_item.tsx | 5 +- .../kuery_bar/with_kuery_autocompletion.tsx | 14 +- x-pack/plugins/security_solution/kibana.json | 3 +- .../exceptions/add_exception_flyout/index.tsx | 4 +- .../edit_exception_flyout/index.tsx | 4 +- .../components/query_bar/index.test.tsx | 7 + .../components/threat_match/index.test.tsx | 2 +- .../threat_match/list_item.test.tsx | 2 +- .../common/lib/kibana/kibana_react.mock.ts | 3 + .../mock/endpoint/app_context_render.tsx | 2 +- .../rules/severity_mapping/index.tsx | 2 +- .../view/components/form/index.test.tsx | 1 + .../view/components/form/index.tsx | 6 +- .../timeline/query_bar/index.test.tsx | 7 + .../translations/translations/fr-FR.json | 264 +++++++++--------- .../translations/translations/ja-JP.json | 34 +-- .../translations/translations/zh-CN.json | 34 +-- x-pack/plugins/uptime/public/apps/plugin.ts | 2 + .../lazy_wrapper/monitor_status.tsx | 2 +- 160 files changed, 810 insertions(+), 497 deletions(-) create mode 100644 src/plugins/controls/public/services/kibana/unified_search.ts create mode 100644 src/plugins/controls/public/services/storybook/unified_search.ts create mode 100644 src/plugins/controls/public/services/unified_search.ts rename src/plugins/{data => unified_search}/public/autocomplete/autocomplete_service.ts (93%) rename src/plugins/{data => unified_search}/public/autocomplete/collectors/create_usage_collector.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/collectors/index.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/collectors/types.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/index.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/README.md (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts (94%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx (69%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/field.test.ts (97%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/field.tsx (94%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/index.ts (90%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.test.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/operator.test.ts (95%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/operator.tsx (65%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.test.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.ts (100%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/types.ts (75%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/value.test.ts (98%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/kql_query_suggestion/value.ts (89%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/query_suggestion_provider.ts (90%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/value_suggestion_provider.test.ts (97%) rename src/plugins/{data => unified_search}/public/autocomplete/providers/value_suggestion_provider.ts (95%) rename src/plugins/{data => unified_search}/server/autocomplete/autocomplete_service.ts (100%) rename src/plugins/{data => unified_search}/server/autocomplete/index.ts (100%) rename src/plugins/{data => unified_search}/server/autocomplete/routes.ts (100%) rename src/plugins/{data => unified_search}/server/autocomplete/terms_agg.test.ts (100%) rename src/plugins/{data => unified_search}/server/autocomplete/terms_agg.ts (97%) rename src/plugins/{data => unified_search}/server/autocomplete/terms_enum.test.ts (100%) rename src/plugins/{data => unified_search}/server/autocomplete/terms_enum.ts (97%) rename src/plugins/{data => unified_search}/server/autocomplete/value_suggestions_route.ts (97%) rename src/plugins/{data => unified_search}/server/config_deprecations.test.ts (70%) rename src/plugins/{data => unified_search}/server/config_deprecations.ts (70%) create mode 100644 src/plugins/unified_search/server/data_views/index.ts create mode 100644 src/plugins/unified_search/server/index.ts create mode 100644 src/plugins/unified_search/server/mocks.ts create mode 100644 src/plugins/unified_search/server/plugin.ts diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index ebab8e61a2268..7e4cfa1c6cd2e 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -123,7 +123,7 @@ pageLoadAssetSize: sessionView: 77750 cloudSecurityPosture: 19109 visTypeGauge: 24113 - unifiedSearch: 49195 + unifiedSearch: 104869 data: 454087 expressionXY: 26500 eventAnnotation: 19334 diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx index 096058fcc0aa3..bfede3a8fcc4d 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx @@ -21,7 +21,7 @@ import { uniq } from 'lodash'; import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; type AutocompleteStart = any; import * as i18n from '../translations'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx index 5a36e155c548f..8f5afbbc86629 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx @@ -13,7 +13,7 @@ import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution- import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; type AutocompleteStart = any; import * as i18n from '../translations'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx index 82b9cb029d8dc..82d36aef83728 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx @@ -15,7 +15,7 @@ import { uniq } from 'lodash'; import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; type AutocompleteStart = any; import * as i18n from '../translations'; diff --git a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts index ca0868e5056a6..1b2de4567fe2a 100644 --- a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts +++ b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts @@ -12,7 +12,7 @@ import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution- import { DataViewBase, DataViewFieldBase, getDataViewFieldSubtypeNested } from '@kbn/es-query'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../../src/plugins/data/public'; +// import { AutocompleteStart } from '../../../../../../../../src/plugins/unified_search/public'; type AutocompleteStart = any; interface FuncArgs { diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 191f53208df72..fca5dce0ae2f9 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -38,8 +38,8 @@ kibana_vars=( csp.frame_ancestors csp.report_uri csp.report_to - data.autocomplete.valueSuggestions.terminateAfter - data.autocomplete.valueSuggestions.timeout + unifiedSearch.autocomplete.valueSuggestions.terminateAfter + unifiedSearch.autocomplete.valueSuggestions.timeout elasticsearch.customHeaders elasticsearch.hosts elasticsearch.logQueries diff --git a/src/plugins/controls/kibana.json b/src/plugins/controls/kibana.json index 20afd63505a73..e87af3f517af2 100644 --- a/src/plugins/controls/kibana.json +++ b/src/plugins/controls/kibana.json @@ -17,7 +17,8 @@ "expressions", "embeddable", "dataViews", - "data" + "data", + "unifiedSearch" ], "optionalPlugins": [] } diff --git a/src/plugins/controls/public/__stories__/controls.stories.tsx b/src/plugins/controls/public/__stories__/controls.stories.tsx index 12e595f483e04..71f7dd0624acf 100644 --- a/src/plugins/controls/public/__stories__/controls.stories.tsx +++ b/src/plugins/controls/public/__stories__/controls.stories.tsx @@ -31,7 +31,7 @@ import { decorators } from './decorators'; import { ControlsPanels } from '../control_group/types'; import { ControlGroupContainer } from '../control_group'; import { pluginServices, registry } from '../services/storybook'; -import { replaceValueSuggestionMethod } from '../services/storybook/data'; +import { replaceValueSuggestionMethod } from '../services/storybook/unified_search'; import { injectStorybookDataView } from '../services/storybook/data_views'; import { populateStorybookControlFactories } from './storybook_control_factories'; import { OptionsListRequest } from '../services/options_list'; diff --git a/src/plugins/controls/public/services/data.ts b/src/plugins/controls/public/services/data.ts index 57c2342beb425..c84bf541a631a 100644 --- a/src/plugins/controls/public/services/data.ts +++ b/src/plugins/controls/public/services/data.ts @@ -24,7 +24,6 @@ export interface ControlsDataService { ) => Observable<{ min?: number; max?: number }>; getDataView: DataPublicPluginStart['dataViews']['get']; getDataView$: (id: string) => Observable; - autocomplete: DataPublicPluginStart['autocomplete']; query: DataPublicPluginStart['query']; searchSource: DataPublicPluginStart['search']['searchSource']; timefilter: DataPublicPluginStart['query']['timefilter']['timefilter']; diff --git a/src/plugins/controls/public/services/index.ts b/src/plugins/controls/public/services/index.ts index 1a8c8b0c4bdfe..9110078bae7b5 100644 --- a/src/plugins/controls/public/services/index.ts +++ b/src/plugins/controls/public/services/index.ts @@ -12,6 +12,7 @@ import { ControlsOverlaysService } from './overlays'; import { registry as stubRegistry } from './stub'; import { ControlsPluginStart } from '../types'; import { ControlsDataService } from './data'; +import { ControlsUnifiedSearchService } from './unified_search'; import { ControlsService } from './controls'; import { ControlsHTTPService } from './http'; import { ControlsOptionsListService } from './options_list'; @@ -22,6 +23,7 @@ export interface ControlsServices { dataViews: ControlsDataViewsService; overlays: ControlsOverlaysService; data: ControlsDataService; + unifiedSearch: ControlsUnifiedSearchService; http: ControlsHTTPService; settings: ControlsSettingsService; diff --git a/src/plugins/controls/public/services/kibana/data.ts b/src/plugins/controls/public/services/kibana/data.ts index 9eb981d90c237..7e2dfea63333b 100644 --- a/src/plugins/controls/public/services/kibana/data.ts +++ b/src/plugins/controls/public/services/kibana/data.ts @@ -43,7 +43,7 @@ const minMaxAgg = (field?: DataViewField) => { export const dataServiceFactory: DataServiceFactory = ({ startPlugins }) => { const { - data: { query: queryPlugin, search, autocomplete }, + data: { query: queryPlugin, search }, } = startPlugins; const { data } = startPlugins; @@ -95,7 +95,6 @@ export const dataServiceFactory: DataServiceFactory = ({ startPlugins }) => { from(fetchFieldRange(dataView, fieldName, input)), getDataView: data.dataViews.get, getDataView$: (id: string) => from(data.dataViews.get(id)), - autocomplete, query: queryPlugin, searchSource: search.searchSource, timefilter: queryPlugin.timefilter.timefilter, diff --git a/src/plugins/controls/public/services/kibana/index.ts b/src/plugins/controls/public/services/kibana/index.ts index 19a2c0891ac8f..54b6ef0890d0f 100644 --- a/src/plugins/controls/public/services/kibana/index.ts +++ b/src/plugins/controls/public/services/kibana/index.ts @@ -22,6 +22,7 @@ import { dataServiceFactory } from './data'; import { httpServiceFactory } from './http'; import { optionsListServiceFactory } from './options_list'; import { settingsServiceFactory } from './settings'; +import { unifiedSearchServiceFactory } from './unified_search'; export const providers: PluginServiceProviders< ControlsServices, @@ -29,6 +30,7 @@ export const providers: PluginServiceProviders< > = { http: new PluginServiceProvider(httpServiceFactory), data: new PluginServiceProvider(dataServiceFactory), + unifiedSearch: new PluginServiceProvider(unifiedSearchServiceFactory), overlays: new PluginServiceProvider(overlaysServiceFactory), dataViews: new PluginServiceProvider(dataViewsServiceFactory), settings: new PluginServiceProvider(settingsServiceFactory), diff --git a/src/plugins/controls/public/services/kibana/unified_search.ts b/src/plugins/controls/public/services/kibana/unified_search.ts new file mode 100644 index 0000000000000..2a5df712c403d --- /dev/null +++ b/src/plugins/controls/public/services/kibana/unified_search.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ControlsUnifiedSearchService } from '../unified_search'; +import { ControlsPluginStartDeps } from '../../types'; +import { KibanaPluginServiceFactory } from '../../../../presentation_util/public'; + +export type UnifiedSearchServiceFactory = KibanaPluginServiceFactory< + ControlsUnifiedSearchService, + ControlsPluginStartDeps +>; + +export const unifiedSearchServiceFactory: UnifiedSearchServiceFactory = ({ startPlugins }) => { + const { + unifiedSearch: { autocomplete }, + } = startPlugins; + + return { + autocomplete, + }; +}; diff --git a/src/plugins/controls/public/services/storybook/data.ts b/src/plugins/controls/public/services/storybook/data.ts index 3e63066d0d5ff..93c906deaa76e 100644 --- a/src/plugins/controls/public/services/storybook/data.ts +++ b/src/plugins/controls/public/services/storybook/data.ts @@ -9,20 +9,11 @@ import { of, Observable } from 'rxjs'; import { PluginServiceFactory } from '../../../../presentation_util/public'; import { DataPublicPluginStart } from '../../../../data/public'; -import { DataViewField, DataView } from '../../../../data_views/common'; +import { DataView } from '../../../../data_views/common'; import { ControlsDataService } from '../data'; -let valueSuggestionMethod = ({ field, query }: { field: DataViewField; query: string }) => - Promise.resolve(['storybook', 'default', 'values']); -export const replaceValueSuggestionMethod = ( - newMethod: ({ field, query }: { field: DataViewField; query: string }) => Promise -) => (valueSuggestionMethod = newMethod); - export type DataServiceFactory = PluginServiceFactory; export const dataServiceFactory: DataServiceFactory = () => ({ - autocomplete: { - getValueSuggestions: valueSuggestionMethod, - } as unknown as DataPublicPluginStart['autocomplete'], query: {} as unknown as DataPublicPluginStart['query'], searchSource: { create: () => ({ diff --git a/src/plugins/controls/public/services/storybook/index.ts b/src/plugins/controls/public/services/storybook/index.ts index 535befd925f49..a068505504b5e 100644 --- a/src/plugins/controls/public/services/storybook/index.ts +++ b/src/plugins/controls/public/services/storybook/index.ts @@ -14,6 +14,7 @@ import { } from '../../../../presentation_util/public'; import { ControlsServices } from '..'; import { dataServiceFactory } from './data'; +import { unifiedSearchServiceFactory } from './unified_search'; import { overlaysServiceFactory } from './overlays'; import { dataViewsServiceFactory } from './data_views'; import { httpServiceFactory } from '../stub/http'; @@ -28,6 +29,7 @@ export const providers: PluginServiceProviders = { dataViews: new PluginServiceProvider(dataViewsServiceFactory), http: new PluginServiceProvider(httpServiceFactory), data: new PluginServiceProvider(dataServiceFactory), + unifiedSearch: new PluginServiceProvider(unifiedSearchServiceFactory), overlays: new PluginServiceProvider(overlaysServiceFactory), settings: new PluginServiceProvider(settingsServiceFactory), diff --git a/src/plugins/controls/public/services/storybook/unified_search.ts b/src/plugins/controls/public/services/storybook/unified_search.ts new file mode 100644 index 0000000000000..2ea6f23588c5a --- /dev/null +++ b/src/plugins/controls/public/services/storybook/unified_search.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../../../../presentation_util/public'; +import { DataViewField } from '../../../../data_views/common'; +import { ControlsUnifiedSearchService } from '../unified_search'; +import { UnifiedSearchPublicPluginStart } from '../../../../unified_search/public'; + +let valueSuggestionMethod = ({ field, query }: { field: DataViewField; query: string }) => + Promise.resolve(['storybook', 'default', 'values']); +export const replaceValueSuggestionMethod = ( + newMethod: ({ field, query }: { field: DataViewField; query: string }) => Promise +) => (valueSuggestionMethod = newMethod); + +export type UnifiedSearchServiceFactory = PluginServiceFactory; +export const unifiedSearchServiceFactory: UnifiedSearchServiceFactory = () => ({ + autocomplete: { + getValueSuggestions: valueSuggestionMethod, + } as unknown as UnifiedSearchPublicPluginStart['autocomplete'], +}); diff --git a/src/plugins/controls/public/services/stub/index.ts b/src/plugins/controls/public/services/stub/index.ts index 486c42a999f9a..8b86e6f5f190e 100644 --- a/src/plugins/controls/public/services/stub/index.ts +++ b/src/plugins/controls/public/services/stub/index.ts @@ -20,6 +20,7 @@ import { dataServiceFactory } from '../storybook/data'; import { dataViewsServiceFactory } from '../storybook/data_views'; import { optionsListServiceFactory } from '../storybook/options_list'; import { settingsServiceFactory } from '../storybook/settings'; +import { unifiedSearchServiceFactory } from '../storybook/unified_search'; export const providers: PluginServiceProviders = { http: new PluginServiceProvider(httpServiceFactory), @@ -27,7 +28,7 @@ export const providers: PluginServiceProviders = { overlays: new PluginServiceProvider(overlaysServiceFactory), dataViews: new PluginServiceProvider(dataViewsServiceFactory), settings: new PluginServiceProvider(settingsServiceFactory), - + unifiedSearch: new PluginServiceProvider(unifiedSearchServiceFactory), controls: new PluginServiceProvider(controlsServiceFactory), optionsList: new PluginServiceProvider(optionsListServiceFactory), }; diff --git a/src/plugins/controls/public/services/unified_search.ts b/src/plugins/controls/public/services/unified_search.ts new file mode 100644 index 0000000000000..c88c7d1284384 --- /dev/null +++ b/src/plugins/controls/public/services/unified_search.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { UnifiedSearchPublicPluginStart } from '../../../unified_search/public'; + +export interface ControlsUnifiedSearchService { + autocomplete: UnifiedSearchPublicPluginStart['autocomplete']; +} diff --git a/src/plugins/controls/public/types.ts b/src/plugins/controls/public/types.ts index 745aa1bc32465..4dc10d6af6426 100644 --- a/src/plugins/controls/public/types.ts +++ b/src/plugins/controls/public/types.ts @@ -17,6 +17,7 @@ import { } from '../../embeddable/public'; import { ControlInput } from '../common/types'; import { DataPublicPluginStart } from '../../data/public'; +import { UnifiedSearchPublicPluginStart } from '../../unified_search/public'; import { ControlsService } from './services/controls'; import { DataView, DataViewsPublicPluginStart } from '../../data_views/public'; @@ -70,6 +71,7 @@ export interface ControlsPluginSetupDeps { } export interface ControlsPluginStartDeps { data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; embeddable: EmbeddableStart; dataViews: DataViewsPublicPluginStart; } diff --git a/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts index a2eab10cc77dc..4a4cf8d2ae10c 100644 --- a/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts +++ b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts @@ -18,12 +18,12 @@ import { } from '../../../common/control_types/options_list/types'; import { CoreSetup, ElasticsearchClient } from '../../../../../core/server'; import { getKbnServerError, reportServerError } from '../../../../kibana_utils/server'; -import { PluginSetup as DataPluginSetup } from '../../../../data/server'; +import { PluginSetup as UnifiedSearchPluginSetup } from '../../../../unified_search/server'; import { FieldSpec, getFieldSubtypeNested } from '../../../../data_views/common'; export const setupOptionsListSuggestionsRoute = ( { http }: CoreSetup, - getAutocompleteSettings: DataPluginSetup['autocomplete']['getAutocompleteSettings'] + getAutocompleteSettings: UnifiedSearchPluginSetup['autocomplete']['getAutocompleteSettings'] ) => { const router = http.createRouter(); diff --git a/src/plugins/controls/server/plugin.ts b/src/plugins/controls/server/plugin.ts index 6ff67f702be54..ada22363714a0 100644 --- a/src/plugins/controls/server/plugin.ts +++ b/src/plugins/controls/server/plugin.ts @@ -10,6 +10,7 @@ import { CoreSetup, Plugin } from 'kibana/server'; import { EmbeddableSetup } from '../../embeddable/server'; import { PluginSetup as DataSetup } from '../../data/server'; +import { PluginSetup as UnifiedSearchSetup } from '../../unified_search/server'; import { setupOptionsListSuggestionsRoute } from './control_types/options_list/options_list_suggestions_route'; import { controlGroupContainerPersistableStateServiceFactory } from './control_group/control_group_container_factory'; import { optionsListPersistableStateServiceFactory } from './control_types/options_list/options_list_embeddable_factory'; @@ -18,10 +19,11 @@ import { timeSliderPersistableStateServiceFactory } from './control_types/time_s interface SetupDeps { embeddable: EmbeddableSetup; data: DataSetup; + unifiedSearch: UnifiedSearchSetup; } export class ControlsPlugin implements Plugin { - public setup(core: CoreSetup, { embeddable, data }: SetupDeps) { + public setup(core: CoreSetup, { embeddable, unifiedSearch }: SetupDeps) { embeddable.registerEmbeddableFactory(optionsListPersistableStateServiceFactory()); embeddable.registerEmbeddableFactory(timeSliderPersistableStateServiceFactory()); @@ -29,7 +31,7 @@ export class ControlsPlugin implements Plugin { controlGroupContainerPersistableStateServiceFactory(embeddable) ); - setupOptionsListSuggestionsRoute(core, data.autocomplete.getAutocompleteSettings); + setupOptionsListSuggestionsRoute(core, unifiedSearch.autocomplete.getAutocompleteSettings); return {}; } diff --git a/src/plugins/controls/tsconfig.json b/src/plugins/controls/tsconfig.json index 10ec84fbd32f6..5a17afc931340 100644 --- a/src/plugins/controls/tsconfig.json +++ b/src/plugins/controls/tsconfig.json @@ -23,6 +23,7 @@ { "path": "../embeddable/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data/tsconfig.json" } + { "path": "../data/tsconfig.json" }, + { "path": "../unified_search/tsconfig.json" } ] } diff --git a/src/plugins/data/config.ts b/src/plugins/data/config.ts index 2512846554106..c419683de9868 100644 --- a/src/plugins/data/config.ts +++ b/src/plugins/data/config.ts @@ -9,28 +9,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - autocomplete: schema.object({ - querySuggestions: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - }), - valueSuggestions: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - tiers: schema.arrayOf( - schema.oneOf([ - schema.literal('data_content'), - schema.literal('data_hot'), - schema.literal('data_warm'), - schema.literal('data_cold'), - schema.literal('data_frozen'), - ]), - { - defaultValue: ['data_hot', 'data_warm', 'data_content', 'data_cold'], - } - ), - terminateAfter: schema.duration({ defaultValue: 100000 }), - timeout: schema.duration({ defaultValue: 1000 }), - }), - }), search: schema.object({ aggs: schema.object({ shardDelay: schema.object({ diff --git a/src/plugins/data/kibana.json b/src/plugins/data/kibana.json index e3369c2d571a6..fa7453d4c5bda 100644 --- a/src/plugins/data/kibana.json +++ b/src/plugins/data/kibana.json @@ -4,7 +4,7 @@ "server": true, "ui": true, "requiredPlugins": ["bfetch", "expressions", "uiActions", "share", "inspector", "fieldFormats", "dataViews"], - "serviceFolders": ["search", "query", "autocomplete", "ui"], + "serviceFolders": ["search", "query", "ui"], "optionalPlugins": ["usageCollection", "taskManager", "security"], "extraPublicDirs": ["common"], "requiredBundles": ["kibanaUtils", "kibanaReact", "inspector"], diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 6fd357447fad8..8bbf3cd395f87 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -95,20 +95,6 @@ export { DuplicateDataViewError, } from '../common'; -/* - * Autocomplete query suggestions: - */ - -export type { - QuerySuggestion, - QuerySuggestionGetFn, - QuerySuggestionGetFnArgs, - QuerySuggestionBasic, - QuerySuggestionField, - AutocompleteStart, -} from './autocomplete'; - -export { QuerySuggestionTypes } from './autocomplete'; /* * Search: */ @@ -273,8 +259,12 @@ export { TimeHistory, getQueryLog, mapAndFlattenFilters, + QueryService, } from './query'; +export { NowProvider } from './now_provider'; +export type { NowProviderInternalContract } from './now_provider'; + export type { QueryState, SavedQuery, @@ -288,6 +278,7 @@ export type { PersistedLog, QueryStringContract, QuerySetup, + TimefilterSetup, } from './query'; export type { AggsStart } from './search/aggs'; diff --git a/src/plugins/data/public/mocks.ts b/src/plugins/data/public/mocks.ts index 3c0c58c979db7..34ab3474e4b73 100644 --- a/src/plugins/data/public/mocks.ts +++ b/src/plugins/data/public/mocks.ts @@ -11,27 +11,14 @@ import { DataPlugin, DataViewsContract } from '.'; import { fieldFormatsServiceMock } from '../../field_formats/public/mocks'; import { searchServiceMock } from './search/mocks'; import { queryServiceMock } from './query/mocks'; -import { AutocompleteStart, AutocompleteSetup } from './autocomplete'; import { createNowProviderMock } from './now_provider/mocks'; export type Setup = jest.Mocked>; export type Start = jest.Mocked>; -const autocompleteSetupMock: jest.Mocked = { - getQuerySuggestions: jest.fn(), - getAutocompleteSettings: jest.fn(), -}; - -const autocompleteStartMock: jest.Mocked = { - getValueSuggestions: jest.fn(), - getQuerySuggestions: jest.fn(), - hasQuerySuggestions: jest.fn(), -}; - const createSetupContract = (): Setup => { const querySetupMock = queryServiceMock.createSetupContract(); return { - autocomplete: autocompleteSetupMock, search: searchServiceMock.createSetupContract(), query: querySetupMock, }; @@ -58,7 +45,6 @@ const createStartContract = (): Start => { createFiltersFromValueClickAction: jest.fn().mockResolvedValue(['yes']), createFiltersFromRangeSelectAction: jest.fn(), }, - autocomplete: autocompleteStartMock, datatableUtilities: createDatatableUtilitiesMock(), search: searchServiceMock.createStartContract(), fieldFormats: fieldFormatsServiceMock.createStartContract(), diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 1402a01a3b057..047fefc440c5f 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -17,7 +17,6 @@ import type { DataSetupDependencies, DataStartDependencies, } from './types'; -import { AutocompleteService } from './autocomplete'; import { SearchService } from './search/search_service'; import { QueryService } from './query'; import { @@ -48,7 +47,6 @@ export class DataPublicPlugin DataStartDependencies > { - private readonly autocomplete: AutocompleteService; private readonly searchService: SearchService; private readonly queryService: QueryService; private readonly storage: IStorageWrapper; @@ -58,7 +56,6 @@ export class DataPublicPlugin this.searchService = new SearchService(initializerContext); this.queryService = new QueryService(); - this.autocomplete = new AutocompleteService(initializerContext); this.storage = new Storage(window.localStorage); this.nowProvider = new NowProvider(); } @@ -109,10 +106,6 @@ export class DataPublicPlugin ); return { - autocomplete: this.autocomplete.setup(core, { - timefilter: queryService.timefilter, - usageCollection, - }), search: searchService, query: queryService, }; @@ -157,7 +150,6 @@ export class DataPublicPlugin createFiltersFromValueClickAction, createFiltersFromRangeSelectAction, }, - autocomplete: this.autocomplete.start(), datatableUtilities, fieldFormats, indexPatterns: dataViews, @@ -171,7 +163,6 @@ export class DataPublicPlugin } public stop() { - this.autocomplete.clearProviders(); this.queryService.stop(); this.searchService.stop(); } diff --git a/src/plugins/data/public/types.ts b/src/plugins/data/public/types.ts index 55b2637e874e0..ef87224296cf1 100644 --- a/src/plugins/data/public/types.ts +++ b/src/plugins/data/public/types.ts @@ -14,7 +14,6 @@ import { DataViewsPublicPluginStart } from 'src/plugins/data_views/public'; import { UiActionsSetup, UiActionsStart } from 'src/plugins/ui_actions/public'; import { FieldFormatsSetup, FieldFormatsStart } from 'src/plugins/field_formats/public'; import { DatatableUtilitiesService } from '../common'; -import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions'; import type { ISearchSetup, ISearchStart } from './search'; import { QuerySetup, QueryStart } from './query'; @@ -42,7 +41,6 @@ export interface DataStartDependencies { * Data plugin public Setup contract */ export interface DataPublicPluginSetup { - autocomplete: AutocompleteSetup; search: ISearchSetup; query: QuerySetup; } @@ -64,11 +62,6 @@ export interface DataPublicPluginStart { * {@link DataPublicPluginStartActions} */ actions: DataPublicPluginStartActions; - /** - * autocomplete service - * {@link AutocompleteStart} - */ - autocomplete: AutocompleteStart; /** * data views service * {@link DataViewsContract} diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 449d18b542300..d719deaf29251 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -16,6 +16,8 @@ import { DataServerPlugin, DataPluginSetup, DataPluginStart } from './plugin'; export * from './deprecated'; export { getEsQueryConfig, DEFAULT_QUERY_LANGUAGE } from '../common'; +export { getRequestAbortedSignal } from './lib'; + /** * Exporters (CSV) */ @@ -68,7 +70,6 @@ import { // tabify calcAutoIntervalLessThan, } from '../common'; -import { autocompleteConfigDeprecationProvider } from './config_deprecations'; export type { ParsedInterval, @@ -121,9 +122,7 @@ export type { DataPluginSetup as PluginSetup, DataPluginStart as PluginStart }; export { DataServerPlugin as Plugin }; export const config: PluginConfigDescriptor = { - deprecations: autocompleteConfigDeprecationProvider, exposeToBrowser: { - autocomplete: true, search: true, }, schema: configSchema, diff --git a/src/plugins/data/server/mocks.ts b/src/plugins/data/server/mocks.ts index 355e809888bd4..bfdedbf0834af 100644 --- a/src/plugins/data/server/mocks.ts +++ b/src/plugins/data/server/mocks.ts @@ -18,16 +18,10 @@ import { import { createIndexPatternsStartMock } from './data_views/mocks'; import { createDatatableUtilitiesMock } from './datatable_utilities/mock'; import { DataRequestHandlerContext } from './search'; -import { AutocompleteSetup } from './autocomplete'; - -const autocompleteSetupMock: jest.Mocked = { - getAutocompleteSettings: jest.fn(), -}; function createSetupContract() { return { search: createSearchSetupMock(), - autocomplete: autocompleteSetupMock, /** * @deprecated - use directly from "fieldFormats" plugin instead */ diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index 9d5b3792da566..8d11390a5fc96 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -18,18 +18,15 @@ import { QueryService } from './query/query_service'; import { ScriptsService } from './scripts'; import { KqlTelemetryService } from './kql_telemetry'; import { UsageCollectionSetup } from '../../usage_collection/server'; -import { AutocompleteService } from './autocomplete'; import { FieldFormatsSetup, FieldFormatsStart } from '../../field_formats/server'; import { getUiSettings } from './ui_settings'; import { QuerySetup } from './query'; -import { AutocompleteSetup } from './autocomplete/autocomplete_service'; interface DataEnhancements { search: SearchEnhancements; } export interface DataPluginSetup { - autocomplete: AutocompleteSetup; search: ISearchSetup; query: QuerySetup; /** @@ -81,7 +78,6 @@ export class DataServerPlugin private readonly searchService: SearchService; private readonly scriptsService: ScriptsService; private readonly kqlTelemetryService: KqlTelemetryService; - private readonly autocompleteService: AutocompleteService; private readonly queryService = new QueryService(); private readonly logger: Logger; @@ -90,7 +86,6 @@ export class DataServerPlugin this.searchService = new SearchService(initializerContext, this.logger); this.scriptsService = new ScriptsService(); this.kqlTelemetryService = new KqlTelemetryService(initializerContext); - this.autocompleteService = new AutocompleteService(initializerContext); } public setup( @@ -110,7 +105,6 @@ export class DataServerPlugin }); return { - autocomplete: this.autocompleteService.setup(core), __enhance: (enhancements: DataEnhancements) => { searchSetup.__enhance(enhancements.search); }, diff --git a/src/plugins/input_control_vis/public/plugin.ts b/src/plugins/input_control_vis/public/plugin.ts index 0f8f601d5edbc..e84e85f1e025d 100644 --- a/src/plugins/input_control_vis/public/plugin.ts +++ b/src/plugins/input_control_vis/public/plugin.ts @@ -8,8 +8,12 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public'; -import { DataPublicPluginSetup, DataPublicPluginStart } from 'src/plugins/data/public'; -import { UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; +import { DataPublicPluginStart } from 'src/plugins/data/public'; +import { + UnifiedSearchPublicPluginStart, + UnifiedSearchPluginSetup, +} from 'src/plugins/unified_search/public'; +import { DataPublicPluginSetup } from 'src/plugins/data/public'; import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; import { VisualizationsSetup, VisualizationsStart } from '../../visualizations/public'; import { createInputControlVisFn } from './input_control_fn'; @@ -26,6 +30,7 @@ export interface InputControlSettings { export interface InputControlVisDependencies { core: InputControlVisCoreSetup; data: DataPublicPluginSetup; + unifiedSearch: UnifiedSearchPluginSetup; getSettings: () => Promise; } @@ -34,6 +39,7 @@ export interface InputControlVisPluginSetupDependencies { expressions: ReturnType; visualizations: VisualizationsSetup; data: DataPublicPluginSetup; + unifiedSearch: UnifiedSearchPluginSetup; } /** @internal */ @@ -50,15 +56,16 @@ export class InputControlVisPlugin implements Plugin { public setup( core: InputControlVisCoreSetup, - { expressions, visualizations, data }: InputControlVisPluginSetupDependencies + { expressions, visualizations, unifiedSearch, data }: InputControlVisPluginSetupDependencies ) { const visualizationDependencies: Readonly = { core, - data, + unifiedSearch, getSettings: async () => { - const { timeout, terminateAfter } = data.autocomplete.getAutocompleteSettings(); + const { timeout, terminateAfter } = unifiedSearch.autocomplete.getAutocompleteSettings(); return { autocompleteTimeout: timeout, autocompleteTerminateAfter: terminateAfter }; }, + data, }; expressions.registerFunction(createInputControlVisFn); diff --git a/src/plugins/unified_search/config.ts b/src/plugins/unified_search/config.ts index c0067771b6803..4814dddea4052 100644 --- a/src/plugins/unified_search/config.ts +++ b/src/plugins/unified_search/config.ts @@ -8,6 +8,29 @@ import { schema, TypeOf } from '@kbn/config-schema'; -export const configSchema = schema.object({}); +export const configSchema = schema.object({ + autocomplete: schema.object({ + querySuggestions: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + }), + valueSuggestions: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + tiers: schema.arrayOf( + schema.oneOf([ + schema.literal('data_content'), + schema.literal('data_hot'), + schema.literal('data_warm'), + schema.literal('data_cold'), + schema.literal('data_frozen'), + ]), + { + defaultValue: ['data_hot', 'data_warm', 'data_content', 'data_cold'], + } + ), + terminateAfter: schema.duration({ defaultValue: 100000 }), + timeout: schema.duration({ defaultValue: 1000 }), + }), + }), +}); export type ConfigSchema = TypeOf; diff --git a/src/plugins/unified_search/kibana.json b/src/plugins/unified_search/kibana.json index 8673c6ec783bb..45d8c11756f78 100755 --- a/src/plugins/unified_search/kibana.json +++ b/src/plugins/unified_search/kibana.json @@ -7,8 +7,9 @@ "name": "Unified Search", "githubTeam": "kibana-app-services" }, - "server": false, + "server": true, "ui": true, "requiredPlugins": ["dataViews", "data", "uiActions"], - "requiredBundles": ["kibanaUtils", "kibanaReact", "data"] + "requiredBundles": ["kibanaUtils", "kibanaReact", "data"], + "serviceFolders": ["autocomplete"] } diff --git a/src/plugins/data/public/autocomplete/autocomplete_service.ts b/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts similarity index 93% rename from src/plugins/data/public/autocomplete/autocomplete_service.ts rename to src/plugins/unified_search/public/autocomplete/autocomplete_service.ts index 0d21c7e765501..cc7db23cc6c15 100644 --- a/src/plugins/data/public/autocomplete/autocomplete_service.ts +++ b/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts @@ -8,7 +8,7 @@ import { CoreSetup, PluginInitializerContext } from 'src/core/public'; import moment from 'moment'; -import type { TimefilterSetup } from '../query'; +import type { TimefilterSetup } from '../../../data/public'; import { QuerySuggestionGetFn } from './providers/query_suggestion_provider'; import { getEmptyValueSuggestions, @@ -23,7 +23,7 @@ import { KUERY_LANGUAGE_NAME, setupKqlQuerySuggestionProvider, } from './providers/kql_query_suggestion'; -import { DataPublicPluginStart, DataStartDependencies } from '../types'; +import { UnifiedSearchPublicPluginStart, UnifiedSearchStartDependencies } from '../types'; export class AutocompleteService { autocompleteConfig: ConfigSchema['autocomplete']; @@ -50,7 +50,7 @@ export class AutocompleteService { /** @public **/ public setup( - core: CoreSetup, + core: CoreSetup, { timefilter, usageCollection, diff --git a/src/plugins/data/public/autocomplete/collectors/create_usage_collector.ts b/src/plugins/unified_search/public/autocomplete/collectors/create_usage_collector.ts similarity index 100% rename from src/plugins/data/public/autocomplete/collectors/create_usage_collector.ts rename to src/plugins/unified_search/public/autocomplete/collectors/create_usage_collector.ts diff --git a/src/plugins/data/public/autocomplete/collectors/index.ts b/src/plugins/unified_search/public/autocomplete/collectors/index.ts similarity index 100% rename from src/plugins/data/public/autocomplete/collectors/index.ts rename to src/plugins/unified_search/public/autocomplete/collectors/index.ts diff --git a/src/plugins/data/public/autocomplete/collectors/types.ts b/src/plugins/unified_search/public/autocomplete/collectors/types.ts similarity index 100% rename from src/plugins/data/public/autocomplete/collectors/types.ts rename to src/plugins/unified_search/public/autocomplete/collectors/types.ts diff --git a/src/plugins/data/public/autocomplete/index.ts b/src/plugins/unified_search/public/autocomplete/index.ts similarity index 100% rename from src/plugins/data/public/autocomplete/index.ts rename to src/plugins/unified_search/public/autocomplete/index.ts diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/README.md b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/README.md similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/README.md rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/README.md diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts similarity index 94% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts index 24d9cdbfa6b3c..c02312b5aa937 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts @@ -7,7 +7,8 @@ */ import { setupGetConjunctionSuggestions } from './conjunction'; -import { QuerySuggestionGetFnArgs, KueryNode } from '../../../../../../../src/plugins/data/public'; +import { KueryNode } from '../../../../../../../src/plugins/data/public'; +import { QuerySuggestionGetFnArgs } from '../../index'; import { coreMock } from '../../../../../../../src/core/public/mocks'; const mockKueryNode = (kueryNode: Partial) => kueryNode as unknown as KueryNode; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx similarity index 69% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx index 4cad30943f4cf..979204e11305b 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx @@ -10,24 +10,21 @@ import React from 'react'; import { $Keys } from 'utility-types'; import { FormattedMessage } from '@kbn/i18n-react'; import { KqlQuerySuggestionProvider } from './types'; -import { - QuerySuggestion, - QuerySuggestionTypes, -} from '../../../../../../../src/plugins/data/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../../index'; const bothArgumentsText = ( ); const oneOrMoreArgumentsText = ( ); @@ -35,20 +32,20 @@ const conjunctions: Record = { and: (

{bothArgumentsText}, }} description="Full text: ' Requires both arguments to be true'. See - 'data.kueryAutocomplete.andOperatorDescription.bothArgumentsText' for 'both arguments' part." + 'unifiedSearch.kueryAutocomplete.andOperatorDescription.bothArgumentsText' for 'both arguments' part." />

), or: (

= { ), }} description="Full text: 'Requires one or more arguments to be true'. See - 'data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText' for 'one or more arguments' part." + 'unifiedSearch.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText' for 'one or more arguments' part." />

), diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts similarity index 97% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts index 9462b8c5d171f..ad69ad20c5b2e 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts @@ -9,12 +9,9 @@ import indexPatternResponse from './__fixtures__/index_pattern_response.json'; import { setupGetFieldSuggestions } from './field'; -import { - indexPatterns as indexPatternsUtils, - QuerySuggestionGetFnArgs, - KueryNode, -} from '../../../../../../../src/plugins/data/public'; -import { coreMock } from '../../../../../../../src/core/public/mocks'; +import { indexPatterns as indexPatternsUtils, KueryNode } from '../../../../../data/public'; +import { QuerySuggestionGetFnArgs } from '../../index'; +import { coreMock } from '../../../../../../core/public/mocks'; const mockKueryNode = (kueryNode: Partial) => kueryNode as unknown as KueryNode; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx similarity index 94% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx index a0008101b5aec..4ac59d3a868f4 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx @@ -9,12 +9,8 @@ import { flatten } from 'lodash'; import { escapeKuery } from './lib/escape_kuery'; import { sortPrefixFirst } from './sort_prefix_first'; -import { - IFieldType, - indexPatterns as indexPatternsUtils, - QuerySuggestionField, - QuerySuggestionTypes, -} from '../../../../../../../src/plugins/data/public'; +import { IFieldType, indexPatterns as indexPatternsUtils } from '../../../../../data/public'; +import { QuerySuggestionField, QuerySuggestionTypes } from '../../index'; import { KqlQuerySuggestionProvider } from './types'; const keywordComparator = (first: IFieldType, second: IFieldType) => { diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts similarity index 90% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts index c40f1dd925345..cceb1648e68ee 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts @@ -14,12 +14,8 @@ import { setupGetFieldSuggestions } from './field'; import { setupGetValueSuggestions } from './value'; import { setupGetOperatorSuggestions } from './operator'; import { setupGetConjunctionSuggestions } from './conjunction'; -import { - QuerySuggestion, - QuerySuggestionGetFnArgs, - QuerySuggestionGetFn, - DataPublicPluginStart, -} from '../../../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../index'; +import { QuerySuggestion, QuerySuggestionGetFnArgs, QuerySuggestionGetFn } from '../../index'; const cursorSymbol = '@kuery-cursor@'; @@ -29,7 +25,7 @@ const dedup = (suggestions: QuerySuggestion[]): QuerySuggestion[] => export const KUERY_LANGUAGE_NAME = 'kuery'; export const setupKqlQuerySuggestionProvider = ( - core: CoreSetup + core: CoreSetup ): QuerySuggestionGetFn => { const providers = { field: setupGetFieldSuggestions(core), diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.test.ts similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.test.ts diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.ts similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/lib/escape_kuery.ts diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts similarity index 95% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts index ab1d79eb522c1..c64d97aae8b96 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts @@ -9,8 +9,9 @@ import indexPatternResponse from './__fixtures__/index_pattern_response.json'; import { setupGetOperatorSuggestions } from './operator'; -import { QuerySuggestionGetFnArgs, KueryNode } from '../../../../../../../src/plugins/data/public'; -import { coreMock } from '../../../../../../../src/core/public/mocks'; +import { KueryNode } from '../../../../../data/public'; +import { QuerySuggestionGetFnArgs } from '../../index'; +import { coreMock } from '../../../../../../core/public/mocks'; const mockKueryNode = (kueryNode: Partial) => kueryNode as unknown as KueryNode; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.tsx similarity index 65% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.tsx index 4e1efef73a42b..0a176c9b9bd40 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.tsx @@ -12,48 +12,48 @@ import { $Keys } from 'utility-types'; import { flatten } from 'lodash'; import { KqlQuerySuggestionProvider } from './types'; -import { QuerySuggestionTypes } from '../../../../../../../src/plugins/data/public'; +import { QuerySuggestionTypes } from '../../index'; const equalsText = ( ); const lessThanOrEqualToText = ( ); const greaterThanOrEqualToText = ( ); const lessThanText = ( ); const greaterThanText = ( ); const existsText = ( ); @@ -61,11 +61,11 @@ const operators = { ':': { description: ( {equalsText} }} description="Full text: 'equals some value'. See - 'data.kueryAutocomplete.equalOperatorDescription.equalsText' for 'equals' part." + 'unifiedSearch.kueryAutocomplete.equalOperatorDescription.equalsText' for 'equals' part." /> ), fieldTypes: [ @@ -84,7 +84,7 @@ const operators = { '<=': { description: ( ), fieldTypes: ['number', 'number_range', 'date', 'date_range', 'ip', 'ip_range'], @@ -100,7 +100,7 @@ const operators = { '>=': { description: ( ), fieldTypes: ['number', 'number_range', 'date', 'date_range', 'ip', 'ip_range'], @@ -116,11 +116,11 @@ const operators = { '<': { description: ( {lessThanText} }} description="Full text: 'is less than some value'. See - 'data.kueryAutocomplete.lessThanOperatorDescription.lessThanText' for 'less than' part." + 'unifiedSearch.kueryAutocomplete.lessThanOperatorDescription.lessThanText' for 'less than' part." /> ), fieldTypes: ['number', 'number_range', 'date', 'date_range', 'ip', 'ip_range'], @@ -128,13 +128,13 @@ const operators = { '>': { description: ( {greaterThanText}, }} description="Full text: 'is greater than some value'. See - 'data.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText' for 'greater than' part." + 'unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText' for 'greater than' part." /> ), fieldTypes: ['number', 'number_range', 'date', 'date_range', 'ip', 'ip_range'], @@ -142,11 +142,11 @@ const operators = { ': *': { description: ( {existsText} }} description="Full text: 'exists in any form'. See - 'data.kueryAutocomplete.existOperatorDescription.existsText' for 'exists' part." + 'unifiedSearch.kueryAutocomplete.existOperatorDescription.existsText' for 'exists' part." /> ), fieldTypes: undefined, diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.test.ts similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.test.ts diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.ts similarity index 100% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/sort_prefix_first.ts diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/types.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/types.ts similarity index 75% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/types.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/types.ts index 12a0dae97ebaa..0f7564ab38197 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/types.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/types.ts @@ -8,12 +8,9 @@ import { KueryNode } from '@kbn/es-query'; import { CoreSetup } from 'kibana/public'; -import { - DataPublicPluginStart, - QuerySuggestionBasic, - QuerySuggestionGetFnArgs, -} from '../../../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../types'; +import { QuerySuggestionBasic, QuerySuggestionGetFnArgs } from '../../index'; export type KqlQuerySuggestionProvider = ( - core: CoreSetup + core: CoreSetup ) => (querySuggestionsGetFnArgs: QuerySuggestionGetFnArgs, kueryNode: KueryNode) => Promise; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.test.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts similarity index 98% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts index 27031209c42a5..af7bb40442ed0 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts @@ -9,7 +9,8 @@ import { setupGetValueSuggestions } from './value'; import indexPatternResponse from './__fixtures__/index_pattern_response.json'; import { coreMock } from '../../../../../../../src/core/public/mocks'; -import { QuerySuggestionGetFnArgs, KueryNode } from '../../../../../../../src/plugins/data/public'; +import { KueryNode } from '../../../../../data/public'; +import { QuerySuggestionGetFnArgs } from '../../index'; const mockKueryNode = (kueryNode: Partial) => kueryNode as unknown as KueryNode; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts similarity index 89% rename from src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.ts rename to src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts index cee7d37a1a12d..c609f4e742908 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/value.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts @@ -10,13 +10,9 @@ import { flatten } from 'lodash'; import { CoreSetup } from 'kibana/public'; import { escapeQuotes } from './lib/escape_kuery'; import { KqlQuerySuggestionProvider } from './types'; -import { - DataPublicPluginStart, - IFieldType, - IIndexPattern, - QuerySuggestion, - QuerySuggestionTypes, -} from '../../../../../../../src/plugins/data/public'; +import { IFieldType, IIndexPattern } from '../../../../../data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../types'; +import { QuerySuggestion, QuerySuggestionTypes } from '../../index'; const wrapAsSuggestions = (start: number, end: number, query: string, values: string[]) => values @@ -29,7 +25,7 @@ const wrapAsSuggestions = (start: number, end: number, query: string, values: st })); export const setupGetValueSuggestions: KqlQuerySuggestionProvider = ( - core: CoreSetup + core: CoreSetup ) => { const autoCompleteServicePromise = core .getStartServices() diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts similarity index 90% rename from src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts rename to src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts index 0cb229c9b41bc..0d5bca75edc41 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { ValueSuggestionsMethod } from '../../../common'; -import { IFieldType, IIndexPattern } from '../../../common'; +import { ValueSuggestionsMethod } from '../../../../data/common'; +import { IFieldType, IIndexPattern } from '../../../../data/common'; export enum QuerySuggestionTypes { Field = 'field', diff --git a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.test.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts similarity index 97% rename from src/plugins/data/public/autocomplete/providers/value_suggestion_provider.test.ts rename to src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts index 4a68c7232ea7e..2dba8cc44159f 100644 --- a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -import { stubIndexPattern, stubFields } from '../../stubs'; -import type { TimefilterSetup } from '../../query'; +import { stubIndexPattern, stubFields } from '../../../../data/public/stubs'; +import type { TimefilterSetup } from '../../../../data/public'; import { setupValueSuggestionProvider } from './value_suggestion_provider'; import type { ValueSuggestionsGetFn } from './value_suggestion_provider'; import { IUiSettingsClient, CoreSetup } from 'kibana/public'; -import { UI_SETTINGS } from '../../../common'; +import { UI_SETTINGS } from '../../../../data/common'; describe('FieldSuggestions', () => { let getValueSuggestions: ValueSuggestionsGetFn; diff --git a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts similarity index 95% rename from src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts rename to src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts index 0caf2d4ced530..54aab72e2eb7f 100644 --- a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts @@ -10,8 +10,13 @@ import dateMath from '@kbn/datemath'; import { buildQueryFromFilters } from '@kbn/es-query'; import { memoize } from 'lodash'; import { CoreSetup } from 'src/core/public'; -import { IIndexPattern, IFieldType, UI_SETTINGS, ValueSuggestionsMethod } from '../../../common'; -import type { TimefilterSetup } from '../../query'; +import { + IIndexPattern, + IFieldType, + UI_SETTINGS, + ValueSuggestionsMethod, +} from '../../../../data/common'; +import type { TimefilterSetup } from '../../../../data/public'; import { AutocompleteUsageCollector } from '../collectors'; export type ValueSuggestionsGetFn = (args: ValueSuggestionsGetFnArgs) => Promise; diff --git a/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_suggestor.tsx b/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_suggestor.tsx index 68ed20e8c34dd..1c7ba5b5394de 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_suggestor.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_suggestor.tsx @@ -13,6 +13,7 @@ import { withKibana, KibanaReactContextValue } from '../../../../kibana_react/pu import { IFieldType, UI_SETTINGS } from '../../../../data/common'; import { DataView } from '../../../../data_views/common'; import { IDataPluginServices } from '../../../../data/public'; +import { getAutocomplete } from '../../services'; export interface PhraseSuggestorProps { kibana: KibanaReactContextValue; @@ -79,8 +80,7 @@ export class PhraseSuggestorUI extends React.Com return; } this.setState({ isLoading: true }); - - const suggestions = await this.services.data.autocomplete.getValueSuggestions({ + const suggestions = await getAutocomplete().getValueSuggestions({ indexPattern, field, query, diff --git a/src/plugins/unified_search/public/index.ts b/src/plugins/unified_search/public/index.ts index 3eb528dc07ba1..09bb12066cc08 100755 --- a/src/plugins/unified_search/public/index.ts +++ b/src/plugins/unified_search/public/index.ts @@ -5,21 +5,34 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import { PluginInitializerContext } from '../../../core/public'; import { ConfigSchema } from '../config'; -import { UnifiedSearchPublicPlugin } from './plugin'; - export type { IndexPatternSelectProps } from './index_pattern_select'; export type { QueryStringInputProps } from './query_string_input'; export { QueryStringInput } from './query_string_input'; export type { StatefulSearchBarProps, SearchBarProps } from './search_bar'; -export type { UnifiedSearchPublicPluginStart } from './types'; +export type { UnifiedSearchPublicPluginStart, UnifiedSearchPluginSetup } from './types'; export { SearchBar } from './search_bar'; export { FilterLabel, FilterItem } from './filter_bar'; export type { ApplyGlobalFilterActionContext } from './actions'; export { ACTION_GLOBAL_APPLY_FILTER } from './actions'; +/* + * Autocomplete query suggestions: + */ +export type { + QuerySuggestion, + QuerySuggestionGetFn, + QuerySuggestionGetFnArgs, + AutocompleteStart, +} from './autocomplete'; + +export { QuerySuggestionTypes } from './autocomplete'; + +import { UnifiedSearchPublicPlugin } from './plugin'; + // This exports static code and TypeScript types, // as well as, Kibana Platform `plugin()` initializer. export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/unified_search/public/mocks.ts b/src/plugins/unified_search/public/mocks.ts index eacbb72cc55ac..e119c58e89f3f 100644 --- a/src/plugins/unified_search/public/mocks.ts +++ b/src/plugins/unified_search/public/mocks.ts @@ -7,12 +7,31 @@ */ import { UnifiedSearchPublicPlugin } from './plugin'; +import { AutocompleteStart, AutocompleteSetup } from './autocomplete'; export type Setup = jest.Mocked>; export type Start = jest.Mocked>; +const autocompleteSetupMock: jest.Mocked = { + getQuerySuggestions: jest.fn(), + getAutocompleteSettings: jest.fn(), +}; + +const autocompleteStartMock: jest.Mocked = { + getValueSuggestions: jest.fn(), + getQuerySuggestions: jest.fn(), + hasQuerySuggestions: jest.fn(), +}; + +const createSetupContract = (): Setup => { + return { + autocomplete: autocompleteSetupMock, + }; +}; + const createStartContract = (): Start => { return { + autocomplete: autocompleteStartMock, ui: { IndexPatternSelect: jest.fn(), SearchBar: jest.fn().mockReturnValue(null), @@ -22,4 +41,5 @@ const createStartContract = (): Start => { export const unifiedSearchPluginMock = { createStartContract, + createSetupContract, }; diff --git a/src/plugins/unified_search/public/plugin.ts b/src/plugins/unified_search/public/plugin.ts index 9a7121ddc9114..1d01179fcfa82 100755 --- a/src/plugins/unified_search/public/plugin.ts +++ b/src/plugins/unified_search/public/plugin.ts @@ -11,7 +11,8 @@ import './index.scss'; import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/public'; import { Storage, IStorageWrapper } from '../../kibana_utils/public'; import { ConfigSchema } from '../config'; -import { setIndexPatterns, setTheme, setOverlays } from './services'; +import { setIndexPatterns, setTheme, setOverlays, setAutocomplete } from './services'; +import { AutocompleteService } from './autocomplete'; import type { UsageCollectionSetup } from '../../usage_collection/public'; import { createSearchBar } from './search_bar'; import { createIndexPatternSelect } from './index_pattern_select'; @@ -25,22 +26,30 @@ export class UnifiedSearchPublicPlugin implements Plugin { private readonly storage: IStorageWrapper; + private readonly autocomplete: AutocompleteService; private usageCollection: UsageCollectionSetup | undefined; constructor(initializerContext: PluginInitializerContext) { this.storage = new Storage(window.localStorage); + + this.autocomplete = new AutocompleteService(initializerContext); } public setup( - core: CoreSetup, - { uiActions, data }: UnifiedSearchSetupDependencies + core: CoreSetup, + { uiActions, data, usageCollection }: UnifiedSearchSetupDependencies ): UnifiedSearchPluginSetup { const { query } = data; uiActions.registerAction( createFilterAction(query.filterManager, query.timefilter.timefilter, core.theme) ); - return {}; + return { + autocomplete: this.autocomplete.setup(core, { + timefilter: query.timefilter, + usageCollection, + }), + }; } public start( @@ -50,6 +59,8 @@ export class UnifiedSearchPublicPlugin setTheme(core.theme); setOverlays(core.overlays); setIndexPatterns(dataViews); + const autocompleteStart = this.autocomplete.start(); + setAutocomplete(autocompleteStart); const SearchBar = createSearchBar({ core, @@ -68,8 +79,11 @@ export class UnifiedSearchPublicPlugin IndexPatternSelect: createIndexPatternSelect(dataViews), SearchBar, }, + autocomplete: autocompleteStart, }; } - public stop() {} + public stop() { + this.autocomplete.clearProviders(); + } } diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx index e8ca82782d11f..172c1f6a51ab2 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx @@ -20,6 +20,9 @@ import { KibanaContextProvider } from '../../../kibana_react/public'; import { I18nProvider } from '@kbn/i18n-react'; import { stubIndexPattern } from '../../../data/public/stubs'; import { UI_SETTINGS } from '../../../data/common'; +import { setAutocomplete } from '../../../unified_search/public/services'; +import { unifiedSearchPluginMock } from '../../../unified_search/public/mocks'; + const startMock = coreMock.createStart(); const mockTimeHistory = { @@ -112,6 +115,11 @@ describe('QueryBarTopRowTopRow', () => { jest.clearAllMocks(); }); + beforeEach(() => { + const autocompleteStart = unifiedSearchPluginMock.createStartContract(); + setAutocomplete(autocompleteStart.autocomplete); + }); + it('Should render query and time picker', () => { const { getByText, getByTestId } = render( wrapQueryBarTopRowInContext({ diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx index 4a48b3cc42420..579d483f1ae86 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx @@ -28,6 +28,9 @@ import { dataPluginMock } from '../../../data/public/mocks'; import { stubIndexPattern } from '../../../data/public/stubs'; import { KibanaContextProvider, withKibana } from '../../../kibana_react/public'; +import { setAutocomplete } from '../../../unified_search/public/services'; +import { unifiedSearchPluginMock } from '../../../unified_search/public/mocks'; + jest.useFakeTimers(); const startMock = coreMock.createStart(); @@ -92,6 +95,11 @@ describe('QueryStringInput', () => { jest.clearAllMocks(); }); + beforeEach(() => { + const autocompleteStart = unifiedSearchPluginMock.createStartContract(); + setAutocomplete(autocompleteStart.autocomplete); + }); + it('Should render the given query', async () => { const { getByText } = render( wrapQueryStringInputInContext({ diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx index a9b093eb3c8bb..c40a551265146 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx @@ -28,13 +28,8 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { compact, debounce, isEqual, isFunction } from 'lodash'; import { Toast } from '../../../../core/public'; -import { - IDataPluginServices, - Query, - QuerySuggestion, - QuerySuggestionTypes, - getQueryLog, -} from '../../../data/public'; +import { IDataPluginServices, Query, getQueryLog } from '../../../data/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; import { DataView } from '../../../data_views/public'; import { matchPairs } from './match_pairs'; import { toUser } from './to_user'; @@ -47,7 +42,7 @@ import { QueryLanguageSwitcher } from './language_switcher'; import type { SuggestionsListSize } from '../typeahead/suggestions_component'; import { SuggestionsComponent } from '../typeahead'; import { onRaf } from '../utils'; -import { getTheme } from '../services'; +import { getTheme, getAutocomplete } from '../services'; export interface QueryStringInputProps { indexPatterns: Array; @@ -201,7 +196,7 @@ export default class QueryStringInputUI extends PureComponent { const queryString = this.getQueryString(); const recentSearchSuggestions = this.getRecentSearchSuggestions(queryString); - const hasQuerySuggestions = this.services.data.autocomplete.hasQuerySuggestions(language); + const hasQuerySuggestions = getAutocomplete().hasQuerySuggestions(language); if ( !hasQuerySuggestions || @@ -222,7 +217,7 @@ export default class QueryStringInputUI extends PureComponent { if (this.abortController) this.abortController.abort(); this.abortController = new AbortController(); const suggestions = - (await this.services.data.autocomplete.getQuerySuggestions({ + (await getAutocomplete().getQuerySuggestions({ language, indexPatterns, query: queryString, diff --git a/src/plugins/unified_search/public/services.ts b/src/plugins/unified_search/public/services.ts index eb2008a107b31..a2ae2f0016936 100644 --- a/src/plugins/unified_search/public/services.ts +++ b/src/plugins/unified_search/public/services.ts @@ -9,6 +9,7 @@ import { ThemeServiceStart, OverlayStart } from 'src/core/public'; import { createGetterSetter } from '../../kibana_utils/public'; import { DataViewsContract } from '../../data_views/public'; +import { AutocompleteStart } from '../public'; export const [getIndexPatterns, setIndexPatterns] = createGetterSetter('IndexPatterns'); @@ -16,3 +17,6 @@ export const [getIndexPatterns, setIndexPatterns] = export const [getTheme, setTheme] = createGetterSetter('Theme'); export const [getOverlays, setOverlays] = createGetterSetter('Overlays'); + +export const [getAutocomplete, setAutocomplete] = + createGetterSetter('Autocomplete'); diff --git a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx index 39d140a10229f..9d5f2f4a20420 100644 --- a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../data/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../../../unified_search/public'; import { SuggestionComponent } from './suggestion_component'; const noop = () => { diff --git a/src/plugins/unified_search/public/typeahead/suggestion_component.tsx b/src/plugins/unified_search/public/typeahead/suggestion_component.tsx index dc5b94800f97b..e00414aee0728 100644 --- a/src/plugins/unified_search/public/typeahead/suggestion_component.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestion_component.tsx @@ -9,7 +9,7 @@ import { EuiIcon } from '@elastic/eui'; import classNames from 'classnames'; import React, { useCallback } from 'react'; -import { QuerySuggestion } from '../../../data/public'; +import { QuerySuggestion } from '../../../unified_search/public'; import { SuggestionOnClick, SuggestionOnMouseEnter } from './types'; function getEuiIconType(type: string) { diff --git a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx index 947b1a0be4d1f..328474d179fcc 100644 --- a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../data/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../../../unified_search/public'; import { SuggestionComponent } from './suggestion_component'; import SuggestionsComponent from './suggestions_component'; diff --git a/src/plugins/unified_search/public/typeahead/suggestions_component.tsx b/src/plugins/unified_search/public/typeahead/suggestions_component.tsx index 9446653df2ee7..31b6209194d66 100644 --- a/src/plugins/unified_search/public/typeahead/suggestions_component.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestions_component.tsx @@ -13,7 +13,7 @@ import classNames from 'classnames'; import styled from 'styled-components'; import useRafState from 'react-use/lib/useRafState'; -import { QuerySuggestion } from '../../../data/public'; +import { QuerySuggestion } from '../../../unified_search/public'; import { SuggestionComponent } from './suggestion_component'; import { SUGGESTIONS_LIST_REQUIRED_BOTTOM_SPACE, diff --git a/src/plugins/unified_search/public/typeahead/types.ts b/src/plugins/unified_search/public/typeahead/types.ts index 25d4909800044..643b99c1799a5 100644 --- a/src/plugins/unified_search/public/typeahead/types.ts +++ b/src/plugins/unified_search/public/typeahead/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { QuerySuggestion } from '../../../data/public'; +import { QuerySuggestion } from '../../../unified_search/public'; export type SuggestionOnClick = (suggestion: QuerySuggestion, index: number) => void; diff --git a/src/plugins/unified_search/public/types.ts b/src/plugins/unified_search/public/types.ts index b5de235e7a563..6bf1f97c23990 100755 --- a/src/plugins/unified_search/public/types.ts +++ b/src/plugins/unified_search/public/types.ts @@ -10,14 +10,18 @@ import type { FieldFormatsStart } from '../../field_formats/public'; import { IndexPatternSelectProps, StatefulSearchBarProps } from './index'; import type { DataPublicPluginStart } from '../../data/public'; import type { UiActionsSetup, UiActionsStart } from '../../ui_actions/public'; +import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; +import { UsageCollectionSetup } from '../../usage_collection/public'; export interface UnifiedSearchSetupDependencies { uiActions: UiActionsSetup; data: DataPublicPluginStart; + usageCollection?: UsageCollectionSetup; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface UnifiedSearchPluginSetup {} +export interface UnifiedSearchPluginSetup { + autocomplete: AutocompleteSetup; +} export interface UnifiedSearchStartDependencies { dataViews: DataViewsPublicPluginStart; @@ -38,6 +42,11 @@ export interface UnifiedSearchPublicPluginStartUi { * Unified search plugin public Start contract */ export interface UnifiedSearchPublicPluginStart { + /** + * autocomplete service + * {@link AutocompleteStart} + */ + autocomplete: AutocompleteStart; /** * prewired UI components * {@link DataPublicPluginStartUi} diff --git a/src/plugins/data/server/autocomplete/autocomplete_service.ts b/src/plugins/unified_search/server/autocomplete/autocomplete_service.ts similarity index 100% rename from src/plugins/data/server/autocomplete/autocomplete_service.ts rename to src/plugins/unified_search/server/autocomplete/autocomplete_service.ts diff --git a/src/plugins/data/server/autocomplete/index.ts b/src/plugins/unified_search/server/autocomplete/index.ts similarity index 100% rename from src/plugins/data/server/autocomplete/index.ts rename to src/plugins/unified_search/server/autocomplete/index.ts diff --git a/src/plugins/data/server/autocomplete/routes.ts b/src/plugins/unified_search/server/autocomplete/routes.ts similarity index 100% rename from src/plugins/data/server/autocomplete/routes.ts rename to src/plugins/unified_search/server/autocomplete/routes.ts diff --git a/src/plugins/data/server/autocomplete/terms_agg.test.ts b/src/plugins/unified_search/server/autocomplete/terms_agg.test.ts similarity index 100% rename from src/plugins/data/server/autocomplete/terms_agg.test.ts rename to src/plugins/unified_search/server/autocomplete/terms_agg.test.ts diff --git a/src/plugins/data/server/autocomplete/terms_agg.ts b/src/plugins/unified_search/server/autocomplete/terms_agg.ts similarity index 97% rename from src/plugins/data/server/autocomplete/terms_agg.ts rename to src/plugins/unified_search/server/autocomplete/terms_agg.ts index 742812adafbb9..7200f523ee6b3 100644 --- a/src/plugins/data/server/autocomplete/terms_agg.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_agg.ts @@ -10,7 +10,7 @@ import { get, map } from 'lodash'; import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ConfigSchema } from '../../config'; -import { IFieldType, getFieldSubtypeNested } from '../../common'; +import { IFieldType, getFieldSubtypeNested } from '../../../data/common'; import { findIndexPatternById, getFieldByName } from '../data_views'; export async function termsAggSuggestions( diff --git a/src/plugins/data/server/autocomplete/terms_enum.test.ts b/src/plugins/unified_search/server/autocomplete/terms_enum.test.ts similarity index 100% rename from src/plugins/data/server/autocomplete/terms_enum.test.ts rename to src/plugins/unified_search/server/autocomplete/terms_enum.test.ts diff --git a/src/plugins/data/server/autocomplete/terms_enum.ts b/src/plugins/unified_search/server/autocomplete/terms_enum.ts similarity index 97% rename from src/plugins/data/server/autocomplete/terms_enum.ts rename to src/plugins/unified_search/server/autocomplete/terms_enum.ts index e4dca0a739087..e4cb459622c3f 100644 --- a/src/plugins/data/server/autocomplete/terms_enum.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_enum.ts @@ -8,7 +8,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IFieldType } from '../../common'; +import { IFieldType } from '../../../data/common'; import { findIndexPatternById, getFieldByName } from '../data_views'; import { ConfigSchema } from '../../config'; diff --git a/src/plugins/data/server/autocomplete/value_suggestions_route.ts b/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts similarity index 97% rename from src/plugins/data/server/autocomplete/value_suggestions_route.ts rename to src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts index de76183da3be3..989b63c3a31d0 100644 --- a/src/plugins/data/server/autocomplete/value_suggestions_route.ts +++ b/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts @@ -10,7 +10,7 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from 'kibana/server'; import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { getRequestAbortedSignal } from '../lib'; +import { getRequestAbortedSignal } from '../../../data/server'; import { getKbnServerError, reportServerError } from '../../../kibana_utils/server'; import type { ConfigSchema } from '../../config'; import { termsEnumSuggestions } from './terms_enum'; diff --git a/src/plugins/data/server/config_deprecations.test.ts b/src/plugins/unified_search/server/config_deprecations.test.ts similarity index 70% rename from src/plugins/data/server/config_deprecations.test.ts rename to src/plugins/unified_search/server/config_deprecations.test.ts index 3df1ea9119292..251d36fb18183 100644 --- a/src/plugins/data/server/config_deprecations.test.ts +++ b/src/plugins/unified_search/server/config_deprecations.test.ts @@ -36,14 +36,14 @@ const applyConfigDeprecations = (settings: Record = {}) => { }; describe('Config Deprecations', () => { - it('does not report deprecations for default configuration', () => { - const defaultConfig = { data: { autocomplete: { valueSuggestions: {} } } }; - const { messages, migrated } = applyConfigDeprecations(cloneDeep(defaultConfig)); - expect(migrated).toEqual(defaultConfig); + it('does not report deprecations for default configurationc', () => { + const configFirstStep = { data: { autocomplete: { valueSuggestions: {} } } }; + const { messages, migrated } = applyConfigDeprecations(cloneDeep(configFirstStep)); + expect(migrated).toEqual(configFirstStep); expect(messages).toHaveLength(0); }); - it('renames kibana.autocompleteTerminateAfter to data.autocomplete.valueSuggestions.terminateAfter', () => { + it('renames kibana.autocompleteTerminateAfter to unifiedSearch.autocomplete.valueSuggestions.terminateAfter', () => { const config = { kibana: { autocompleteTerminateAfter: 123, @@ -51,15 +51,16 @@ describe('Config Deprecations', () => { }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); expect(migrated.kibana?.autocompleteTerminateAfter).not.toBeDefined(); - expect(migrated.data.autocomplete.valueSuggestions.terminateAfter).toEqual(123); + expect(migrated.unifiedSearch.autocomplete.valueSuggestions.terminateAfter).toEqual(123); expect(messages).toMatchInlineSnapshot(` Array [ "Setting \\"kibana.autocompleteTerminateAfter\\" has been replaced by \\"data.autocomplete.valueSuggestions.terminateAfter\\"", + "Setting \\"data.autocomplete.valueSuggestions.terminateAfter\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.terminateAfter\\"", ] `); }); - it('renames kibana.autocompleteTimeout to data.autocomplete.valueSuggestions.timeout', () => { + it('renames kibana.autocompleteTimeout to unifiedSearch.autocomplete.valueSuggestions.timeout', () => { const config = { kibana: { autocompleteTimeout: 123, @@ -67,10 +68,11 @@ describe('Config Deprecations', () => { }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); expect(migrated.kibana?.autocompleteTimeout).not.toBeDefined(); - expect(migrated.data.autocomplete.valueSuggestions.timeout).toEqual(123); + expect(migrated.unifiedSearch.autocomplete.valueSuggestions.timeout).toEqual(123); expect(messages).toMatchInlineSnapshot(` Array [ "Setting \\"kibana.autocompleteTimeout\\" has been replaced by \\"data.autocomplete.valueSuggestions.timeout\\"", + "Setting \\"data.autocomplete.valueSuggestions.timeout\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.timeout\\"", ] `); }); diff --git a/src/plugins/data/server/config_deprecations.ts b/src/plugins/unified_search/server/config_deprecations.ts similarity index 70% rename from src/plugins/data/server/config_deprecations.ts rename to src/plugins/unified_search/server/config_deprecations.ts index d98364a8e83c6..75751e5157411 100644 --- a/src/plugins/data/server/config_deprecations.ts +++ b/src/plugins/unified_search/server/config_deprecations.ts @@ -16,7 +16,19 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = 'data.autocomplete.valueSuggestions.terminateAfter', { level: 'warning' } ), + renameFromRoot( + 'data.autocomplete.valueSuggestions.terminateAfter', + 'unifiedSearch.autocomplete.valueSuggestions.terminateAfter', + { level: 'warning' } + ), renameFromRoot('kibana.autocompleteTimeout', 'data.autocomplete.valueSuggestions.timeout', { level: 'warning', }), + renameFromRoot( + 'data.autocomplete.valueSuggestions.timeout', + 'unifiedSearch.autocomplete.valueSuggestions.timeout', + { + level: 'warning', + } + ), ]; diff --git a/src/plugins/unified_search/server/data_views/index.ts b/src/plugins/unified_search/server/data_views/index.ts new file mode 100644 index 0000000000000..91a61f4bcb7db --- /dev/null +++ b/src/plugins/unified_search/server/data_views/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from '../../../data_views/server'; diff --git a/src/plugins/unified_search/server/index.ts b/src/plugins/unified_search/server/index.ts new file mode 100644 index 0000000000000..6338be59a7793 --- /dev/null +++ b/src/plugins/unified_search/server/index.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../core/server'; +import { ConfigSchema, configSchema } from '../config'; +import { + UnifiedSearchServerPlugin, + UnifiedSearchServerPluginSetup, + UnifiedSearchServerPluginStart, +} from './plugin'; + +import { autocompleteConfigDeprecationProvider } from './config_deprecations'; + +/** + * Static code to be shared externally + * @public + */ + +export function plugin(initializerContext: PluginInitializerContext) { + return new UnifiedSearchServerPlugin(initializerContext); +} + +export type { + UnifiedSearchServerPluginSetup as PluginSetup, + UnifiedSearchServerPluginStart as PluginStart, +}; +export { UnifiedSearchServerPlugin as Plugin }; + +export const config: PluginConfigDescriptor = { + deprecations: autocompleteConfigDeprecationProvider, + exposeToBrowser: { + autocomplete: true, + }, + schema: configSchema, +}; diff --git a/src/plugins/unified_search/server/mocks.ts b/src/plugins/unified_search/server/mocks.ts new file mode 100644 index 0000000000000..7f63abcdaae0c --- /dev/null +++ b/src/plugins/unified_search/server/mocks.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AutocompleteSetup } from './autocomplete'; + +const autocompleteSetupMock: jest.Mocked = { + getAutocompleteSettings: jest.fn(), +}; + +function createSetupContract() { + return { + autocomplete: autocompleteSetupMock, + }; +} + +export const dataPluginMock = { + createSetupContract, +}; diff --git a/src/plugins/unified_search/server/plugin.ts b/src/plugins/unified_search/server/plugin.ts new file mode 100644 index 0000000000000..9d6fc62b9e207 --- /dev/null +++ b/src/plugins/unified_search/server/plugin.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '../../../core/server'; +import { ConfigSchema } from '../config'; +import { AutocompleteService } from './autocomplete'; +import { AutocompleteSetup } from './autocomplete/autocomplete_service'; + +export interface UnifiedSearchServerPluginSetup { + autocomplete: AutocompleteSetup; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UnifiedSearchServerPluginStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UnifiedSearchServerPluginSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UnifiedSearchServerPluginStartDependencies {} + +export class UnifiedSearchServerPlugin implements Plugin { + private readonly autocompleteService: AutocompleteService; + + constructor(initializerContext: PluginInitializerContext) { + this.autocompleteService = new AutocompleteService(initializerContext); + } + + public setup( + core: CoreSetup, + {}: UnifiedSearchServerPluginSetupDependencies + ) { + return { + autocomplete: this.autocompleteService.setup(core), + }; + } + + public start(core: CoreStart, {}: UnifiedSearchServerPluginStartDependencies) { + return {}; + } + + public stop() {} +} + +export { UnifiedSearchServerPlugin as Plugin }; diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index 3ff1ba630ac27..41dc76f1305be 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -9,7 +9,9 @@ "include": [ "public/**/*", "config.ts", - "public/**/*.json" + "public/**/*.json", + "server/**/*", + "config.ts", ], "references": [ { "path": "../../core/tsconfig.json" }, diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index c18e38cc1a4d6..670ab6d7241e8 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -85,11 +85,11 @@ export default function ({ getService }: PluginFunctionalProviderContext) { // Ensure that your change does not unintentionally expose any sensitive values! 'console.ui.enabled (boolean)', 'dashboard.allowByValueEmbeddables (boolean)', - 'data.autocomplete.querySuggestions.enabled (boolean)', - 'data.autocomplete.valueSuggestions.enabled (boolean)', - 'data.autocomplete.valueSuggestions.terminateAfter (duration)', - 'data.autocomplete.valueSuggestions.tiers (array)', - 'data.autocomplete.valueSuggestions.timeout (duration)', + 'unified_search.autocomplete.querySuggestions.enabled (boolean)', + 'unified_search.autocomplete.valueSuggestions.enabled (boolean)', + 'unified_search.autocomplete.valueSuggestions.terminateAfter (duration)', + 'unified_search.autocomplete.valueSuggestions.tiers (array)', + 'unified_search.autocomplete.valueSuggestions.timeout (duration)', 'data.search.aggs.shardDelay.enabled (boolean)', 'enterpriseSearch.host (string)', 'home.disableWelcomeScreen (boolean)', diff --git a/x-pack/plugins/apm/kibana.json b/x-pack/plugins/apm/kibana.json index 8b5ac68f07a22..739bac6a0bb63 100644 --- a/x-pack/plugins/apm/kibana.json +++ b/x-pack/plugins/apm/kibana.json @@ -16,7 +16,8 @@ "licensing", "observability", "ruleRegistry", - "triggersActionsUi" + "triggersActionsUi", + "unifiedSearch" ], "optionalPlugins": [ "actions", diff --git a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx index 0fb84aa7164bb..3df5ba1d0721e 100644 --- a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx @@ -11,10 +11,8 @@ import { uniqueId } from 'lodash'; import React, { useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { DataView } from '../../../../../../../src/plugins/data/common'; -import { - esKuery, - QuerySuggestion, -} from '../../../../../../../src/plugins/data/public'; +import { esKuery } from '../../../../../../../src/plugins/data/public'; +import { QuerySuggestion } from '../../../../../../../src/plugins/unified_search/public'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params'; import { useApmParams } from '../../../hooks/use_apm_params'; @@ -58,7 +56,7 @@ export function KueryBar(props: { }); const { urlParams } = useLegacyUrlParams(); const location = useLocation(); - const { data } = useApmPluginContext().plugins; + const { unifiedSearch } = useApmPluginContext().plugins; let currentRequestCheck; @@ -106,7 +104,7 @@ export function KueryBar(props: { try { const suggestions = ( - (await data.autocomplete.getQuerySuggestions({ + (await unifiedSearch.autocomplete.getQuerySuggestions({ language: 'kuery', indexPatterns: [dataView], boolFilter: diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 83aad1b3b4fe6..c475a3d31cbca 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -18,9 +18,10 @@ import { PluginInitializerContext, } from '../../../../src/core/public'; import type { - DataPublicPluginSetup, DataPublicPluginStart, + DataPublicPluginSetup, } from '../../../../src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from '../../../../src/plugins/unified_search/public'; import type { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { Start as InspectorPluginStart } from '../../../../src/plugins/inspector/public'; @@ -63,6 +64,7 @@ export type ApmPluginStart = void; export interface ApmPluginSetupDeps { alerting?: AlertingPluginPublicSetup; data: DataPublicPluginSetup; + unifiedSearch: UnifiedSearchPublicPluginStart; features: FeaturesPluginSetup; home?: HomePublicPluginSetup; licensing: LicensingPluginSetup; diff --git a/x-pack/plugins/fleet/.storybook/context/stubs.tsx b/x-pack/plugins/fleet/.storybook/context/stubs.tsx index 0f4f81b58f95d..092ab680b819f 100644 --- a/x-pack/plugins/fleet/.storybook/context/stubs.tsx +++ b/x-pack/plugins/fleet/.storybook/context/stubs.tsx @@ -11,6 +11,7 @@ type Stubs = | 'licensing' | 'storage' | 'data' + | 'unifiedSearch' | 'deprecations' | 'fatalErrors' | 'navigation' @@ -23,6 +24,7 @@ export const stubbedStartServices: StubbedStartServices = { licensing: {} as FleetStartServices['licensing'], storage: {} as FleetStartServices['storage'], data: {} as FleetStartServices['data'], + unifiedSearch: {} as FleetStartServices['unifiedSearch'], deprecations: {} as FleetStartServices['deprecations'], fatalErrors: {} as FleetStartServices['fatalErrors'], navigation: {} as FleetStartServices['navigation'], diff --git a/x-pack/plugins/fleet/kibana.json b/x-pack/plugins/fleet/kibana.json index 67ee2daf63725..5a16dcc30e342 100644 --- a/x-pack/plugins/fleet/kibana.json +++ b/x-pack/plugins/fleet/kibana.json @@ -8,7 +8,7 @@ "server": true, "ui": true, "configPath": ["xpack", "fleet"], - "requiredPlugins": ["licensing", "data", "encryptedSavedObjects", "navigation", "customIntegrations", "share", "spaces", "security"], + "requiredPlugins": ["licensing", "data", "encryptedSavedObjects", "navigation", "customIntegrations", "share", "spaces", "security", "unifiedSearch"], "optionalPlugins": ["features", "cloud", "usageCollection", "home", "globalSearch", "telemetry"], "extraPublicDirs": ["common"], "requiredBundles": ["kibanaReact", "cloud", "esUiShared", "home", "infra", "kibanaUtils", "usageCollection", "unifiedSearch"] diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx index 865c360a47bd9..f49d4910ab9f9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_dataset.tsx @@ -17,7 +17,7 @@ export const DatasetFilter: React.FunctionComponent<{ selectedDatasets: string[]; onToggleDataset: (dataset: string) => void; }> = memo(({ selectedDatasets, onToggleDataset }) => { - const { data } = useStartServices(); + const { unifiedSearch } = useStartServices(); const [isOpen, setIsOpen] = useState(false); const [isLoading, setIsLoading] = useState(false); const [datasetValues, setDatasetValues] = useState([AGENT_DATASET]); @@ -29,7 +29,7 @@ export const DatasetFilter: React.FunctionComponent<{ const fetchValues = async () => { setIsLoading(true); try { - const values = await data.autocomplete.getValueSuggestions({ + const values = await unifiedSearch.autocomplete.getValueSuggestions({ indexPattern: { title: AGENT_LOG_INDEX_PATTERN, fields: [DATASET_FIELD], @@ -44,7 +44,7 @@ export const DatasetFilter: React.FunctionComponent<{ setIsLoading(false); }; fetchValues(); - }, [data.autocomplete]); + }, [unifiedSearch.autocomplete]); return ( void; }> = memo(({ selectedLevels, onToggleLevel }) => { - const { data } = useStartServices(); + const { unifiedSearch } = useStartServices(); const [isOpen, setIsOpen] = useState(false); const [isLoading, setIsLoading] = useState(false); const [levelValues, setLevelValues] = useState([]); @@ -40,7 +40,7 @@ export const LogLevelFilter: React.FunctionComponent<{ const fetchValues = async () => { setIsLoading(true); try { - const values: string[] = await data.autocomplete.getValueSuggestions({ + const values: string[] = await unifiedSearch.autocomplete.getValueSuggestions({ indexPattern: { title: AGENT_LOG_INDEX_PATTERN, fields: [LOG_LEVEL_FIELD], @@ -55,7 +55,7 @@ export const LogLevelFilter: React.FunctionComponent<{ setIsLoading(false); }; fetchValues(); - }, [data.autocomplete]); + }, [unifiedSearch.autocomplete]); const noLogsFound = (
diff --git a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts index 842b690eb978f..2e2ae8ba7d250 100644 --- a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts +++ b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts @@ -6,6 +6,7 @@ */ import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../src/plugins/unified_search/public/mocks'; import { licensingMock } from '../../../licensing/public/mocks'; import { cloudMock } from '../../../cloud/public/mocks'; import { homePluginMock } from '../../../../../src/plugins/home/public/mocks'; @@ -27,6 +28,7 @@ export const createStartDepsMock = () => { return { licensing: licensingMock.createStart(), data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), navigation: navigationPluginMock.createStartContract(), customIntegrations: customIntegrationsMock.createStart(), share: sharePluginMock.createStartContract(), diff --git a/x-pack/plugins/fleet/public/plugin.ts b/x-pack/plugins/fleet/public/plugin.ts index 4848b05084676..6f4f7d6be12a5 100644 --- a/x-pack/plugins/fleet/public/plugin.ts +++ b/x-pack/plugins/fleet/public/plugin.ts @@ -38,6 +38,7 @@ import type { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from '../../../../src/plugins/unified_search/public'; import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { Storage } from '../../../../src/plugins/kibana_utils/public'; @@ -95,6 +96,7 @@ export interface FleetSetupDeps { export interface FleetStartDeps { licensing: LicensingPluginStart; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; navigation: NavigationPublicPluginStart; customIntegrations: CustomIntegrationsStart; share: SharePluginStart; diff --git a/x-pack/plugins/graph/public/components/search_bar.test.tsx b/x-pack/plugins/graph/public/components/search_bar.test.tsx index 9a5b464e01e8f..6608510ebff87 100644 --- a/x-pack/plugins/graph/public/components/search_bar.test.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.test.tsx @@ -59,6 +59,8 @@ function getServiceMocks() { query: { savedQueries: {}, }, + }, + unifiedSearch: { autocomplete: { hasQuerySuggestions: () => false, }, diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx b/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx index 4aa0edb406856..4082736faae25 100644 --- a/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx +++ b/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx @@ -7,7 +7,7 @@ import { EuiFieldSearch, EuiOutsideClickDetector, EuiPanel } from '@elastic/eui'; import React from 'react'; -import { QuerySuggestion } from '../../../../../../src/plugins/data/public'; +import { QuerySuggestion } from '../../../../../../src/plugins/unified_search/public'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; import { composeStateUpdaters } from '../../utils/typed_react'; import { SuggestionItem } from './suggestion_item'; diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx b/x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx index 3681bf26987cc..72522f3d60829 100644 --- a/x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx +++ b/x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx @@ -9,7 +9,10 @@ import { EuiIcon } from '@elastic/eui'; import { transparentize } from 'polished'; import React from 'react'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../../../../src/plugins/data/public'; +import { + QuerySuggestion, + QuerySuggestionTypes, +} from '../../../../../../src/plugins/unified_search/public'; interface Props { isSelected?: boolean; diff --git a/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx b/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx index 2b0aaf5175b88..6b3f8bdb6ee9a 100644 --- a/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx +++ b/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { DataViewBase } from '@kbn/es-query'; -import { QuerySuggestion, DataPublicPluginStart } from 'src/plugins/data/public'; +import { QuerySuggestion, UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; import { withKibana, KibanaReactContextValue, @@ -16,7 +16,9 @@ import { import { RendererFunction } from '../utils/typed_react'; interface WithKueryAutocompletionLifecycleProps { - kibana: KibanaReactContextValue<{ data: DataPublicPluginStart } & KibanaServices>; + kibana: KibanaReactContextValue< + { unifiedSearch: UnifiedSearchPublicPluginStart } & KibanaServices + >; children: RendererFunction<{ isLoadingSuggestions: boolean; loadSuggestions: (expression: string, cursorPosition: number, maxSuggestions?: number) => void; @@ -63,7 +65,7 @@ class WithKueryAutocompletionComponent extends React.Component< const { indexPattern } = this.props; const language = 'kuery'; const hasQuerySuggestions = - this.props.kibana.services.data?.autocomplete.hasQuerySuggestions(language); + this.props.kibana.services.unifiedSearch?.autocomplete.hasQuerySuggestions(language); if (!hasQuerySuggestions) { return; @@ -78,7 +80,7 @@ class WithKueryAutocompletionComponent extends React.Component< }); const suggestions = - (await this.props.kibana.services.data.autocomplete.getQuerySuggestions({ + (await this.props.kibana.services.unifiedSearch.autocomplete.getQuerySuggestions({ language, query: expression, selectionStart: cursorPosition, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx index 710f547d003ca..1607855117a38 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx @@ -11,7 +11,7 @@ import React, { useEffect, useState } from 'react'; import { DataViewBase } from '@kbn/es-query'; import { WithKueryAutocompletion } from '../../../../containers/with_kuery_autocompletion'; import { AutocompleteField } from '../../../../components/autocomplete_field'; -import { QuerySuggestion } from '../../../../../../../../src/plugins/data/public'; +import { QuerySuggestion } from '../../../../../../../../src/plugins/unified_search/public'; type LoadSuggestionsFn = ( e: string, diff --git a/x-pack/plugins/lens/kibana.json b/x-pack/plugins/lens/kibana.json index 237a25ce78a9a..8ed33fb304525 100644 --- a/x-pack/plugins/lens/kibana.json +++ b/x-pack/plugins/lens/kibana.json @@ -22,7 +22,8 @@ "dataViewFieldEditor", "expressionGauge", "expressionHeatmap", - "eventAnnotation" + "eventAnnotation", + "unifiedSearch" ], "optionalPlugins": [ "expressionXY", diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index a9e37e2d53d70..2c03ad902ce81 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -93,6 +93,7 @@ export function DimensionEditor(props: DimensionEditorProps) { savedObjectsClient: props.savedObjectsClient, http: props.http, storage: props.storage, + unifiedSearch: props.unifiedSearch, }; const { fieldByOperation, operationWithoutField } = operationSupportMatrix; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 356ad5ac9543e..57e099b199043 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -17,6 +17,8 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { DataPublicPluginStart } from '../../../../../../src/plugins/data/public'; +import { unifiedSearchPluginMock } from '../../../../../../src/plugins/unified_search/public/mocks'; +// import { UnifiedSearchPublicPluginStart } from '../../../../../../src/plugins/unified_search/public'; import { IndexPatternDimensionEditorComponent, IndexPatternDimensionEditorProps, @@ -203,6 +205,7 @@ describe('IndexPatternDimensionEditorPanel', () => { uiSettings: {} as IUiSettingsClient, savedObjectsClient: {} as SavedObjectsClientContract, http: {} as HttpSetup, + unifiedSearch: unifiedSearchPluginMock.createStartContract(), data: { fieldFormats: { getType: jest.fn().mockReturnValue({ diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx index 84e84c3a79a9a..394f94dd7f552 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx @@ -10,6 +10,7 @@ import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { DatasourceDimensionTriggerProps, DatasourceDimensionEditorProps } from '../../types'; import { DataPublicPluginStart } from '../../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../../../../src/plugins/unified_search/public'; import { GenericIndexPatternColumn } from '../indexpattern'; import { isColumnInvalid } from '../utils'; import { IndexPatternPrivateState } from '../types'; @@ -31,6 +32,7 @@ export type IndexPatternDimensionEditorProps = layerId: string; http: HttpSetup; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; uniqueLabel: string; dateRange: DateRange; }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts index 778b589d283e1..f242a1373c315 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts @@ -6,6 +6,7 @@ */ import { DataPublicPluginStart } from '../../../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../../../../../src/plugins/unified_search/public'; import { IndexPatternDimensionEditorProps } from '../dimension_panel'; import { onDrop } from './on_drop_handler'; import { getDropProps } from './get_drop_props'; @@ -317,6 +318,7 @@ describe('IndexPatternDimensionEditorPanel', () => { }), } as unknown as DataPublicPluginStart['fieldFormats'], } as unknown as DataPublicPluginStart, + unifiedSearch: {} as UnifiedSearchPublicPluginStart, core: {} as CoreSetup, dimensionGroups: [], isFullscreen: false, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx index 5131a1224341e..7a21441736ab1 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx @@ -13,6 +13,7 @@ import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import type { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; import { OperationMetadata } from '../../types'; import { createMockedIndexPattern, createMockedIndexPatternWithoutType } from '../mocks'; import { ReferenceEditor, ReferenceEditorProps } from './reference_editor'; @@ -54,6 +55,7 @@ describe('reference editor', () => { savedObjectsClient: {} as SavedObjectsClientContract, http: {} as HttpSetup, data: {} as DataPublicPluginStart, + unifiedSearch: {} as UnifiedSearchPublicPluginStart, dimensionGroups: [], isFullscreen: false, toggleFullscreen: jest.fn(), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.tsx index a59229ad093b6..37eef4d153ed5 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.tsx @@ -18,6 +18,7 @@ import { import type { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; import type { DateRange } from '../../../common'; import type { OperationSupportMatrix } from './operation_support'; import type { OperationType } from '../indexpattern'; @@ -65,6 +66,7 @@ export interface ReferenceEditorProps { savedObjectsClient: SavedObjectsClientContract; http: HttpSetup; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; paramEditorCustomProps?: ParamEditorCustomProps; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts index b95bc1be0ed58..55843152ff6d4 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts @@ -14,6 +14,7 @@ import type { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../../src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from '../../../../../src/plugins/unified_search/public'; import type { DataViewsPublicPluginStart } from '../../../../../src/plugins/data_views/public'; import type { EditorFrameSetup } from '../types'; import type { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; @@ -34,6 +35,7 @@ export interface IndexPatternDatasourceSetupPlugins { export interface IndexPatternDatasourceStartPlugins { data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; fieldFormats: FieldFormatsStart; dataViewFieldEditor: IndexPatternFieldEditorStart; dataViews: DataViewsPublicPluginStart; @@ -64,14 +66,17 @@ export class IndexPatternDatasource { fieldFormatsSetup.register([suffixFormatter]); } - const [coreStart, { dataViewFieldEditor, uiActions, data, fieldFormats, dataViews }] = - await core.getStartServices(); + const [ + coreStart, + { dataViewFieldEditor, uiActions, data, fieldFormats, dataViews, unifiedSearch }, + ] = await core.getStartServices(); return getIndexPatternDatasource({ core: coreStart, fieldFormats, storage: new Storage(localStorage), data, + unifiedSearch, dataViews, charts, dataViewFieldEditor, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts index 8dc3125dea57d..973ff95ebaf95 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts @@ -12,6 +12,7 @@ import { DatasourcePublicAPI, Datasource, FramePublicAPI, OperationDescriptor } import { coreMock } from 'src/core/public/mocks'; import { IndexPatternPersistedState, IndexPatternPrivateState } from './types'; import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../src/plugins/unified_search/public/mocks'; import { dataViewPluginMocks } from '../../../../../src/plugins/data_views/public/mocks'; import { Ast } from '@kbn/interpreter'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; @@ -184,6 +185,7 @@ describe('IndexPattern Data Source', () => { beforeEach(() => { indexPatternDatasource = getIndexPatternDatasource({ + unifiedSearch: unifiedSearchPluginMock.createStartContract(), storage: {} as IStorageWrapper, core: coreMock.createStart(), data: dataPluginMock.createStartContract(), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx index 1911fe764a086..f9853ccf5da42 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx @@ -69,6 +69,7 @@ import { KibanaThemeProvider, } from '../../../../../src/plugins/kibana_react/public'; import { DataPublicPluginStart, ES_FIELD_TYPES } from '../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../../../src/plugins/unified_search/public'; import { VisualizeFieldContext } from '../../../../../src/plugins/ui_actions/public'; import { mergeLayer } from './state_helpers'; import { Datasource, StateSetter, VisualizeEditorContext } from '../types'; @@ -118,6 +119,7 @@ export function getIndexPatternDatasource({ core, storage, data, + unifiedSearch, dataViews, fieldFormats, charts, @@ -127,6 +129,7 @@ export function getIndexPatternDatasource({ core: CoreStart; storage: IStorageWrapper; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; dataViews: DataViewsPublicPluginStart; fieldFormats: FieldFormatsStart; charts: ChartsPluginSetup; @@ -373,6 +376,7 @@ export function getIndexPatternDatasource({ savedObjectsClient={core.savedObjects.client} http={core.http} data={data} + unifiedSearch={unifiedSearch} uniqueLabel={columnLabelMap[props.columnId]} {...props} /> diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.test.tsx index 886ea04048a58..820596da4d5cd 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.test.tsx @@ -17,11 +17,13 @@ import { dataPluginMock, getCalculateAutoTimeExpression, } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { createMockedIndexPattern } from '../../mocks'; import type { IndexPatternLayer, IndexPattern } from '../../types'; import { getFieldByNameFactory } from '../../pure_helpers'; const dataStart = dataPluginMock.createStartContract(); +const unifiedSearchStart = unifiedSearchPluginMock.createStartContract(); dataStart.search.aggs.calculateAutoTimeExpression = getCalculateAutoTimeExpression( (path: string) => { if (path === UI_SETTINGS.HISTOGRAM_MAX_BARS) { @@ -96,6 +98,7 @@ const defaultOptions = { toDate: 'now', }, data: dataStart, + unifiedSearch: unifiedSearchStart, http: {} as HttpSetup, indexPattern: indexPattern1, operationDefinitionMap: {}, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.test.tsx index 7be85ddc997f2..ae473ff260651 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.test.tsx @@ -11,6 +11,7 @@ import { act } from 'react-dom/test-utils'; import type { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import type { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { dataPluginMock } from '../../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../../src/plugins/unified_search/public/mocks'; import type { FiltersIndexPatternColumn } from '.'; import { filtersOperation } from '../index'; import type { IndexPatternLayer } from '../../../types'; @@ -25,6 +26,7 @@ const defaultProps = { savedObjectsClient: {} as SavedObjectsClientContract, dateRange: { fromDate: 'now-1d', toDate: 'now' }, data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), http: {} as HttpSetup, indexPattern: createMockedIndexPattern(), operationDefinitionMap: {}, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_editor.tsx index 62a681ac3d604..353326db54fff 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_editor.tsx @@ -89,7 +89,7 @@ export function FormulaEditor({ columnId, indexPattern, operationDefinitionMap, - data, + unifiedSearch, toggleFullscreen, isFullscreen, setIsCloseable, @@ -416,7 +416,7 @@ export function FormulaEditor({ context, indexPattern, operationDefinitionMap: visibleOperationsMap, - data, + unifiedSearch, dateHistogramInterval: baseIntervalRef.current, }); } @@ -427,7 +427,7 @@ export function FormulaEditor({ context, indexPattern, operationDefinitionMap: visibleOperationsMap, - data, + unifiedSearch, dateHistogramInterval: baseIntervalRef.current, }); } @@ -444,7 +444,7 @@ export function FormulaEditor({ ), }; }, - [indexPattern, visibleOperationsMap, data, baseIntervalRef] + [indexPattern, visibleOperationsMap, unifiedSearch, baseIntervalRef] ); const provideSignatureHelp = useCallback( diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.test.ts index 612ae892146fc..f8b5947b20e86 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.test.ts @@ -11,7 +11,7 @@ import { createMockedIndexPattern } from '../../../../mocks'; import { GenericOperationDefinition } from '../../index'; import type { IndexPatternField } from '../../../../types'; import type { OperationMetadata } from '../../../../../types'; -import { dataPluginMock } from '../../../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../../../src/plugins/unified_search/public/mocks'; import { tinymathFunctions } from '../util'; import { getSignatureHelp, @@ -217,7 +217,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toHaveLength(4 + Object.keys(tinymathFunctions).length); ['sum', 'moving_average', 'cumulative_sum', 'last_value'].forEach((key) => { @@ -238,7 +238,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toHaveLength(2); ['sum', 'last_value'].forEach((key) => { @@ -256,7 +256,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toEqual(['window']); }); @@ -271,7 +271,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toEqual([]); }); @@ -286,7 +286,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toHaveLength(4 + Object.keys(tinymathFunctions).length); ['sum', 'moving_average', 'cumulative_sum', 'last_value'].forEach((key) => { @@ -307,7 +307,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toHaveLength(4 + Object.keys(tinymathFunctions).length); ['sum', 'moving_average', 'cumulative_sum', 'last_value'].forEach((key) => { @@ -328,7 +328,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toHaveLength(0); }); @@ -343,7 +343,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toEqual(['bytes', 'memory']); }); @@ -358,7 +358,7 @@ describe('math completion', () => { }, indexPattern: createMockedIndexPattern(), operationDefinitionMap, - data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), }); expect(results.list).toEqual(['bytes', 'memory']); }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts index ece41a95130bf..0ea6b02e98499 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts @@ -17,9 +17,9 @@ import { TinymathNamedArgument, } from '@kbn/tinymath'; import type { - DataPublicPluginStart, + UnifiedSearchPublicPluginStart, QuerySuggestion, -} from '../../../../../../../../../src/plugins/data/public'; +} from '../../../../../../../../../src/plugins/unified_search/public'; import { IndexPattern } from '../../../../types'; import { memoizedGetAvailableOperationsByMetadata } from '../../../operations'; import { tinymathFunctions, groupArgsByType, unquotedStringRegex } from '../util'; @@ -120,7 +120,7 @@ export async function suggest({ context, indexPattern, operationDefinitionMap, - data, + unifiedSearch, dateHistogramInterval, }: { expression: string; @@ -128,7 +128,7 @@ export async function suggest({ context: monaco.languages.CompletionContext; indexPattern: IndexPattern; operationDefinitionMap: Record; - data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; dateHistogramInterval?: number; }): Promise { const text = @@ -148,7 +148,7 @@ export async function suggest({ if (tokenInfo?.parent && (context.triggerCharacter === '=' || isNamedArgument)) { return await getNamedArgumentSuggestions({ ast: tokenAst as TinymathNamedArgument, - data, + unifiedSearch, indexPattern, dateHistogramInterval, }); @@ -331,13 +331,13 @@ function getArgumentSuggestions( export async function getNamedArgumentSuggestions({ ast, - data, + unifiedSearch, indexPattern, dateHistogramInterval, }: { ast: TinymathNamedArgument; indexPattern: IndexPattern; - data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; dateHistogramInterval?: number; }) { if (ast.name === 'shift') { @@ -359,14 +359,14 @@ export async function getNamedArgumentSuggestions({ if (ast.name !== 'kql' && ast.name !== 'lucene') { return { list: [], type: SUGGESTION_TYPE.KQL }; } - if (!data.autocomplete.hasQuerySuggestions(ast.name === 'kql' ? 'kuery' : 'lucene')) { + if (!unifiedSearch.autocomplete.hasQuerySuggestions(ast.name === 'kql' ? 'kuery' : 'lucene')) { return { list: [], type: SUGGESTION_TYPE.KQL }; } const query = ast.value.split(MARKER)[0]; const position = ast.value.indexOf(MARKER) + 1; - const suggestions = await data.autocomplete.getQuerySuggestions({ + const suggestions = await unifiedSearch.autocomplete.getQuerySuggestions({ language: ast.name === 'kql' ? 'kuery' : 'lucene', query, selectionStart: position, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts index 5e7a79dc3a127..d8c7daa6f4b4d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts @@ -45,6 +45,7 @@ import { IndexPattern, IndexPatternField, IndexPatternLayer } from '../../types' import { DateRange, LayerType } from '../../../../common'; import { ExpressionAstFunction } from '../../../../../../../src/plugins/expressions/public'; import { DataPublicPluginStart } from '../../../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../../../../../src/plugins/unified_search/public'; import { rangeOperation } from './ranges'; import { IndexPatternDimensionEditorProps, OperationSupportMatrix } from '../../dimension_panel'; @@ -158,6 +159,7 @@ export interface ParamEditorProps { http: HttpSetup; dateRange: DateRange; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; activeData?: IndexPatternDimensionEditorProps['activeData']; operationDefinitionMap: Record; paramEditorCustomProps?: ParamEditorCustomProps; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.test.tsx index 8e5773ad6868e..995e56eeb928e 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.test.tsx @@ -11,6 +11,7 @@ import { EuiComboBox, EuiFormRow } from '@elastic/eui'; import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { createMockedIndexPattern } from '../../mocks'; import { LastValueIndexPatternColumn } from './last_value'; import { lastValueOperation } from './index'; @@ -25,6 +26,7 @@ const defaultProps = { uiSettings: uiSettingsMock, savedObjectsClient: {} as SavedObjectsClientContract, dateRange: { fromDate: 'now-1d', toDate: 'now' }, + unifiedSearch: unifiedSearchPluginMock.createStartContract(), data: dataPluginMock.createStartContract(), http: {} as HttpSetup, indexPattern: { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.test.tsx index f5e21c5d8aeeb..12ca62c6076e3 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.test.tsx @@ -10,6 +10,7 @@ import { shallow, mount } from 'enzyme'; import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { createMockedIndexPattern } from '../../mocks'; import { percentileOperation } from './index'; import { IndexPattern, IndexPatternLayer } from '../../types'; @@ -36,6 +37,7 @@ const defaultProps = { savedObjectsClient: {} as SavedObjectsClientContract, dateRange: { fromDate: 'now-1d', toDate: 'now' }, data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), http: {} as HttpSetup, indexPattern: { ...createMockedIndexPattern(), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx index 77d849ac7af17..4e5e0ec644d12 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx @@ -13,6 +13,7 @@ import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import type { IndexPatternLayer, IndexPattern } from '../../../types'; import { dataPluginMock } from '../../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../../src/plugins/unified_search/public/mocks'; import { rangeOperation } from '../index'; import { RangeIndexPatternColumn } from './ranges'; import { @@ -51,6 +52,7 @@ jest.mock('lodash', () => { }); const dataPluginMockValue = dataPluginMock.createStartContract(); +const unifiedSearchPluginMockValue = unifiedSearchPluginMock.createStartContract(); // need to overwrite the formatter field first dataPluginMockValue.fieldFormats.deserialize = jest.fn().mockImplementation(({ id, params }) => { return { @@ -84,6 +86,7 @@ const defaultOptions = { toDate: 'now', }, data: dataPluginMockValue, + unifiedSearch: unifiedSearchPluginMockValue, http: {} as HttpSetup, indexPattern: { id: '1', diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.test.tsx index 6d9a39887b940..c30187968c2c5 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.test.tsx @@ -10,6 +10,7 @@ import { shallow, mount } from 'enzyme'; import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { createMockedIndexPattern } from '../../mocks'; import { staticValueOperation } from './index'; import { IndexPattern, IndexPatternLayer } from '../../types'; @@ -35,6 +36,7 @@ const defaultProps = { savedObjectsClient: {} as SavedObjectsClientContract, dateRange: { fromDate: 'now-1d', toDate: 'now' }, data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), http: {} as HttpSetup, indexPattern: { ...createMockedIndexPattern(), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/terms.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/terms.test.tsx index a72250c2265c4..e0055ea95cc5c 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/terms.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/terms.test.tsx @@ -17,6 +17,7 @@ import type { } from 'kibana/public'; import type { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { dataPluginMock } from '../../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../../src/plugins/unified_search/public/mocks'; import { createMockedIndexPattern } from '../../../mocks'; import { ValuesInput } from './values_input'; import type { TermsIndexPatternColumn } from '.'; @@ -58,6 +59,7 @@ const defaultProps = { savedObjectsClient: {} as SavedObjectsClientContract, dateRange: { fromDate: 'now-1d', toDate: 'now' }, data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), http: {} as HttpSetup, indexPattern: createMockedIndexPattern(), // need to provide the terms operation as some helpers use operation specific features diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index dbecf1e7d779f..ac417ebfa781f 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -16,6 +16,7 @@ import type { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from '../../../../src/plugins/unified_search/public'; import { CONTEXT_MENU_TRIGGER, EmbeddableSetup, @@ -118,6 +119,7 @@ export interface LensPluginSetupDependencies { export interface LensPluginStartDependencies { data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; dataViews: DataViewsPublicPluginStart; fieldFormats: FieldFormatsStart; expressions: ExpressionsStart; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx index 0f842bb53b99e..0ea9d62c50a0c 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx @@ -9,7 +9,7 @@ import { Story, addDecorator } from '@storybook/react'; import React from 'react'; import { HttpStart } from 'kibana/public'; -import type { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +import type { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx index 77e255f9ed2ae..4e4895f827aea 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx @@ -14,7 +14,7 @@ import { ListOperatorTypeEnum as OperatorTypeEnum, } from '@kbn/securitysolution-io-ts-list-types'; -import type { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +import type { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; import { fields } from '../../../../../../../src/plugins/data/common/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index aa7071a9074a9..180f71130e7f8 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -25,7 +25,7 @@ import { useFindLists } from '@kbn/securitysolution-list-hooks'; import type { FieldSpec } from 'src/plugins/data/common'; import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; -import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { getFoundListSchemaMock } from '../../../../common/schemas/response/found_list_schema.mock'; @@ -35,7 +35,7 @@ jest.mock('@kbn/securitysolution-list-hooks'); jest.mock('@kbn/securitysolution-utils'); const mockKibanaHttpService = coreMock.createStart().http; -const { autocomplete: autocompleteStartMock } = dataPluginMock.createStartContract(); +const { autocomplete: autocompleteStartMock } = unifiedSearchPluginMock.createStartContract(); describe('BuilderEntryItem', () => { let wrapper: ReactWrapper; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx index 3832803a54971..7fbd1d41f520d 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx @@ -45,7 +45,7 @@ import { } from '@kbn/securitysolution-utils'; import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; -import type { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +import type { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; import { HttpStart } from '../../../../../../../src/core/public'; import { getEmptyValue } from '../../../common/empty_value'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx index fed24ba428e6c..57248f0c3c8d4 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { dataPluginMock } from 'src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from 'src/plugins/unified_search/public/mocks'; import { fields } from '../../../../../../../src/plugins/data/common/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; @@ -19,7 +19,7 @@ import { coreMock } from '../../../../../../../src/core/public/mocks'; import { BuilderExceptionListItemComponent } from './exception_item_renderer'; const mockKibanaHttpService = coreMock.createStart().http; -const { autocomplete: autocompleteStartMock } = dataPluginMock.createStartContract(); +const { autocomplete: autocompleteStartMock } = unifiedSearchPluginMock.createStartContract(); describe('BuilderExceptionListItemComponent', () => { const getValueSuggestionsMock = jest.fn().mockResolvedValue(['value 1', 'value 2']); diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx index febfa54a482b2..75f81b1c32eca 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx @@ -9,7 +9,7 @@ import React, { useCallback, useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import styled from 'styled-components'; import { HttpStart } from 'kibana/public'; -import type { AutocompleteStart } from 'src/plugins/data/public'; +import type { AutocompleteStart } from 'src/plugins/unified_search/public'; import { ExceptionListType, OsTypeArray } from '@kbn/securitysolution-io-ts-list-types'; import { BuilderEntry, diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx index d9dfbfeee299d..1dfe6c488878e 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ReactWrapper, mount } from 'enzyme'; import { waitFor } from '@testing-library/react'; import { coreMock } from 'src/core/public/mocks'; -import { dataPluginMock } from 'src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from 'src/plugins/unified_search/public/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; @@ -20,7 +20,7 @@ import { getEmptyValue } from '../../../common/empty_value'; import { ExceptionBuilderComponent } from './exception_items_renderer'; const mockKibanaHttpService = coreMock.createStart().http; -const { autocomplete: autocompleteStartMock } = dataPluginMock.createStartContract(); +const { autocomplete: autocompleteStartMock } = unifiedSearchPluginMock.createStartContract(); describe('ExceptionBuilderComponent', () => { let wrapper: ReactWrapper; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx index c7da32cc1669d..cabe2bae6c7a4 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx @@ -33,7 +33,7 @@ import { } from '@kbn/securitysolution-list-utils'; import { DataViewBase } from '@kbn/es-query'; -import type { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; +import type { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; import { AndOrBadge } from '../and_or_badge'; import { BuilderExceptionListItemComponent } from './exception_item_renderer'; diff --git a/x-pack/plugins/lists/tsconfig.json b/x-pack/plugins/lists/tsconfig.json index 691c5243d9db8..6cfffbbaa7421 100644 --- a/x-pack/plugins/lists/tsconfig.json +++ b/x-pack/plugins/lists/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../security/tsconfig.json"}, + { "path": "../../../src/plugins/unified_search/tsconfig.json" } ] } diff --git a/x-pack/plugins/maps/public/kibana_services.ts b/x-pack/plugins/maps/public/kibana_services.ts index f2345d2102a12..60046185085ca 100644 --- a/x-pack/plugins/maps/public/kibana_services.ts +++ b/x-pack/plugins/maps/public/kibana_services.ts @@ -32,7 +32,7 @@ export const getIsCloud = () => isCloudEnabled; export const getIndexNameFormComponent = () => pluginsStart.fileUpload.IndexNameFormComponent; export const getFileUploadComponent = () => pluginsStart.fileUpload.FileUploadComponent; export const getIndexPatternService = () => pluginsStart.data.indexPatterns; -export const getAutocompleteService = () => pluginsStart.data.autocomplete; +export const getAutocompleteService = () => pluginsStart.unifiedSearch.autocomplete; export const getInspector = () => pluginsStart.inspector; export const getFileUpload = () => pluginsStart.fileUpload; export const getUiSettings = () => coreStart.uiSettings; diff --git a/x-pack/plugins/ml/kibana.json b/x-pack/plugins/ml/kibana.json index ffba908dcfe89..f7c15b7162224 100644 --- a/x-pack/plugins/ml/kibana.json +++ b/x-pack/plugins/ml/kibana.json @@ -19,7 +19,8 @@ "share", "taskManager", "triggersActionsUi", - "uiActions" + "uiActions", + "unifiedSearch" ], "optionalPlugins": [ "alerting", diff --git a/x-pack/plugins/ml/public/application/app.tsx b/x-pack/plugins/ml/public/application/app.tsx index 2b00d53e35e54..e5f21e76230fa 100644 --- a/x-pack/plugins/ml/public/application/app.tsx +++ b/x-pack/plugins/ml/public/application/app.tsx @@ -122,7 +122,7 @@ export const renderApp = ( setDependencyCache({ timefilter: deps.data.query.timefilter, fieldFormats: deps.fieldFormats, - autocomplete: deps.data.autocomplete, + autocomplete: deps.unifiedSearch.autocomplete, config: coreStart.uiSettings!, chrome: coreStart.chrome!, docLinks: coreStart.docLinks!, diff --git a/x-pack/plugins/ml/public/application/util/dependency_cache.ts b/x-pack/plugins/ml/public/application/util/dependency_cache.ts index bba71a23f98c3..258f2ca3f5660 100644 --- a/x-pack/plugins/ml/public/application/util/dependency_cache.ts +++ b/x-pack/plugins/ml/public/application/util/dependency_cache.ts @@ -20,7 +20,7 @@ import type { ChromeRecentlyAccessed, IBasePath, } from 'kibana/public'; -import type { DataPublicPluginStart } from 'src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; import type { DashboardStart } from 'src/plugins/dashboard/public'; import type { FieldFormatsStart } from 'src/plugins/field_formats/public'; import type { DataViewsContract } from '../../../../../../src/plugins/data_views/public'; @@ -38,7 +38,7 @@ export interface DependencyCache { theme: ThemeServiceStart | null; recentlyAccessed: ChromeRecentlyAccessed | null; fieldFormats: FieldFormatsStart | null; - autocomplete: DataPublicPluginStart['autocomplete'] | null; + autocomplete: UnifiedSearchPublicPluginStart['autocomplete'] | null; basePath: IBasePath | null; savedObjectsClient: SavedObjectsClientContract | null; application: ApplicationStart | null; diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index 8185c9d250561..217ac93d44a83 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -19,6 +19,7 @@ import { take } from 'rxjs/operators'; import type { ManagementSetup } from 'src/plugins/management/public'; import type { SharePluginSetup, SharePluginStart } from 'src/plugins/share/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; +import type { UnifiedSearchPublicPluginStart } from 'src/plugins/unified_search/public'; import type { HomePublicPluginSetup } from 'src/plugins/home/public'; import type { EmbeddableSetup, EmbeddableStart } from 'src/plugins/embeddable/public'; import type { SpacesPluginStart } from '../../spaces/public'; @@ -54,6 +55,7 @@ import type { ChartsPluginStart } from '../../../../src/plugins/charts/public'; export interface MlStartDependencies { data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; share: SharePluginStart; uiActions: UiActionsStart; spaces?: SpacesPluginStart; @@ -113,6 +115,7 @@ export class MlPlugin implements Plugin { { charts: pluginsStart.charts, data: pluginsStart.data, + unifiedSearch: pluginsStart.unifiedSearch, dashboard: pluginsStart.dashboard, share: pluginsStart.share, security: pluginsSetup.security, diff --git a/x-pack/plugins/monitoring/kibana.json b/x-pack/plugins/monitoring/kibana.json index d10d8d674fcaf..0abb24ef92297 100644 --- a/x-pack/plugins/monitoring/kibana.json +++ b/x-pack/plugins/monitoring/kibana.json @@ -7,7 +7,7 @@ "githubTeam": "stack-monitoring-ui" }, "configPath": ["monitoring"], - "requiredPlugins": ["licensing", "features", "data", "navigation", "observability"], + "requiredPlugins": ["licensing", "features", "data", "navigation", "observability", "unifiedSearch"], "optionalPlugins": [ "infra", "usageCollection", diff --git a/x-pack/plugins/monitoring/public/components/kuery_bar/autocomplete_field.tsx b/x-pack/plugins/monitoring/public/components/kuery_bar/autocomplete_field.tsx index 522256ea49b98..eb48f856f5fd9 100644 --- a/x-pack/plugins/monitoring/public/components/kuery_bar/autocomplete_field.tsx +++ b/x-pack/plugins/monitoring/public/components/kuery_bar/autocomplete_field.tsx @@ -7,7 +7,7 @@ import { EuiFieldSearch, EuiOutsideClickDetector, EuiPanel } from '@elastic/eui'; import React from 'react'; -import { QuerySuggestion } from '../../../../../../src/plugins/data/public'; +import { QuerySuggestion } from '../../../../../../src/plugins/unified_search/public'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; import { composeStateUpdaters } from '../../lib/typed_react'; import { SuggestionItem } from './suggestion_item'; diff --git a/x-pack/plugins/monitoring/public/components/kuery_bar/index.tsx b/x-pack/plugins/monitoring/public/components/kuery_bar/index.tsx index 6d79266fe3cc6..33f2171ce3fd1 100644 --- a/x-pack/plugins/monitoring/public/components/kuery_bar/index.tsx +++ b/x-pack/plugins/monitoring/public/components/kuery_bar/index.tsx @@ -8,7 +8,8 @@ import { fromKueryExpression } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; -import { IIndexPattern, QuerySuggestion } from '../../../../../../src/plugins/data/public'; +import { IIndexPattern } from '../../../../../../src/plugins/data/public'; +import { QuerySuggestion } from '../../../../../../src/plugins/unified_search/public'; import { AutocompleteField } from './autocomplete_field'; import { WithKueryAutocompletion } from './with_kuery_autocompletion'; diff --git a/x-pack/plugins/monitoring/public/components/kuery_bar/suggestion_item.tsx b/x-pack/plugins/monitoring/public/components/kuery_bar/suggestion_item.tsx index 3681bf26987cc..72522f3d60829 100644 --- a/x-pack/plugins/monitoring/public/components/kuery_bar/suggestion_item.tsx +++ b/x-pack/plugins/monitoring/public/components/kuery_bar/suggestion_item.tsx @@ -9,7 +9,10 @@ import { EuiIcon } from '@elastic/eui'; import { transparentize } from 'polished'; import React from 'react'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../../../../src/plugins/data/public'; +import { + QuerySuggestion, + QuerySuggestionTypes, +} from '../../../../../../src/plugins/unified_search/public'; interface Props { isSelected?: boolean; diff --git a/x-pack/plugins/monitoring/public/components/kuery_bar/with_kuery_autocompletion.tsx b/x-pack/plugins/monitoring/public/components/kuery_bar/with_kuery_autocompletion.tsx index 8d79bf4039846..7dfeb514b697f 100644 --- a/x-pack/plugins/monitoring/public/components/kuery_bar/with_kuery_autocompletion.tsx +++ b/x-pack/plugins/monitoring/public/components/kuery_bar/with_kuery_autocompletion.tsx @@ -6,7 +6,11 @@ */ import React from 'react'; -import { QuerySuggestion, IIndexPattern, DataPublicPluginStart } from 'src/plugins/data/public'; +import { IIndexPattern } from 'src/plugins/data/public'; +import { + QuerySuggestion, + UnifiedSearchPublicPluginStart, +} from '../../../../../../src/plugins/unified_search/public'; import { withKibana, KibanaReactContextValue, @@ -15,7 +19,9 @@ import { import { RendererFunction } from '../../lib/typed_react'; interface WithKueryAutocompletionLifecycleProps { - kibana: KibanaReactContextValue<{ data: DataPublicPluginStart } & KibanaServices>; + kibana: KibanaReactContextValue< + { unifiedSearch: UnifiedSearchPublicPluginStart } & KibanaServices + >; children: RendererFunction<{ isLoadingSuggestions: boolean; loadSuggestions: (expression: string, cursorPosition: number, maxSuggestions?: number) => void; @@ -62,7 +68,7 @@ class WithKueryAutocompletionComponent extends React.Component< const { indexPattern } = this.props; const language = 'kuery'; const hasQuerySuggestions = - this.props.kibana.services.data?.autocomplete.hasQuerySuggestions(language); + this.props.kibana.services.unifiedSearch?.autocomplete.hasQuerySuggestions(language); if (!hasQuerySuggestions) { return; @@ -77,7 +83,7 @@ class WithKueryAutocompletionComponent extends React.Component< }); const suggestions = - (await this.props.kibana.services.data.autocomplete.getQuerySuggestions({ + (await this.props.kibana.services.unifiedSearch.autocomplete.getQuerySuggestions({ language, query: expression, selectionStart: cursorPosition, diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index faece05732b7e..af0bd12303119 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -54,6 +54,7 @@ "kibanaReact", "usageCollection", "lists", - "ml" + "ml", + "unifiedSearch" ] } diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_flyout/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_flyout/index.tsx index 464e966f36349..5de733a7081e8 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_flyout/index.tsx @@ -135,7 +135,7 @@ export const AddExceptionFlyout = memo(function AddExceptionFlyout({ onRuleChange, alertStatus, }: AddExceptionFlyoutProps) { - const { http, data } = useKibana().services; + const { http, unifiedSearch } = useKibana().services; const [errorsExist, setErrorExists] = useState(false); const [comment, setComment] = useState(''); const { rule: maybeRule, loading: isRuleLoading } = useRuleAsync(ruleId); @@ -503,7 +503,7 @@ export const AddExceptionFlyout = memo(function AddExceptionFlyout({ allowLargeValueLists: !isEqlRule(maybeRule?.type) && !isThresholdRule(maybeRule?.type), httpService: http, - autocompleteService: data.autocomplete, + autocompleteService: unifiedSearch.autocomplete, exceptionListItems: initialExceptionItems, listType: exceptionListType, osTypes: osTypesSelection, diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_flyout/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_flyout/index.tsx index 0ed810b4ad263..8b55ae49dc569 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_flyout/index.tsx @@ -112,7 +112,7 @@ export const EditExceptionFlyout = memo(function EditExceptionFlyout({ onConfirm, onRuleChange, }: EditExceptionFlyoutProps) { - const { http, data } = useKibana().services; + const { http, unifiedSearch } = useKibana().services; const [comment, setComment] = useState(''); const [errorsExist, setErrorExists] = useState(false); const { rule: maybeRule, loading: isRuleLoading } = useRuleAsync(ruleId); @@ -360,7 +360,7 @@ export const EditExceptionFlyout = memo(function EditExceptionFlyout({ allowLargeValueLists: !isEqlRule(maybeRule?.type) && !isThresholdRule(maybeRule?.type), httpService: http, - autocompleteService: data.autocomplete, + autocompleteService: unifiedSearch.autocomplete, exceptionListItems: [exceptionItem], listType: exceptionListType, listId: exceptionItem.list_id, diff --git a/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx index 63e90848483c0..5f42b33ab1d50 100644 --- a/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx @@ -14,6 +14,8 @@ import { TestProviders, mockIndexPattern } from '../../mock'; import { FilterManager } from '../../../../../../../src/plugins/data/public'; import { SearchBar } from '../../../../../../../src/plugins/unified_search/public'; import { QueryBar, QueryBarComponentProps } from '.'; +import { setAutocomplete } from '../../../../../../../src/plugins/unified_search/public/services'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; const mockUiSettingsForFilterManager = coreMock.createStart().uiSettings; @@ -267,6 +269,11 @@ describe('QueryBar ', () => { }); describe('#onSavedQueryUpdated', () => { + beforeEach(() => { + const autocompleteStart = unifiedSearchPluginMock.createStartContract(); + setAutocomplete(autocompleteStart.autocomplete); + }); + test('is only reference that changed when dataProviders props get updated', async () => { const wrapper = await getWrapper( { beforeEach(() => { (useKibana as jest.Mock).mockReturnValue({ services: { - data: { + unifiedSearch: { autocomplete: { getValueSuggestions: getValueSuggestionsMock, }, diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx index 0cb1ed830ceca..4b2e9fde7bd68 100644 --- a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx @@ -56,7 +56,7 @@ describe('ListItemComponent', () => { beforeAll(() => { (useKibana as jest.Mock).mockReturnValue({ services: { - data: { + unifiedSearch: { autocomplete: { getValueSuggestions: getValueSuggestionsMock, }, diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts index a0053bba304cc..102ec3160f015 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts @@ -13,6 +13,7 @@ import { RecursivePartial } from '@elastic/eui/src/components/common'; import { coreMock, themeServiceMock } from '../../../../../../../src/core/public/mocks'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; +import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; import { securityMock } from '../../../../../../plugins/security/public/mocks'; import { DEFAULT_APP_REFRESH_INTERVAL, @@ -95,6 +96,7 @@ export const createStartServicesMock = ( const urlService = new MockUrlService(); const locator = urlService.locators.create(new MlLocatorDefinition()); const fleet = fleetMock.createStartMock(); + const unifiedSearch = unifiedSearchPluginMock.createStartContract(); return { ...core, @@ -105,6 +107,7 @@ export const createStartServicesMock = ( getCreateCase: jest.fn(), getRecentCases: jest.fn(), }, + unifiedSearch, data: { ...data, query: { diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx index 440ea57ec58ad..e22cb20976e6f 100644 --- a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx @@ -46,7 +46,7 @@ export interface AppContextTestRender { store: Store; history: ReturnType; coreStart: ReturnType; - depsStart: Pick; + depsStart: Pick; startServices: StartServices; middlewareSpy: MiddlewareActionSpyHelper; /** diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx index da7b1e0067691..5c825dbba4f09 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx @@ -256,7 +256,7 @@ export const SeverityField = ({ { services: { http: {}, data: {}, + unifiedSearch: {}, notifications: {}, }, }); diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx index 027d6e2bacfa6..abda873ed2168 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx @@ -88,7 +88,7 @@ interface EventFiltersFormProps { } export const EventFiltersForm: React.FC = memo( ({ allowSelectOs = false, policies, arePoliciesLoading }) => { - const { http, data } = useKibana().services; + const { http, unifiedSearch } = useKibana().services; const dispatch = useDispatch>(); const exception = useEventFiltersSelector(getFormEntryStateMutable); @@ -225,7 +225,7 @@ export const EventFiltersForm: React.FC = memo( getExceptionBuilderComponentLazy({ allowLargeValueLists: false, httpService: http, - autocompleteService: data.autocomplete, + autocompleteService: unifiedSearch.autocomplete, exceptionListItems: [exception as ExceptionListItemSchema], listType: EVENT_FILTER_LIST_TYPE, listId: ENDPOINT_EVENT_FILTERS_LIST_ID, @@ -243,7 +243,7 @@ export const EventFiltersForm: React.FC = memo( operatorsList: EVENT_FILTERS_OPERATORS, osTypes: exception?.os_types, }), - [data, handleOnBuilderChange, http, indexPatterns, exception] + [unifiedSearch, handleOnBuilderChange, http, indexPatterns, exception] ); const nameInputMemo = useMemo( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx index 066d466bf9149..54b80cf20811d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx @@ -18,6 +18,8 @@ import { FilterStateStore } from '@kbn/es-query'; import { FilterManager } from '../../../../../../../../src/plugins/data/public'; import { mockDataProviders } from '../data_providers/mock/mock_data_providers'; import { buildGlobalQuery } from '../helpers'; +import { setAutocomplete } from '../../../../../../../../src/plugins/unified_search/public/services'; +import { unifiedSearchPluginMock } from '../../../../../../../../src/plugins/unified_search/public/mocks'; import { QueryBarTimeline, @@ -184,6 +186,11 @@ describe('Timeline QueryBar ', () => { }); describe('#onSavedQuery', () => { + beforeEach(() => { + const autocompleteStart = unifiedSearchPluginMock.createStartContract(); + setAutocomplete(autocompleteStart.autocomplete); + }); + test('is only reference that changed when dataProviders props get updated', async () => { const Proxy = (props: QueryBarTimelineComponentProps) => ( diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index a1abc744c3336..b9c4e8f18fadf 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -1543,22 +1543,6 @@ "data.inspector.table.tableLabel": "Tableau {index}", "data.inspector.table.tablesDescription": "Il y a {tablesCount, plural, one {# tableau} other {# tableaux} } au total.", "data.inspector.table.tableSelectorLabel": "Sélectionné :", - "data.kueryAutocomplete.andOperatorDescription": "Nécessite que {bothArguments} soient ''vrai''.", - "data.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "les deux arguments", - "data.kueryAutocomplete.equalOperatorDescription": "{equals} une certaine valeur", - "data.kueryAutocomplete.equalOperatorDescription.equalsText": "égale", - "data.kueryAutocomplete.existOperatorDescription": "{exists} sous un certain format", - "data.kueryAutocomplete.existOperatorDescription.existsText": "existe", - "data.kueryAutocomplete.greaterThanOperatorDescription": "est {greaterThan} une certaine valeur", - "data.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "supérieur à", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "est {greaterThanOrEqualTo} une certaine valeur", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "supérieur ou égal à", - "data.kueryAutocomplete.lessThanOperatorDescription": "est {lessThan} une certaine valeur", - "data.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "inférieur à", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription": "est {lessThanOrEqualTo} une certaine valeur", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "inférieur ou égal à", - "data.kueryAutocomplete.orOperatorDescription": "Nécessite qu’{oneOrMoreArguments} soit ''vrai''.", - "data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "au moins un argument", "data.painlessError.buttonTxt": "Modifier le script", "data.painlessError.painlessScriptedFieldErrorMessage": "Erreur d'exécution du champ d'exécution ou du champ scripté sur le modèle d'indexation {indexPatternName}", "data.parseEsInterval.invalidEsCalendarIntervalErrorMessage": "Intervalle de calendrier non valide : {interval} ; la valeur doit être 1.", @@ -2114,121 +2098,6 @@ "data.searchSessions.sessionService.sessionObjectFetchError": "Échec de récupération des informations de la session de recherche", "data.triggers.applyFilterDescription": "Lorsque le filtre Kibana est appliqué. Peut être un filtre simple ou un filtre de plage.", "data.triggers.applyFilterTitle": "Appliquer le filtre", - "unifiedSearch.search.unableToGetSavedQueryToastTitle": "Impossible de charger la requête enregistrée {savedQueryId}", - "unifiedSearch.noDataPopover.content": "Cette plage temporelle ne contient pas de données. Étendez ou ajustez la plage temporelle pour obtenir plus de champs et pouvoir créer des graphiques.", - "unifiedSearch.noDataPopover.dismissAction": "Ne plus afficher", - "unifiedSearch.noDataPopover.subtitle": "Conseil", - "unifiedSearch.noDataPopover.title": "Ensemble de données vide", - "unifiedSearch.query.queryBar.clearInputLabel": "Effacer l'entrée", - "unifiedSearch.query.queryBar.comboboxAriaLabel": "Rechercher et filtrer la page {pageType}", - "unifiedSearch.query.queryBar.kqlFullLanguageName": "Langage de requête Kibana", - "unifiedSearch.query.queryBar.kqlLanguageName": "KQL", - "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoDocLinkText": "documents", - "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoOptOutText": "Ne plus afficher", - "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoText": "Il semblerait que votre requête porte sur un champ imbriqué. Selon le résultat visé, il existe plusieurs façons de construire une syntaxe KQL pour des requêtes imbriquées. Apprenez-en plus avec notre {link}.", - "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoTitle": "Syntaxe de requête imbriquée KQL", - "unifiedSearch.query.queryBar.kqlOffLabel": "Désactivé", - "unifiedSearch.query.queryBar.kqlOnLabel": "Activé", - "unifiedSearch.query.queryBar.languageSwitcher.toText": "Passer au langage de requête Kibana pour la recherche", - "unifiedSearch.query.queryBar.luceneLanguageName": "Lucene", - "unifiedSearch.query.queryBar.searchInputAriaLabel": "Commencer à taper pour rechercher et filtrer la page {pageType}", - "unifiedSearch.query.queryBar.searchInputPlaceholder": "Recherche", - "unifiedSearch.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) offre une syntaxe de requête simplifiée et la prise en charge des champs scriptés. KQL offre également une fonctionnalité de saisie semi-automatique. Si vous désactivez KQL, {nonKqlModeHelpText}.", - "unifiedSearch.query.queryBar.syntaxOptionsDescription.nonKqlModeHelpText": "Kibana utilise Lucene.", - "unifiedSearch.search.searchBar.savedQueryDescriptionLabelText": "Description", - "unifiedSearch.search.searchBar.savedQueryDescriptionText": "Enregistrez le texte et les filtres de la requête que vous souhaitez réutiliser.", - "unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "Ce nom est en conflit avec une requête enregistrée existante.", - "unifiedSearch.search.searchBar.savedQueryFormCancelButtonText": "Annuler", - "unifiedSearch.search.searchBar.savedQueryFormSaveButtonText": "Enregistrer", - "unifiedSearch.search.searchBar.savedQueryFormTitle": "Enregistrer la requête", - "unifiedSearch.search.searchBar.savedQueryIncludeFiltersLabelText": "Inclure les filtres", - "unifiedSearch.search.searchBar.savedQueryIncludeTimeFilterLabelText": "Inclure le filtre temporel", - "unifiedSearch.search.searchBar.savedQueryNameHelpText": "Un nom est requis. Le nom ne peut pas contenir d'espace vide au début ou à la fin. Le nom doit être unique.", - "unifiedSearch.search.searchBar.savedQueryNameLabelText": "Nom", - "unifiedSearch.search.searchBar.savedQueryNoSavedQueriesText": "Aucune requête enregistrée.", - "unifiedSearch.search.searchBar.savedQueryPopoverButtonText": "Voir les requêtes enregistrées", - "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonAriaLabel": "Effacer la requête enregistrée en cours", - "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonText": "Effacer", - "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionCancelButtonText": "Annuler", - "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "Supprimer", - "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "Supprimer \"{savedQueryName}\" ?", - "unifiedSearch.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "Supprimer la requête enregistrée {savedQueryName}", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "Enregistrer en tant que nouvelle requête enregistrée", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "Enregistrer en tant que nouvelle", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "Enregistrer une nouvelle requête enregistrée", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonText": "Enregistrer la requête en cours", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonAriaLabel": "Enregistrer les modifications apportées à {title}", - "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonText": "Enregistrer les modifications", - "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName}", - "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "Description de {savedQueryName}", - "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName} sélectionné. Appuyez pour effacer les modifications.", - "unifiedSearch.search.searchBar.savedQueryPopoverTitleText": "Requêtes enregistrées", - "unifiedSearch.query.queryBar.syntaxOptionsTitle": "Options de syntaxe", - "unifiedSearch.filter.applyFilterActionTitle": "Appliquer le filtre à la vue en cours", - "unifiedSearch.filter.applyFilters.popupHeader": "Sélectionner les filtres à appliquer", - "unifiedSearch.filter.applyFiltersPopup.cancelButtonLabel": "Annuler", - "unifiedSearch.filter.applyFiltersPopup.saveButtonLabel": "Appliquer", - "unifiedSearch.filter.filterBar.addFilterButtonLabel": "Ajouter un filtre", - "unifiedSearch.filter.filterBar.deleteFilterButtonLabel": "Supprimer", - "unifiedSearch.filter.filterBar.disabledFilterPrefix": "Désactivé", - "unifiedSearch.filter.filterBar.disableFilterButtonLabel": "Désactiver temporairement", - "unifiedSearch.filter.filterBar.editFilterButtonLabel": "Modifier le filtre", - "unifiedSearch.filter.filterBar.enableFilterButtonLabel": "Réactiver", - "unifiedSearch.filter.filterBar.excludeFilterButtonLabel": "Exclure les résultats", - "unifiedSearch.filter.filterBar.filterItemBadgeAriaLabel": "Actions de filtrage", - "unifiedSearch.filter.filterBar.filterItemBadgeIconAriaLabel": "Supprimer {filter}", - "unifiedSearch.filter.filterBar.includeFilterButtonLabel": "Inclure les résultats", - "unifiedSearch.filter.filterBar.indexPatternSelectPlaceholder": "Sélectionner un modèle d'indexation", - "unifiedSearch.filter.filterBar.labelErrorInfo": "Modèle d'indexation {indexPattern} introuvable", - "unifiedSearch.filter.filterBar.labelErrorText": "Erreur", - "unifiedSearch.filter.filterBar.labelWarningInfo": "Le champ {fieldName} n'existe pas dans la vue en cours.", - "unifiedSearch.filter.filterBar.labelWarningText": "Avertissement", - "unifiedSearch.filter.filterBar.moreFilterActionsMessage": "Filtre : {innerText}. Sélectionner pour plus d’actions de filtrage.", - "unifiedSearch.filter.filterBar.negatedFilterPrefix": "NON ", - "unifiedSearch.filter.filterBar.pinFilterButtonLabel": "Épingler dans toutes les applications", - "unifiedSearch.filter.filterBar.pinnedFilterPrefix": "Épinglé", - "unifiedSearch.filter.filterBar.unpinFilterButtonLabel": "Désépingler", - "unifiedSearch.filter.filterEditor.cancelButtonLabel": "Annuler", - "unifiedSearch.filter.filterEditor.createCustomLabelInputLabel": "Étiquette personnalisée", - "unifiedSearch.filter.filterEditor.createCustomLabelSwitchLabel": "Créer une étiquette personnalisée ?", - "unifiedSearch.filter.filterEditor.doesNotExistOperatorOptionLabel": "n'existe pas", - "unifiedSearch.filter.filterEditor.editFilterPopupTitle": "Modifier le filtre", - "unifiedSearch.filter.filterEditor.editFilterValuesButtonLabel": "Modifier les valeurs du filtre", - "unifiedSearch.filter.filterEditor.editQueryDslButtonLabel": "Modifier en tant que Query DSL", - "unifiedSearch.filter.filterEditor.existsOperatorOptionLabel": "existe", - "unifiedSearch.filter.filterEditor.falseOptionLabel": "false", - "unifiedSearch.filter.filterEditor.fieldSelectLabel": "Champ", - "unifiedSearch.filter.filterEditor.fieldSelectPlaceholder": "Sélectionner d'abord un champ", - "unifiedSearch.filter.filterEditor.indexPatternSelectLabel": "Modèle d'indexation", - "unifiedSearch.filter.filterEditor.isBetweenOperatorOptionLabel": "est entre", - "unifiedSearch.filter.filterEditor.isNotBetweenOperatorOptionLabel": "n'est pas entre", - "unifiedSearch.filter.filterEditor.isNotOneOfOperatorOptionLabel": "n'est pas l'une des options suivantes", - "unifiedSearch.filter.filterEditor.isNotOperatorOptionLabel": "n'est pas", - "unifiedSearch.filter.filterEditor.isOneOfOperatorOptionLabel": "est l'une des options suivantes", - "unifiedSearch.filter.filterEditor.isOperatorOptionLabel": "est", - "unifiedSearch.filter.filterEditor.operatorSelectLabel": "Opérateur", - "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderSelect": "Sélectionner", - "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderWaiting": "En attente", - "unifiedSearch.filter.filterEditor.queryDslLabel": "Query DSL d'Elasticsearch", - "unifiedSearch.filter.filterEditor.rangeEndInputPlaceholder": "Fin de la plage", - "unifiedSearch.filter.filterEditor.rangeInputLabel": "Plage", - "unifiedSearch.filter.filterEditor.rangeStartInputPlaceholder": "Début de la plage", - "unifiedSearch.filter.filterEditor.saveButtonLabel": "Enregistrer", - "unifiedSearch.filter.filterEditor.trueOptionLabel": "vrai", - "unifiedSearch.filter.filterEditor.valueInputLabel": "Valeur", - "unifiedSearch.filter.filterEditor.valueInputPlaceholder": "Saisir une valeur", - "unifiedSearch.filter.filterEditor.valueSelectPlaceholder": "Sélectionner une valeur", - "unifiedSearch.filter.filterEditor.valuesSelectLabel": "Valeurs", - "unifiedSearch.filter.filterEditor.valuesSelectPlaceholder": "Sélectionner des valeurs", - "unifiedSearch.filter.options.changeAllFiltersButtonLabel": "Changer tous les filtres", - "unifiedSearch.filter.options.deleteAllFiltersButtonLabel": "Tout supprimer", - "unifiedSearch.filter.options.disableAllFiltersButtonLabel": "Tout désactiver", - "unifiedSearch.filter.options.enableAllFiltersButtonLabel": "Tout activer", - "unifiedSearch.filter.options.invertDisabledFiltersButtonLabel": "Inverser l’activation/désactivation", - "unifiedSearch.filter.options.invertNegatedFiltersButtonLabel": "Inverser l'inclusion", - "unifiedSearch.filter.options.pinAllFiltersButtonLabel": "Tout épingler", - "unifiedSearch.filter.options.unpinAllFiltersButtonLabel": "Tout désépingler", - "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "Changer tous les filtres", "devTools.badge.readOnly.text": "Lecture seule", "devTools.badge.readOnly.tooltip": "Enregistrement impossible", "devTools.devToolsTitle": "Outils de développement", @@ -25510,6 +25379,137 @@ "xpack.watcher.watchActions.webhook.portIsRequiredValidationMessage": "Le port webhook est requis.", "xpack.watcher.watchActions.webhook.usernameIsRequiredIfPasswordValidationMessage": "Le nom d'utilisateur est requis.", "xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "Ce champ est requis.", - "xpack.watcher.watcherDescription": "Détectez les modifications survenant dans vos données en créant, gérant et monitorant des alertes." + "xpack.watcher.watcherDescription": "Détectez les modifications survenant dans vos données en créant, gérant et monitorant des alertes.", + "unifiedSearch.noDataPopover.content": "Cette plage temporelle ne contient pas de données. Étendez ou ajustez la plage temporelle pour obtenir plus de champs et pouvoir créer des graphiques.", + "unifiedSearch.noDataPopover.dismissAction": "Ne plus afficher", + "unifiedSearch.noDataPopover.subtitle": "Conseil", + "unifiedSearch.noDataPopover.title": "Ensemble de données vide", + "unifiedSearch.query.queryBar.clearInputLabel": "Effacer l'entrée", + "unifiedSearch.query.queryBar.comboboxAriaLabel": "Rechercher et filtrer la page {pageType}", + "unifiedSearch.query.queryBar.kqlFullLanguageName": "Langage de requête Kibana", + "unifiedSearch.query.queryBar.kqlLanguageName": "KQL", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoDocLinkText": "documents", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoOptOutText": "Ne plus afficher", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoText": "Il semblerait que votre requête porte sur un champ imbriqué. Selon le résultat visé, il existe plusieurs façons de construire une syntaxe KQL pour des requêtes imbriquées. Apprenez-en plus avec notre {link}.", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoTitle": "Syntaxe de requête imbriquée KQL", + "unifiedSearch.query.queryBar.kqlOffLabel": "Désactivé", + "unifiedSearch.query.queryBar.kqlOnLabel": "Activé", + "unifiedSearch.query.queryBar.languageSwitcher.toText": "Passer au langage de requête Kibana pour la recherche", + "unifiedSearch.query.queryBar.luceneLanguageName": "Lucene", + "unifiedSearch.query.queryBar.searchInputAriaLabel": "Commencer à taper pour rechercher et filtrer la page {pageType}", + "unifiedSearch.query.queryBar.searchInputPlaceholder": "Recherche", + "unifiedSearch.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) offre une syntaxe de requête simplifiée et la prise en charge des champs scriptés. KQL offre également une fonctionnalité de saisie semi-automatique. Si vous désactivez KQL, {nonKqlModeHelpText}.", + "unifiedSearch.query.queryBar.syntaxOptionsDescription.nonKqlModeHelpText": "Kibana utilise Lucene.", + "unifiedSearch.search.searchBar.savedQueryDescriptionLabelText": "Description", + "unifiedSearch.search.searchBar.savedQueryDescriptionText": "Enregistrez le texte et les filtres de la requête que vous souhaitez réutiliser.", + "unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "Ce nom est en conflit avec une requête enregistrée existante.", + "unifiedSearch.search.searchBar.savedQueryFormCancelButtonText": "Annuler", + "unifiedSearch.search.searchBar.savedQueryFormSaveButtonText": "Enregistrer", + "unifiedSearch.search.searchBar.savedQueryFormTitle": "Enregistrer la requête", + "unifiedSearch.search.searchBar.savedQueryIncludeFiltersLabelText": "Inclure les filtres", + "unifiedSearch.search.searchBar.savedQueryIncludeTimeFilterLabelText": "Inclure le filtre temporel", + "unifiedSearch.search.searchBar.savedQueryNameHelpText": "Un nom est requis. Le nom ne peut pas contenir d'espace vide au début ou à la fin. Le nom doit être unique.", + "unifiedSearch.search.searchBar.savedQueryNameLabelText": "Nom", + "unifiedSearch.search.searchBar.savedQueryNoSavedQueriesText": "Aucune requête enregistrée.", + "unifiedSearch.search.searchBar.savedQueryPopoverButtonText": "Voir les requêtes enregistrées", + "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonAriaLabel": "Effacer la requête enregistrée en cours", + "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonText": "Effacer", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionCancelButtonText": "Annuler", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "Supprimer", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "Supprimer \"{savedQueryName}\" ?", + "unifiedSearch.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "Supprimer la requête enregistrée {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "Enregistrer en tant que nouvelle requête enregistrée", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "Enregistrer en tant que nouvelle", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "Enregistrer une nouvelle requête enregistrée", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonText": "Enregistrer la requête en cours", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonAriaLabel": "Enregistrer les modifications apportées à {title}", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonText": "Enregistrer les modifications", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "Description de {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName} sélectionné. Appuyez pour effacer les modifications.", + "unifiedSearch.search.searchBar.savedQueryPopoverTitleText": "Requêtes enregistrées", + "unifiedSearch.search.unableToGetSavedQueryToastTitle": "Impossible de charger la requête enregistrée {savedQueryId}", + "unifiedSearch.query.queryBar.syntaxOptionsTitle": "Options de syntaxe", + "unifiedSearch.filter.applyFilterActionTitle": "Appliquer le filtre à la vue en cours", + "unifiedSearch.filter.applyFilters.popupHeader": "Sélectionner les filtres à appliquer", + "unifiedSearch.filter.applyFiltersPopup.cancelButtonLabel": "Annuler", + "unifiedSearch.filter.applyFiltersPopup.saveButtonLabel": "Appliquer", + "unifiedSearch.filter.filterBar.addFilterButtonLabel": "Ajouter un filtre", + "unifiedSearch.filter.filterBar.deleteFilterButtonLabel": "Supprimer", + "unifiedSearch.filter.filterBar.disabledFilterPrefix": "Désactivé", + "unifiedSearch.filter.filterBar.disableFilterButtonLabel": "Désactiver temporairement", + "unifiedSearch.filter.filterBar.editFilterButtonLabel": "Modifier le filtre", + "unifiedSearch.filter.filterBar.enableFilterButtonLabel": "Réactiver", + "unifiedSearch.filter.filterBar.excludeFilterButtonLabel": "Exclure les résultats", + "unifiedSearch.filter.filterBar.filterItemBadgeAriaLabel": "Actions de filtrage", + "unifiedSearch.filter.filterBar.filterItemBadgeIconAriaLabel": "Supprimer {filter}", + "unifiedSearch.filter.filterBar.includeFilterButtonLabel": "Inclure les résultats", + "unifiedSearch.filter.filterBar.indexPatternSelectPlaceholder": "Sélectionner un modèle d'indexation", + "unifiedSearch.filter.filterBar.labelErrorInfo": "Modèle d'indexation {indexPattern} introuvable", + "unifiedSearch.filter.filterBar.labelErrorText": "Erreur", + "unifiedSearch.filter.filterBar.labelWarningInfo": "Le champ {fieldName} n'existe pas dans la vue en cours.", + "unifiedSearch.filter.filterBar.labelWarningText": "Avertissement", + "unifiedSearch.filter.filterBar.moreFilterActionsMessage": "Filtre : {innerText}. Sélectionner pour plus d’actions de filtrage.", + "unifiedSearch.filter.filterBar.negatedFilterPrefix": "NON ", + "unifiedSearch.filter.filterBar.pinFilterButtonLabel": "Épingler dans toutes les applications", + "unifiedSearch.filter.filterBar.pinnedFilterPrefix": "Épinglé", + "unifiedSearch.filter.filterBar.unpinFilterButtonLabel": "Désépingler", + "unifiedSearch.filter.filterEditor.cancelButtonLabel": "Annuler", + "unifiedSearch.filter.filterEditor.createCustomLabelInputLabel": "Étiquette personnalisée", + "unifiedSearch.filter.filterEditor.createCustomLabelSwitchLabel": "Créer une étiquette personnalisée ?", + "unifiedSearch.filter.filterEditor.doesNotExistOperatorOptionLabel": "n'existe pas", + "unifiedSearch.filter.filterEditor.editFilterPopupTitle": "Modifier le filtre", + "unifiedSearch.filter.filterEditor.editFilterValuesButtonLabel": "Modifier les valeurs du filtre", + "unifiedSearch.filter.filterEditor.editQueryDslButtonLabel": "Modifier en tant que Query DSL", + "unifiedSearch.filter.filterEditor.existsOperatorOptionLabel": "existe", + "unifiedSearch.filter.filterEditor.falseOptionLabel": "false", + "unifiedSearch.filter.filterEditor.fieldSelectLabel": "Champ", + "unifiedSearch.filter.filterEditor.fieldSelectPlaceholder": "Sélectionner d'abord un champ", + "unifiedSearch.filter.filterEditor.indexPatternSelectLabel": "Modèle d'indexation", + "unifiedSearch.filter.filterEditor.isBetweenOperatorOptionLabel": "est entre", + "unifiedSearch.filter.filterEditor.isNotBetweenOperatorOptionLabel": "n'est pas entre", + "unifiedSearch.filter.filterEditor.isNotOneOfOperatorOptionLabel": "n'est pas l'une des options suivantes", + "unifiedSearch.filter.filterEditor.isNotOperatorOptionLabel": "n'est pas", + "unifiedSearch.filter.filterEditor.isOneOfOperatorOptionLabel": "est l'une des options suivantes", + "unifiedSearch.filter.filterEditor.isOperatorOptionLabel": "est", + "unifiedSearch.filter.filterEditor.operatorSelectLabel": "Opérateur", + "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderSelect": "Sélectionner", + "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderWaiting": "En attente", + "unifiedSearch.filter.filterEditor.queryDslLabel": "Query DSL d'Elasticsearch", + "unifiedSearch.filter.filterEditor.rangeEndInputPlaceholder": "Fin de la plage", + "unifiedSearch.filter.filterEditor.rangeInputLabel": "Plage", + "unifiedSearch.filter.filterEditor.rangeStartInputPlaceholder": "Début de la plage", + "unifiedSearch.filter.filterEditor.saveButtonLabel": "Enregistrer", + "unifiedSearch.filter.filterEditor.trueOptionLabel": "vrai", + "unifiedSearch.filter.filterEditor.valueInputLabel": "Valeur", + "unifiedSearch.filter.filterEditor.valueInputPlaceholder": "Saisir une valeur", + "unifiedSearch.filter.filterEditor.valueSelectPlaceholder": "Sélectionner une valeur", + "unifiedSearch.filter.filterEditor.valuesSelectLabel": "Valeurs", + "unifiedSearch.filter.filterEditor.valuesSelectPlaceholder": "Sélectionner des valeurs", + "unifiedSearch.filter.options.changeAllFiltersButtonLabel": "Changer tous les filtres", + "unifiedSearch.filter.options.deleteAllFiltersButtonLabel": "Tout supprimer", + "unifiedSearch.filter.options.disableAllFiltersButtonLabel": "Tout désactiver", + "unifiedSearch.filter.options.enableAllFiltersButtonLabel": "Tout activer", + "unifiedSearch.filter.options.invertDisabledFiltersButtonLabel": "Inverser l’activation/désactivation", + "unifiedSearch.filter.options.invertNegatedFiltersButtonLabel": "Inverser l'inclusion", + "unifiedSearch.filter.options.pinAllFiltersButtonLabel": "Tout épingler", + "unifiedSearch.filter.options.unpinAllFiltersButtonLabel": "Tout désépingler", + "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "Changer tous les filtres", + "unifiedSearch.kueryAutocomplete.andOperatorDescription": "Nécessite que {bothArguments} soient ''vrai''.", + "unifiedSearch.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "les deux arguments", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription": "{equals} une certaine valeur", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription.equalsText": "égale", + "unifiedSearch.kueryAutocomplete.existOperatorDescription": "{exists} sous un certain format", + "unifiedSearch.kueryAutocomplete.existOperatorDescription.existsText": "existe", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription": "est {greaterThan} une certaine valeur", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "supérieur à", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "est {greaterThanOrEqualTo} une certaine valeur", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "supérieur ou égal à", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription": "est {lessThan} une certaine valeur", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "inférieur à", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription": "est {lessThanOrEqualTo} une certaine valeur", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "inférieur ou égal à", + "unifiedSearch.kueryAutocomplete.orOperatorDescription": "Nécessite qu’{oneOrMoreArguments} soit ''vrai''.", + "unifiedSearch.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "au moins un argument" } } diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d58da0f2ed657..ed26dd00dfc4e 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1864,22 +1864,6 @@ "data.inspector.table.tableLabel": "テーブル{index}", "data.inspector.table.tablesDescription": "合計で{tablesCount, plural, other {# 個のテーブル} }があります", "data.inspector.table.tableSelectorLabel": "選択済み:", - "data.kueryAutocomplete.andOperatorDescription": "{bothArguments} が true であることを条件とする", - "data.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "両方の引数", - "data.kueryAutocomplete.equalOperatorDescription": "一部の値に{equals}", - "data.kueryAutocomplete.equalOperatorDescription.equalsText": "一致する", - "data.kueryAutocomplete.existOperatorDescription": "いずれかの形式中に{exists}", - "data.kueryAutocomplete.existOperatorDescription.existsText": "存在する", - "data.kueryAutocomplete.greaterThanOperatorDescription": "が一部の値{greaterThan}", - "data.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "より大きい", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "が一部の値{greaterThanOrEqualTo}", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "よりも大きいまたは等しい", - "data.kueryAutocomplete.lessThanOperatorDescription": "が一部の値{lessThan}", - "data.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "より小さい", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription": "が一部の値{lessThanOrEqualTo}", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "より小さいまたは等しい", - "data.kueryAutocomplete.orOperatorDescription": "{oneOrMoreArguments} が true であることを条件とする", - "data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "1つ以上の引数", "data.painlessError.buttonTxt": "スクリプトを編集", "data.painlessError.painlessScriptedFieldErrorMessage": "インデックスパターン{indexPatternName}でのランタイムフィールドまたはスクリプトフィールドの実行エラー", "data.parseEsInterval.invalidEsCalendarIntervalErrorMessage": "無効なカレンダー間隔:{interval}、1よりも大きな値が必要です", @@ -29463,6 +29447,22 @@ "unifiedSearch.filter.options.invertNegatedFiltersButtonLabel": "含める・除外を反転", "unifiedSearch.filter.options.pinAllFiltersButtonLabel": "すべてピン付け", "unifiedSearch.filter.options.unpinAllFiltersButtonLabel": "すべてのピンを外す", - "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "すべてのフィルターの変更" + "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "すべてのフィルターの変更", + "unifiedSearch.kueryAutocomplete.andOperatorDescription": "{bothArguments} が true であることを条件とする", + "unifiedSearch.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "両方の引数", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription": "一部の値に{equals}", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription.equalsText": "一致する", + "unifiedSearch.kueryAutocomplete.existOperatorDescription": "いずれかの形式中に{exists}", + "unifiedSearch.kueryAutocomplete.existOperatorDescription.existsText": "存在する", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription": "が一部の値{greaterThan}", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "より大きい", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "が一部の値{greaterThanOrEqualTo}", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "よりも大きいまたは等しい", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription": "が一部の値{lessThan}", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "より小さい", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription": "が一部の値{lessThanOrEqualTo}", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "より小さいまたは等しい", + "unifiedSearch.kueryAutocomplete.orOperatorDescription": "{oneOrMoreArguments} が true であることを条件とする", + "unifiedSearch.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "1つ以上の引数" } } diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 1f8bcf7b4fb74..7b309f364f2e8 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1869,22 +1869,6 @@ "data.inspector.table.tableLabel": "表 {index}", "data.inspector.table.tablesDescription": "总共有 {tablesCount, plural, other {# 个表} }", "data.inspector.table.tableSelectorLabel": "已选定:", - "data.kueryAutocomplete.andOperatorDescription": "需要{bothArguments}为 true", - "data.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "两个参数都", - "data.kueryAutocomplete.equalOperatorDescription": "{equals}某一值", - "data.kueryAutocomplete.equalOperatorDescription.equalsText": "等于", - "data.kueryAutocomplete.existOperatorDescription": "以任意形式{exists}", - "data.kueryAutocomplete.existOperatorDescription.existsText": "存在", - "data.kueryAutocomplete.greaterThanOperatorDescription": "{greaterThan}某一值", - "data.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "大于", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "{greaterThanOrEqualTo}某一值", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "大于或等于", - "data.kueryAutocomplete.lessThanOperatorDescription": "{lessThan}某一值", - "data.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "小于", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription": "{lessThanOrEqualTo}某一值", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "小于或等于", - "data.kueryAutocomplete.orOperatorDescription": "需要{oneOrMoreArguments}为 true", - "data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "一个或多个参数", "data.painlessError.buttonTxt": "编辑脚本", "data.painlessError.painlessScriptedFieldErrorMessage": "在索引模式 {indexPatternName} 上执行运行时字段或脚本字段时出错", "data.parseEsInterval.invalidEsCalendarIntervalErrorMessage": "无效的日历时间间隔:{interval},值必须为 1", @@ -29494,6 +29478,22 @@ "unifiedSearch.filter.options.invertNegatedFiltersButtonLabel": "反向包括", "unifiedSearch.filter.options.pinAllFiltersButtonLabel": "全部固定", "unifiedSearch.filter.options.unpinAllFiltersButtonLabel": "全部取消固定", - "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "更改所有筛选" + "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "更改所有筛选", + "unifiedSearch.kueryAutocomplete.andOperatorDescription": "需要{bothArguments}为 true", + "unifiedSearch.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "两个参数都", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription": "{equals}某一值", + "unifiedSearch.kueryAutocomplete.equalOperatorDescription.equalsText": "等于", + "unifiedSearch.kueryAutocomplete.existOperatorDescription": "以任意形式{exists}", + "unifiedSearch.kueryAutocomplete.existOperatorDescription.existsText": "存在", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription": "{greaterThan}某一值", + "unifiedSearch.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "大于", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "{greaterThanOrEqualTo}某一值", + "unifiedSearch.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "大于或等于", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription": "{lessThan}某一值", + "unifiedSearch.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "小于", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription": "{lessThanOrEqualTo}某一值", + "unifiedSearch.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "小于或等于", + "unifiedSearch.kueryAutocomplete.orOperatorDescription": "需要{oneOrMoreArguments}为 true", + "unifiedSearch.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "一个或多个参数" } } diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 26fb87e7fc4ce..ae841942f4af7 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -32,6 +32,7 @@ import { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../../src/plugins/data/public'; +import { UnifiedSearchPublicPluginStart } from '../../../../../src/plugins/unified_search/public'; import { alertTypeInitializers, legacyAlertTypeInitializers } from '../lib/alert_types'; import { FleetStart } from '../../../fleet/public'; @@ -64,6 +65,7 @@ export interface ClientPluginsSetup { export interface ClientPluginsStart { fleet?: FleetStart; data: DataPublicPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; discover: DiscoverStart; inspector: InspectorPluginStart; embeddable: EmbeddableStart; diff --git a/x-pack/plugins/uptime/public/lib/alert_types/lazy_wrapper/monitor_status.tsx b/x-pack/plugins/uptime/public/lib/alert_types/lazy_wrapper/monitor_status.tsx index 066c15238833a..56021700f5f36 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/lazy_wrapper/monitor_status.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/lazy_wrapper/monitor_status.tsx @@ -28,7 +28,7 @@ export default function MonitorStatusAlert({ core, plugins, params }: Props) { - + From b0cc1aeea872293bd2235f323055676013297e72 Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 13:41:40 +0500 Subject: [PATCH 02/13] minor fix after comments --- .../docker_generator/resources/base/bin/kibana-docker | 2 ++ .../dimension_panel/dimension_panel.test.tsx | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index fca5dce0ae2f9..2747f85d83408 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -38,6 +38,8 @@ kibana_vars=( csp.frame_ancestors csp.report_uri csp.report_to + data.autocomplete.valueSuggestions.terminateAfter + data.autocomplete.valueSuggestions.timeout unifiedSearch.autocomplete.valueSuggestions.terminateAfter unifiedSearch.autocomplete.valueSuggestions.timeout elasticsearch.customHeaders diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 57e099b199043..c952adea00c6b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -18,7 +18,6 @@ import { } from '@elastic/eui'; import { DataPublicPluginStart } from '../../../../../../src/plugins/data/public'; import { unifiedSearchPluginMock } from '../../../../../../src/plugins/unified_search/public/mocks'; -// import { UnifiedSearchPublicPluginStart } from '../../../../../../src/plugins/unified_search/public'; import { IndexPatternDimensionEditorComponent, IndexPatternDimensionEditorProps, From e2e65d64b43e638ae7ef1a3abd2d46366a79a74d Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 16:22:39 +0500 Subject: [PATCH 03/13] updated Documentation: data.autocomplete -> unifiedSearch.autocomplete --- config/kibana.yml | 4 ++-- docs/setup/settings.asciidoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/kibana.yml b/config/kibana.yml index 50ddad9a4b32a..4233bf2882a29 100644 --- a/config/kibana.yml +++ b/config/kibana.yml @@ -159,8 +159,8 @@ # =================== Search Autocomplete =================== # Time in milliseconds to wait for autocomplete suggestions from Elasticsearch. # This value must be a whole number greater than zero. Defaults to 1000ms -#data.autocomplete.valueSuggestions.timeout: 1000 +#unifiedSearch.autocomplete.valueSuggestions.timeout: 1000 # Maximum number of documents loaded by each shard to generate autocomplete suggestions. # This value must be a whole number greater than zero. Defaults to 100_000 -#data.autocomplete.valueSuggestions.terminateAfter: 100000 +#unifiedSearch.autocomplete.valueSuggestions.terminateAfter: 100000 diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index f5dca28a7da1c..2d52abc1f0138 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -289,11 +289,11 @@ is an alternative to `elasticsearch.username` and `elasticsearch.password`. | `interpreter.enableInVisualize` | Enables use of interpreter in Visualize. *Default: `true`* -| `data.autocomplete.valueSuggestions.timeout:` {ess-icon} +| `unifiedSearch.autocomplete.valueSuggestions.timeout:` {ess-icon} | Time in milliseconds to wait for autocomplete suggestions from {es}. This value must be a whole number greater than zero. *Default: `"1000"`* -| `data.autocomplete.valueSuggestions.terminateAfter:` {ess-icon} +| `unifiedSearch.autocomplete.valueSuggestions.terminateAfter:` {ess-icon} | Maximum number of documents loaded by each shard to generate autocomplete suggestions. This value must be a whole number greater than zero. *Default: `"100000"`* From e497a79479b9a99bb4696992ccb4438d94989302 Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 17:49:03 +0500 Subject: [PATCH 04/13] changed renameFromRoot order for autocomplete --- .../resources/base/bin/kibana-docker | 3 + .../server/config_deprecations.test.ts | 66 +++++++++++++++++-- .../server/config_deprecations.ts | 56 ++++++++++++++-- .../test_suites/core_plugins/rendering.ts | 10 +-- 4 files changed, 121 insertions(+), 14 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 9dceb40637050..f1b866c5800b1 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -42,6 +42,9 @@ kibana_vars=( data.autocomplete.valueSuggestions.timeout unifiedSearch.autocomplete.valueSuggestions.terminateAfter unifiedSearch.autocomplete.valueSuggestions.timeout + unifiedSearch.autocomplete.querySuggestions.enabled + unifiedSearch.autocomplete.valueSuggestions.enabled + unifiedSearch.autocomplete.valueSuggestions.timeout elasticsearch.customHeaders elasticsearch.hosts elasticsearch.logQueries diff --git a/src/plugins/unified_search/server/config_deprecations.test.ts b/src/plugins/unified_search/server/config_deprecations.test.ts index 251d36fb18183..c1085d6afcb9b 100644 --- a/src/plugins/unified_search/server/config_deprecations.test.ts +++ b/src/plugins/unified_search/server/config_deprecations.test.ts @@ -54,8 +54,7 @@ describe('Config Deprecations', () => { expect(migrated.unifiedSearch.autocomplete.valueSuggestions.terminateAfter).toEqual(123); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocompleteTerminateAfter\\" has been replaced by \\"data.autocomplete.valueSuggestions.terminateAfter\\"", - "Setting \\"data.autocomplete.valueSuggestions.terminateAfter\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.terminateAfter\\"", + "Setting \\"kibana.autocompleteTerminateAfter\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.terminateAfter\\"", ] `); }); @@ -71,8 +70,67 @@ describe('Config Deprecations', () => { expect(migrated.unifiedSearch.autocomplete.valueSuggestions.timeout).toEqual(123); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocompleteTimeout\\" has been replaced by \\"data.autocomplete.valueSuggestions.timeout\\"", - "Setting \\"data.autocomplete.valueSuggestions.timeout\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.timeout\\"", + "Setting \\"kibana.autocompleteTimeout\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.timeout\\"", + ] + `); + }); + + it('renames kibana.autocomplete.querySuggestions.enabled to unifiedSearch.autocomplete.querySuggestions.enabled', () => { + const config = { + kibana: { + autocomplete: { + querySuggestions: { + enabled: false, + }, + }, + }, + }; + const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); + expect(migrated.kibana?.autocomplete.querySuggestions.enabled).not.toBeDefined(); + expect(migrated.unifiedSearch.autocomplete.querySuggestions.enabled).toEqual(false); + expect(messages).toMatchInlineSnapshot(` + Array [ + "Setting \\"kibana.autocomplete.querySuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.querySuggestions.enabled\\"", + ] + `); + }); + + it('renames kibana.autocomplete.valueSuggestions.enabled to unifiedSearch.autocomplete.valueSuggestions.enabled', () => { + const config = { + kibana: { + autocomplete: { + valueSuggestions: { + enabled: false, + }, + }, + }, + }; + const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); + expect(migrated.kibana?.autocomplete.valueSuggestions.enabled).not.toBeDefined(); + expect(migrated.unifiedSearch.autocomplete.valueSuggestions.enabled).toEqual(false); + expect(messages).toMatchInlineSnapshot(` + Array [ + "Setting \\"kibana.autocomplete.valueSuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.enabled\\"", + ] + `); + }); + + it('renames kibana.autocomplete.valueSuggestions.tiers to unifiedSearch.autocomplete.valueSuggestions.tiers', () => { + const config = { + kibana: { + autocomplete: { + valueSuggestions: { + tiers: [], + }, + }, + }, + }; + const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); + expect(migrated.kibana?.autocomplete.valueSuggestions.tiers).not.toBeDefined(); + expect(migrated.unifiedSearch.autocomplete.valueSuggestions.tiers).toEqual([]); + expect(messages).toMatchInlineSnapshot(` + Array [ + "Setting \\"kibana.autocomplete.valueSuggestions.tiers\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.tiers\\"", ] `); }); diff --git a/src/plugins/unified_search/server/config_deprecations.ts b/src/plugins/unified_search/server/config_deprecations.ts index 75751e5157411..729dbbe51d2e0 100644 --- a/src/plugins/unified_search/server/config_deprecations.ts +++ b/src/plugins/unified_search/server/config_deprecations.ts @@ -12,18 +12,15 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = renameFromRoot, }) => [ renameFromRoot( - 'kibana.autocompleteTerminateAfter', 'data.autocomplete.valueSuggestions.terminateAfter', + 'unifiedSearch.autocomplete.valueSuggestions.terminateAfter', { level: 'warning' } ), renameFromRoot( - 'data.autocomplete.valueSuggestions.terminateAfter', + 'kibana.autocompleteTerminateAfter', 'unifiedSearch.autocomplete.valueSuggestions.terminateAfter', { level: 'warning' } ), - renameFromRoot('kibana.autocompleteTimeout', 'data.autocomplete.valueSuggestions.timeout', { - level: 'warning', - }), renameFromRoot( 'data.autocomplete.valueSuggestions.timeout', 'unifiedSearch.autocomplete.valueSuggestions.timeout', @@ -31,4 +28,53 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = level: 'warning', } ), + renameFromRoot( + 'kibana.autocompleteTimeout', + 'unifiedSearch.autocomplete.valueSuggestions.timeout', + { + level: 'warning', + } + ), + renameFromRoot( + 'data.autocomplete.querySuggestions.enabled', + 'unifiedSearch.autocomplete.querySuggestions.enabled', + { + level: 'warning', + } + ), + renameFromRoot( + 'kibana.autocomplete.querySuggestions.enabled', + 'unifiedSearch.autocomplete.querySuggestions.enabled', + { + level: 'warning', + } + ), + renameFromRoot( + 'data.autocomplete.valueSuggestions.enabled', + 'unifiedSearch.autocomplete.valueSuggestions.enabled', + { + level: 'warning', + } + ), + renameFromRoot( + 'kibana.autocomplete.valueSuggestions.enabled', + 'unifiedSearch.autocomplete.valueSuggestions.enabled', + { + level: 'warning', + } + ), + renameFromRoot( + 'data.autocomplete.valueSuggestions.tiers', + 'unifiedSearch.autocomplete.valueSuggestions.tiers', + { + level: 'warning', + } + ), + renameFromRoot( + 'kibana.autocomplete.valueSuggestions.tiers', + 'unifiedSearch.autocomplete.valueSuggestions.tiers', + { + level: 'warning', + } + ), ]; diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 889027cb0bce7..856fd4f9d6dde 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -85,11 +85,11 @@ export default function ({ getService }: PluginFunctionalProviderContext) { // Ensure that your change does not unintentionally expose any sensitive values! 'console.ui.enabled (boolean)', 'dashboard.allowByValueEmbeddables (boolean)', - 'unified_search.autocomplete.querySuggestions.enabled (boolean)', - 'unified_search.autocomplete.valueSuggestions.enabled (boolean)', - 'unified_search.autocomplete.valueSuggestions.terminateAfter (duration)', - 'unified_search.autocomplete.valueSuggestions.tiers (array)', - 'unified_search.autocomplete.valueSuggestions.timeout (duration)', + 'unifiedSearch.autocomplete.querySuggestions.enabled (boolean)', + 'unifiedSearch.autocomplete.valueSuggestions.enabled (boolean)', + 'unifiedSearch.autocomplete.valueSuggestions.terminateAfter (duration)', + 'unifiedSearch.autocomplete.valueSuggestions.tiers (array)', + 'unifiedSearch.autocomplete.valueSuggestions.timeout (duration)', 'data.search.aggs.shardDelay.enabled (boolean)', 'enterpriseSearch.host (string)', 'home.disableWelcomeScreen (boolean)', From eb9c4914c84e2c16ffd093ee99a997603aed0977 Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 18:18:28 +0500 Subject: [PATCH 05/13] removed extra renameFromRoot in config deprecations, updated test --- .../server/config_deprecations.test.ts | 24 +++++++++---------- .../server/config_deprecations.ts | 21 ---------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/plugins/unified_search/server/config_deprecations.test.ts b/src/plugins/unified_search/server/config_deprecations.test.ts index c1085d6afcb9b..f90c41086a657 100644 --- a/src/plugins/unified_search/server/config_deprecations.test.ts +++ b/src/plugins/unified_search/server/config_deprecations.test.ts @@ -75,9 +75,9 @@ describe('Config Deprecations', () => { `); }); - it('renames kibana.autocomplete.querySuggestions.enabled to unifiedSearch.autocomplete.querySuggestions.enabled', () => { + it('renames data.autocomplete.querySuggestions.enabled to unifiedSearch.autocomplete.querySuggestions.enabled', () => { const config = { - kibana: { + data: { autocomplete: { querySuggestions: { enabled: false, @@ -86,18 +86,18 @@ describe('Config Deprecations', () => { }, }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated.kibana?.autocomplete.querySuggestions.enabled).not.toBeDefined(); + expect(migrated.data?.autocomplete.querySuggestions.enabled).not.toBeDefined(); expect(migrated.unifiedSearch.autocomplete.querySuggestions.enabled).toEqual(false); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocomplete.querySuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.querySuggestions.enabled\\"", + "Setting \\"data.autocomplete.querySuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.querySuggestions.enabled\\"", ] `); }); - it('renames kibana.autocomplete.valueSuggestions.enabled to unifiedSearch.autocomplete.valueSuggestions.enabled', () => { + it('renames data.autocomplete.valueSuggestions.enabled to unifiedSearch.autocomplete.valueSuggestions.enabled', () => { const config = { - kibana: { + data: { autocomplete: { valueSuggestions: { enabled: false, @@ -106,18 +106,18 @@ describe('Config Deprecations', () => { }, }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated.kibana?.autocomplete.valueSuggestions.enabled).not.toBeDefined(); + expect(migrated.data?.autocomplete.valueSuggestions.enabled).not.toBeDefined(); expect(migrated.unifiedSearch.autocomplete.valueSuggestions.enabled).toEqual(false); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocomplete.valueSuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.enabled\\"", + "Setting \\"data.autocomplete.valueSuggestions.enabled\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.enabled\\"", ] `); }); - it('renames kibana.autocomplete.valueSuggestions.tiers to unifiedSearch.autocomplete.valueSuggestions.tiers', () => { + it('renames data.autocomplete.valueSuggestions.tiers to unifiedSearch.autocomplete.valueSuggestions.tiers', () => { const config = { - kibana: { + data: { autocomplete: { valueSuggestions: { tiers: [], @@ -126,11 +126,11 @@ describe('Config Deprecations', () => { }, }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated.kibana?.autocomplete.valueSuggestions.tiers).not.toBeDefined(); + expect(migrated.data?.autocomplete.valueSuggestions.tiers).not.toBeDefined(); expect(migrated.unifiedSearch.autocomplete.valueSuggestions.tiers).toEqual([]); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocomplete.valueSuggestions.tiers\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.tiers\\"", + "Setting \\"data.autocomplete.valueSuggestions.tiers\\" has been replaced by \\"unifiedSearch.autocomplete.valueSuggestions.tiers\\"", ] `); }); diff --git a/src/plugins/unified_search/server/config_deprecations.ts b/src/plugins/unified_search/server/config_deprecations.ts index 729dbbe51d2e0..59c6a20fd93a7 100644 --- a/src/plugins/unified_search/server/config_deprecations.ts +++ b/src/plugins/unified_search/server/config_deprecations.ts @@ -42,13 +42,6 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = level: 'warning', } ), - renameFromRoot( - 'kibana.autocomplete.querySuggestions.enabled', - 'unifiedSearch.autocomplete.querySuggestions.enabled', - { - level: 'warning', - } - ), renameFromRoot( 'data.autocomplete.valueSuggestions.enabled', 'unifiedSearch.autocomplete.valueSuggestions.enabled', @@ -56,13 +49,6 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = level: 'warning', } ), - renameFromRoot( - 'kibana.autocomplete.valueSuggestions.enabled', - 'unifiedSearch.autocomplete.valueSuggestions.enabled', - { - level: 'warning', - } - ), renameFromRoot( 'data.autocomplete.valueSuggestions.tiers', 'unifiedSearch.autocomplete.valueSuggestions.tiers', @@ -70,11 +56,4 @@ export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = level: 'warning', } ), - renameFromRoot( - 'kibana.autocomplete.valueSuggestions.tiers', - 'unifiedSearch.autocomplete.valueSuggestions.tiers', - { - level: 'warning', - } - ), ]; From bbccb48cc69acbc85207c0ea98c86d578803fb2d Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 20:36:19 +0500 Subject: [PATCH 06/13] added configPath for unified search plugin --- src/plugins/unified_search/kibana.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/unified_search/kibana.json b/src/plugins/unified_search/kibana.json index 45d8c11756f78..20381fc96f636 100755 --- a/src/plugins/unified_search/kibana.json +++ b/src/plugins/unified_search/kibana.json @@ -11,5 +11,6 @@ "ui": true, "requiredPlugins": ["dataViews", "data", "uiActions"], "requiredBundles": ["kibanaUtils", "kibanaReact", "data"], - "serviceFolders": ["autocomplete"] + "serviceFolders": ["autocomplete"], + "configPath": ["unifiedSearch"], } From e9468b822a0a085b2a05512fedc414365c51fa3f Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 13 Apr 2022 20:47:09 +0500 Subject: [PATCH 07/13] Update kibana.json --- src/plugins/unified_search/kibana.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/unified_search/kibana.json b/src/plugins/unified_search/kibana.json index 20381fc96f636..b947141a0c68a 100755 --- a/src/plugins/unified_search/kibana.json +++ b/src/plugins/unified_search/kibana.json @@ -12,5 +12,5 @@ "requiredPlugins": ["dataViews", "data", "uiActions"], "requiredBundles": ["kibanaUtils", "kibanaReact", "data"], "serviceFolders": ["autocomplete"], - "configPath": ["unifiedSearch"], + "configPath": ["unifiedSearch"] } From baaad42b3404c77e3db4461ad26dbff9650fb2ba Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Thu, 14 Apr 2022 12:42:36 +0500 Subject: [PATCH 08/13] updated path to autocomplete --- .../docker_generator/resources/base/bin/kibana-docker | 2 +- .../public/typeahead/suggestion_component.test.tsx | 2 +- .../unified_search/public/typeahead/suggestion_component.tsx | 2 +- .../public/typeahead/suggestions_component.test.tsx | 2 +- .../unified_search/public/typeahead/suggestions_component.tsx | 2 +- src/plugins/unified_search/public/typeahead/types.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index f1b866c5800b1..ce08cc758acf6 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -44,7 +44,7 @@ kibana_vars=( unifiedSearch.autocomplete.valueSuggestions.timeout unifiedSearch.autocomplete.querySuggestions.enabled unifiedSearch.autocomplete.valueSuggestions.enabled - unifiedSearch.autocomplete.valueSuggestions.timeout + unifiedSearch.autocomplete.valueSuggestions.tiers elasticsearch.customHeaders elasticsearch.hosts elasticsearch.logQueries diff --git a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx index 9d5f2f4a20420..31c38ad94815a 100644 --- a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../unified_search/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; import { SuggestionComponent } from './suggestion_component'; const noop = () => { diff --git a/src/plugins/unified_search/public/typeahead/suggestion_component.tsx b/src/plugins/unified_search/public/typeahead/suggestion_component.tsx index e00414aee0728..b8b3f2640c31a 100644 --- a/src/plugins/unified_search/public/typeahead/suggestion_component.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestion_component.tsx @@ -9,7 +9,7 @@ import { EuiIcon } from '@elastic/eui'; import classNames from 'classnames'; import React, { useCallback } from 'react'; -import { QuerySuggestion } from '../../../unified_search/public'; +import { QuerySuggestion } from '../autocomplete'; import { SuggestionOnClick, SuggestionOnMouseEnter } from './types'; function getEuiIconType(type: string) { diff --git a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx index 328474d179fcc..6a21041f69530 100644 --- a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { QuerySuggestion, QuerySuggestionTypes } from '../../../unified_search/public'; +import { QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; import { SuggestionComponent } from './suggestion_component'; import SuggestionsComponent from './suggestions_component'; diff --git a/src/plugins/unified_search/public/typeahead/suggestions_component.tsx b/src/plugins/unified_search/public/typeahead/suggestions_component.tsx index 31b6209194d66..75e446cf2d6e8 100644 --- a/src/plugins/unified_search/public/typeahead/suggestions_component.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestions_component.tsx @@ -13,7 +13,7 @@ import classNames from 'classnames'; import styled from 'styled-components'; import useRafState from 'react-use/lib/useRafState'; -import { QuerySuggestion } from '../../../unified_search/public'; +import { QuerySuggestion } from '../autocomplete'; import { SuggestionComponent } from './suggestion_component'; import { SUGGESTIONS_LIST_REQUIRED_BOTTOM_SPACE, diff --git a/src/plugins/unified_search/public/typeahead/types.ts b/src/plugins/unified_search/public/typeahead/types.ts index 643b99c1799a5..1a58c29d028e1 100644 --- a/src/plugins/unified_search/public/typeahead/types.ts +++ b/src/plugins/unified_search/public/typeahead/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { QuerySuggestion } from '../../../unified_search/public'; +import { QuerySuggestion } from '../autocomplete'; export type SuggestionOnClick = (suggestion: QuerySuggestion, index: number) => void; From fe55f2c84a910fd14fc83c0edeb0761c88be1bad Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Mon, 18 Apr 2022 12:47:20 +0500 Subject: [PATCH 09/13] fix conflict --- .../query_string_input/query_bar_top_row.test.tsx | 11 +++-------- .../public/typeahead/suggestion_component.test.tsx | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx index 4e80fe0d6c16f..189f12765ad15 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.test.tsx @@ -18,16 +18,11 @@ import { coreMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { I18nProvider } from '@kbn/i18n-react'; -<<<<<<< HEAD -import { stubIndexPattern } from '../../../data/public/stubs'; -import { UI_SETTINGS } from '../../../data/common'; -import { setAutocomplete } from '../../../unified_search/public/services'; -import { unifiedSearchPluginMock } from '../../../unified_search/public/mocks'; - -======= import { stubIndexPattern } from '@kbn/data-plugin/public/stubs'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; ->>>>>>> upstream/main +import { setAutocomplete } from '../services'; +import { unifiedSearchPluginMock } from '../mocks'; + const startMock = coreMock.createStart(); const mockTimeHistory = { diff --git a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx index ff33136efcbcd..31c38ad94815a 100644 --- a/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestion_component.test.tsx @@ -8,11 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -<<<<<<< HEAD import { QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; -======= -import { QuerySuggestion, QuerySuggestionTypes } from '@kbn/data-plugin/public'; ->>>>>>> upstream/main import { SuggestionComponent } from './suggestion_component'; const noop = () => { From ea5815c9f2ace2b095ae2e24e4610f29111bc62c Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Mon, 18 Apr 2022 12:48:37 +0500 Subject: [PATCH 10/13] fix conflict --- .../public/typeahead/suggestions_component.test.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx index 0f1188d4251d2..6a21041f69530 100644 --- a/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx +++ b/src/plugins/unified_search/public/typeahead/suggestions_component.test.tsx @@ -8,11 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -<<<<<<< HEAD import { QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; -======= -import { QuerySuggestion, QuerySuggestionTypes } from '@kbn/data-plugin/public'; ->>>>>>> upstream/main import { SuggestionComponent } from './suggestion_component'; import SuggestionsComponent from './suggestions_component'; From 94147eb4000da7a423d347f22614b564c365d5b2 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 18 Apr 2022 08:36:05 +0000 Subject: [PATCH 11/13] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../controls/public/services/kibana/unified_search.ts | 2 +- .../controls/public/services/storybook/unified_search.ts | 6 +++--- src/plugins/controls/public/services/unified_search.ts | 2 +- src/plugins/controls/public/types.ts | 2 +- .../options_list/options_list_suggestions_route.ts | 2 +- src/plugins/controls/server/plugin.ts | 2 +- src/plugins/input_control_vis/public/plugin.ts | 5 ++++- .../providers/kql_query_suggestion/field.tsx | 3 ++- .../autocomplete/providers/kql_query_suggestion/index.ts | 6 +++++- .../autocomplete/providers/kql_query_suggestion/value.ts | 2 +- .../autocomplete/providers/query_suggestion_provider.ts | 4 ++-- src/plugins/unified_search/public/plugin.ts | 4 ++-- .../query_string_input/query_string_input.test.tsx | 4 ++-- .../public/query_string_input/query_string_input.tsx | 6 +----- src/plugins/unified_search/public/services.ts | 2 +- src/plugins/unified_search/public/types.ts | 6 +++--- .../unified_search/server/autocomplete/terms_agg.ts | 2 +- .../unified_search/server/autocomplete/terms_enum.ts | 2 +- .../unified_search/server/config_deprecations.test.ts | 2 +- src/plugins/unified_search/server/config_deprecations.ts | 2 +- src/plugins/unified_search/server/data_views/index.ts | 2 +- src/plugins/unified_search/server/index.ts | 2 +- src/plugins/unified_search/server/plugin.ts | 2 +- x-pack/plugins/fleet/public/plugin.ts | 1 + .../dimension_panel/dimension_panel.tsx | 2 +- .../dimension_panel/droppable/droppable.test.ts | 2 +- .../lens/public/indexpattern_datasource/indexpattern.tsx | 2 +- .../definitions/formula/editor/math_completion.ts | 5 ++++- .../operations/definitions/ranges/ranges.test.tsx | 2 +- x-pack/plugins/lens/public/plugin.ts | 9 +++------ .../components/builder/entry_renderer.stories.tsx | 1 - .../components/builder/entry_renderer.test.tsx | 2 +- .../public/common/components/query_bar/index.test.tsx | 4 ++-- .../components/timeline/query_bar/index.test.tsx | 4 ++-- 34 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/plugins/controls/public/services/kibana/unified_search.ts b/src/plugins/controls/public/services/kibana/unified_search.ts index 2a5df712c403d..15cb3a02ca45e 100644 --- a/src/plugins/controls/public/services/kibana/unified_search.ts +++ b/src/plugins/controls/public/services/kibana/unified_search.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ +import { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; import { ControlsUnifiedSearchService } from '../unified_search'; import { ControlsPluginStartDeps } from '../../types'; -import { KibanaPluginServiceFactory } from '../../../../presentation_util/public'; export type UnifiedSearchServiceFactory = KibanaPluginServiceFactory< ControlsUnifiedSearchService, diff --git a/src/plugins/controls/public/services/storybook/unified_search.ts b/src/plugins/controls/public/services/storybook/unified_search.ts index 2ea6f23588c5a..cb7df1bd1e483 100644 --- a/src/plugins/controls/public/services/storybook/unified_search.ts +++ b/src/plugins/controls/public/services/storybook/unified_search.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { PluginServiceFactory } from '../../../../presentation_util/public'; -import { DataViewField } from '../../../../data_views/common'; +import { PluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import { DataViewField } from '@kbn/data-views-plugin/common'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { ControlsUnifiedSearchService } from '../unified_search'; -import { UnifiedSearchPublicPluginStart } from '../../../../unified_search/public'; let valueSuggestionMethod = ({ field, query }: { field: DataViewField; query: string }) => Promise.resolve(['storybook', 'default', 'values']); diff --git a/src/plugins/controls/public/services/unified_search.ts b/src/plugins/controls/public/services/unified_search.ts index c88c7d1284384..2c69537b62d65 100644 --- a/src/plugins/controls/public/services/unified_search.ts +++ b/src/plugins/controls/public/services/unified_search.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { UnifiedSearchPublicPluginStart } from '../../../unified_search/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; export interface ControlsUnifiedSearchService { autocomplete: UnifiedSearchPublicPluginStart['autocomplete']; diff --git a/src/plugins/controls/public/types.ts b/src/plugins/controls/public/types.ts index 1f76293ca3d77..ca3b2538b45e4 100644 --- a/src/plugins/controls/public/types.ts +++ b/src/plugins/controls/public/types.ts @@ -17,8 +17,8 @@ import { } from '@kbn/embeddable-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { DataView, DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { ControlInput } from '../common/types'; -import { UnifiedSearchPublicPluginStart } from '../../unified_search/public'; import { ControlsService } from './services/controls'; export interface CommonControlOutput { diff --git a/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts index 5030a31e72d4a..7ed1ace5dbde9 100644 --- a/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts +++ b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts @@ -15,11 +15,11 @@ import { Observable } from 'rxjs'; import { CoreSetup, ElasticsearchClient } from '@kbn/core/server'; import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; import { FieldSpec, getFieldSubtypeNested } from '@kbn/data-views-plugin/common'; +import { PluginSetup as UnifiedSearchPluginSetup } from '@kbn/unified-search-plugin/server'; import { OptionsListRequestBody, OptionsListResponse, } from '../../../common/control_types/options_list/types'; -import { PluginSetup as UnifiedSearchPluginSetup } from '../../../../unified_search/server'; export const setupOptionsListSuggestionsRoute = ( { http }: CoreSetup, diff --git a/src/plugins/controls/server/plugin.ts b/src/plugins/controls/server/plugin.ts index 7179442ce106c..cbe9d39234361 100644 --- a/src/plugins/controls/server/plugin.ts +++ b/src/plugins/controls/server/plugin.ts @@ -8,9 +8,9 @@ import { CoreSetup, Plugin } from '@kbn/core/server'; -import { PluginSetup as UnifiedSearchSetup } from '../../unified_search/server'; import { EmbeddableSetup } from '@kbn/embeddable-plugin/server'; import { PluginSetup as DataSetup } from '@kbn/data-plugin/server'; +import { PluginSetup as UnifiedSearchSetup } from '@kbn/unified-search-plugin/server'; import { setupOptionsListSuggestionsRoute } from './control_types/options_list/options_list_suggestions_route'; import { controlGroupContainerPersistableStateServiceFactory } from './control_group/control_group_container_factory'; import { optionsListPersistableStateServiceFactory } from './control_types/options_list/options_list_embeddable_factory'; diff --git a/src/plugins/input_control_vis/public/plugin.ts b/src/plugins/input_control_vis/public/plugin.ts index b65f6c2165ad2..f1f3cf609d728 100644 --- a/src/plugins/input_control_vis/public/plugin.ts +++ b/src/plugins/input_control_vis/public/plugin.ts @@ -9,7 +9,10 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { UnifiedSearchPublicPluginStart, UnifiedSearchPluginSetup } from '@kbn/unified-search-plugin/public'; +import { + UnifiedSearchPublicPluginStart, + UnifiedSearchPluginSetup, +} from '@kbn/unified-search-plugin/public'; import { Plugin as ExpressionsPublicPlugin } from '@kbn/expressions-plugin/public'; import { VisualizationsSetup, VisualizationsStart } from '@kbn/visualizations-plugin/public'; import { createInputControlVisFn } from './input_control_fn'; diff --git a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx index e57188312a836..b9e372568d4aa 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx @@ -16,7 +16,8 @@ import { KqlQuerySuggestionProvider } from './types'; const keywordComparator = (first: IFieldType, second: IFieldType) => { const extensions = ['raw', 'keyword']; if (extensions.map((ext) => `${first.name}.${ext}`).includes(second.name)) { - return 1;`` + return 1; + ``; } else if (extensions.map((ext) => `${second.name}.${ext}`).includes(first.name)) { return -1; } diff --git a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts index 6bb3244314a11..1002863fec7f4 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/index.ts @@ -15,7 +15,11 @@ import { setupGetValueSuggestions } from './value'; import { setupGetOperatorSuggestions } from './operator'; import { setupGetConjunctionSuggestions } from './conjunction'; import { UnifiedSearchPublicPluginStart } from '../../../types'; -import { QuerySuggestion, QuerySuggestionGetFnArgs, QuerySuggestionGetFn } from '../query_suggestion_provider' +import { + QuerySuggestion, + QuerySuggestionGetFnArgs, + QuerySuggestionGetFn, +} from '../query_suggestion_provider'; const cursorSymbol = '@kuery-cursor@'; diff --git a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts index df9999ee09c79..06b0fc9639a3c 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts @@ -8,9 +8,9 @@ import { flatten } from 'lodash'; import { CoreSetup } from '@kbn/core/public'; +import { IFieldType, IIndexPattern } from '@kbn/data-plugin/public'; import { escapeQuotes } from './lib/escape_kuery'; import { KqlQuerySuggestionProvider } from './types'; -import { IFieldType, IIndexPattern } from '@kbn/data-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '../../../types'; import { QuerySuggestion, QuerySuggestionTypes } from '../query_suggestion_provider'; diff --git a/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts index 0d5bca75edc41..056fcb716054a 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { ValueSuggestionsMethod } from '../../../../data/common'; -import { IFieldType, IIndexPattern } from '../../../../data/common'; +import { ValueSuggestionsMethod } from '@kbn/data-plugin/common'; +import { IFieldType, IIndexPattern } from '@kbn/data-plugin/common'; export enum QuerySuggestionTypes { Field = 'field', diff --git a/src/plugins/unified_search/public/plugin.ts b/src/plugins/unified_search/public/plugin.ts index 23dc6bfda0a4f..93f1aaf19fae8 100755 --- a/src/plugins/unified_search/public/plugin.ts +++ b/src/plugins/unified_search/public/plugin.ts @@ -17,11 +17,11 @@ import { setIndexPatterns, setTheme, setOverlays, setAutocomplete } from './serv import { AutocompleteService } from './autocomplete'; import { createSearchBar } from './search_bar'; import { createIndexPatternSelect } from './index_pattern_select'; -import type { +import type { UnifiedSearchStartDependencies, UnifiedSearchSetupDependencies, UnifiedSearchPluginSetup, - UnifiedSearchPublicPluginStart + UnifiedSearchPublicPluginStart, } from './types'; import { createFilterAction } from './actions/apply_filter_action'; import { ACTION_GLOBAL_APPLY_FILTER } from './actions'; diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx index fa1096e76b221..b4eed13da7f58 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.test.tsx @@ -28,8 +28,8 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { stubIndexPattern } from '@kbn/data-plugin/public/stubs'; import { KibanaContextProvider, withKibana } from '@kbn/kibana-react-plugin/public'; -import { setAutocomplete } from '../../../unified_search/public/services'; -import { unifiedSearchPluginMock } from '../../../unified_search/public/mocks'; +import { setAutocomplete } from '../services'; +import { unifiedSearchPluginMock } from '../mocks'; jest.useFakeTimers(); diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx index 7ca388b591c3c..a9f4127809ab7 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx @@ -28,11 +28,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { compact, debounce, isEqual, isFunction } from 'lodash'; import { Toast } from '@kbn/core/public'; -import { - IDataPluginServices, - Query, - getQueryLog, -} from '@kbn/data-plugin/public'; +import { IDataPluginServices, Query, getQueryLog } from '@kbn/data-plugin/public'; import { DataView } from '@kbn/data-views-plugin/public'; import type { PersistedLog } from '@kbn/data-plugin/public'; import { getFieldSubtypeNested, KIBANA_USER_QUERY_LANGUAGE_KEY } from '@kbn/data-plugin/common'; diff --git a/src/plugins/unified_search/public/services.ts b/src/plugins/unified_search/public/services.ts index 815ca40e8c68c..f67801dd37730 100644 --- a/src/plugins/unified_search/public/services.ts +++ b/src/plugins/unified_search/public/services.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { AutocompleteStart } from '../public'; import { ThemeServiceStart, OverlayStart } from '@kbn/core/public'; import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; import { DataViewsContract } from '@kbn/data-views-plugin/public'; +import { AutocompleteStart } from '.'; export const [getIndexPatterns, setIndexPatterns] = createGetterSetter('IndexPatterns'); diff --git a/src/plugins/unified_search/public/types.ts b/src/plugins/unified_search/public/types.ts index 3d842cc311358..29cf59f41a871 100755 --- a/src/plugins/unified_search/public/types.ts +++ b/src/plugins/unified_search/public/types.ts @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; -import { UsageCollectionSetup } from '../../usage_collection/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { IndexPatternSelectProps, StatefulSearchBarProps } from './index'; +import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; +import type { IndexPatternSelectProps, StatefulSearchBarProps } from '.'; export interface UnifiedSearchSetupDependencies { uiActions: UiActionsSetup; diff --git a/src/plugins/unified_search/server/autocomplete/terms_agg.ts b/src/plugins/unified_search/server/autocomplete/terms_agg.ts index 35d0eba106f46..ffdaca8caad4b 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_agg.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_agg.ts @@ -9,8 +9,8 @@ import { get, map } from 'lodash'; import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { IFieldType, getFieldSubtypeNested } from '@kbn/data-plugin/common'; import { ConfigSchema } from '../../config'; -import { IFieldType, getFieldSubtypeNested } from '../../../data/common'; import { findIndexPatternById, getFieldByName } from '../data_views'; export async function termsAggSuggestions( diff --git a/src/plugins/unified_search/server/autocomplete/terms_enum.ts b/src/plugins/unified_search/server/autocomplete/terms_enum.ts index d99a3c6a38d60..924b5b3a1671e 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_enum.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_enum.ts @@ -8,7 +8,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IFieldType } from '../../../data/common'; +import { IFieldType } from '@kbn/data-plugin/common'; import { findIndexPatternById, getFieldByName } from '../data_views'; import { ConfigSchema } from '../../config'; diff --git a/src/plugins/unified_search/server/config_deprecations.test.ts b/src/plugins/unified_search/server/config_deprecations.test.ts index f90c41086a657..8c65acfae6291 100644 --- a/src/plugins/unified_search/server/config_deprecations.test.ts +++ b/src/plugins/unified_search/server/config_deprecations.test.ts @@ -9,7 +9,7 @@ import { cloneDeep } from 'lodash'; import { applyDeprecations, configDeprecationFactory } from '@kbn/config'; -import { configDeprecationsMock } from '../../../core/server/mocks'; +import { configDeprecationsMock } from '@kbn/core/server/mocks'; import { autocompleteConfigDeprecationProvider } from './config_deprecations'; diff --git a/src/plugins/unified_search/server/config_deprecations.ts b/src/plugins/unified_search/server/config_deprecations.ts index 59c6a20fd93a7..de083caffad09 100644 --- a/src/plugins/unified_search/server/config_deprecations.ts +++ b/src/plugins/unified_search/server/config_deprecations.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { ConfigDeprecationProvider } from 'src/core/server'; +import type { ConfigDeprecationProvider } from '@kbn/core/server'; export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = ({ renameFromRoot, diff --git a/src/plugins/unified_search/server/data_views/index.ts b/src/plugins/unified_search/server/data_views/index.ts index 91a61f4bcb7db..dfe03378f0278 100644 --- a/src/plugins/unified_search/server/data_views/index.ts +++ b/src/plugins/unified_search/server/data_views/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export * from '../../../data_views/server'; +export * from '@kbn/data-views-plugin/server'; diff --git a/src/plugins/unified_search/server/index.ts b/src/plugins/unified_search/server/index.ts index 6338be59a7793..d1948f32e2fe9 100644 --- a/src/plugins/unified_search/server/index.ts +++ b/src/plugins/unified_search/server/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { PluginConfigDescriptor, PluginInitializerContext } from '../../../core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import { ConfigSchema, configSchema } from '../config'; import { UnifiedSearchServerPlugin, diff --git a/src/plugins/unified_search/server/plugin.ts b/src/plugins/unified_search/server/plugin.ts index 9d6fc62b9e207..6328eeba2f416 100644 --- a/src/plugins/unified_search/server/plugin.ts +++ b/src/plugins/unified_search/server/plugin.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '../../../core/server'; +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; import { ConfigSchema } from '../config'; import { AutocompleteService } from './autocomplete'; import { AutocompleteSetup } from './autocomplete/autocomplete_service'; diff --git a/x-pack/plugins/fleet/public/plugin.ts b/x-pack/plugins/fleet/public/plugin.ts index 8ee5f4b504f33..668efc9271b28 100644 --- a/x-pack/plugins/fleet/public/plugin.ts +++ b/x-pack/plugins/fleet/public/plugin.ts @@ -43,6 +43,7 @@ import type { CloudSetup } from '@kbn/cloud-plugin/public'; import type { GlobalSearchPluginSetup } from '@kbn/global-search-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; + import { PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx index e014c5c26a699..4f20db3004e8b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.tsx @@ -9,8 +9,8 @@ import React, { memo, useMemo } from 'react'; import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from '@kbn/core/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { DatasourceDimensionTriggerProps, DatasourceDimensionEditorProps } from '../../types'; import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; +import { DatasourceDimensionTriggerProps, DatasourceDimensionEditorProps } from '../../types'; import { GenericIndexPatternColumn } from '../indexpattern'; import { isColumnInvalid } from '../utils'; import { IndexPatternPrivateState } from '../types'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts index b12a7e134af89..412f8211844b2 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { UnifiedSearchPublicPluginStart } from '../../../../../../../src/plugins/unified_search/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { IndexPatternDimensionEditorProps } from '../dimension_panel'; import { onDrop } from './on_drop_handler'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx index 7c8d7a37f499d..b72519c2191be 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx @@ -20,6 +20,7 @@ import { DataPublicPluginStart, ES_FIELD_TYPES } from '@kbn/data-plugin/public'; import { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public'; import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { DatasourceDimensionEditorProps, DatasourceDimensionTriggerProps, @@ -69,7 +70,6 @@ import { IndexPatternPersistedState, IndexPattern, } from './types'; -import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { mergeLayer } from './state_helpers'; import { Datasource, StateSetter, VisualizeEditorContext } from '../types'; import { deleteColumn, isReferenced } from './operations'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts index 83ffa3178d1a7..a1b629be9c134 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/math_completion.ts @@ -16,7 +16,10 @@ import { TinymathVariable, TinymathNamedArgument, } from '@kbn/tinymath'; -import type { UnifiedSearchPublicPluginStart, QuerySuggestion } from '@kbn/unified-search-plugin/public'; +import type { + UnifiedSearchPublicPluginStart, + QuerySuggestion, +} from '@kbn/unified-search-plugin/public'; import { parseTimeShift } from '@kbn/data-plugin/common'; import { IndexPattern } from '../../../../types'; import { memoizedGetAvailableOperationsByMetadata } from '../../../operations'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx index 9fce05deea9c1..5f882a3ec2112 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx @@ -14,7 +14,7 @@ import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import type { IndexPatternLayer, IndexPattern } from '../../../types'; -import { rangeOperation } from '../index'; +import { rangeOperation } from '..'; import { RangeIndexPatternColumn } from './ranges'; import { MODES, diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index fbac9cbeafff6..b39c14cd82454 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -12,13 +12,9 @@ import type { UsageCollectionSetup, UsageCollectionStart, } from '@kbn/usage-collection-plugin/public'; -import type { UnifiedSearchPublicPluginStart } from '../../../../src/plugins/unified_search/public'; import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { - EmbeddableSetup, - EmbeddableStart, -} from '@kbn/embeddable-plugin/public'; -import { CONTEXT_MENU_TRIGGER} from '@kbn/embeddable-plugin/public'; +import type { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; +import { CONTEXT_MENU_TRIGGER } from '@kbn/embeddable-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; @@ -46,6 +42,7 @@ import { import { VISUALIZE_EDITOR_TRIGGER } from '@kbn/visualizations-plugin/public'; import { createStartServicesGetter } from '@kbn/kibana-utils-plugin/public'; import type { DiscoverSetup, DiscoverStart } from '@kbn/discover-plugin/public'; +import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { EditorFrameService as EditorFrameServiceType } from './editor_frame_service'; import type { IndexPatternDatasource as IndexPatternDatasourceType, diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx index dfbd0a3c2af08..2fbc89e719eb1 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx @@ -13,7 +13,6 @@ import { ListOperatorEnum as OperatorEnum, ListOperatorTypeEnum as OperatorTypeEnum, } from '@kbn/securitysolution-io-ts-list-types'; - import type { AutocompleteStart } from '@kbn/unified-search-plugin/public'; import { fields } from '@kbn/data-plugin/common/mocks'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index 69a9432b155e6..d0d931387f0e4 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -26,8 +26,8 @@ import { fields, getField } from '@kbn/data-plugin/common/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { waitFor } from '@testing-library/dom'; import { ReactWrapper, mount } from 'enzyme'; -import { getFoundListSchemaMock } from '../../../../common/schemas/response/found_list_schema.mock'; +import { getFoundListSchemaMock } from '../../../../common/schemas/response/found_list_schema.mock'; import { BuilderEntryItem } from './entry_renderer'; diff --git a/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx index d1dbd14e8c259..2d38f72b338ee 100644 --- a/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx @@ -14,8 +14,8 @@ import { TestProviders, mockIndexPattern } from '../../mock'; import { FilterManager } from '@kbn/data-plugin/public'; import { SearchBar } from '@kbn/unified-search-plugin/public'; import { QueryBar, QueryBarComponentProps } from '.'; -import { setAutocomplete } from '../../../../../../../src/plugins/unified_search/public/services'; -import { unifiedSearchPluginMock } from '../../../../../../../src/plugins/unified_search/public/mocks'; +import { setAutocomplete } from '@kbn/unified-search-plugin/public/services'; +import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; const mockUiSettingsForFilterManager = coreMock.createStart().uiSettings; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx index 3287c55187a83..b301703f3cae2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx @@ -18,8 +18,8 @@ import { FilterStateStore } from '@kbn/es-query'; import { FilterManager } from '@kbn/data-plugin/public'; import { mockDataProviders } from '../data_providers/mock/mock_data_providers'; import { buildGlobalQuery } from '../helpers'; -import { setAutocomplete } from '../../../../../../../../src/plugins/unified_search/public/services'; -import { unifiedSearchPluginMock } from '../../../../../../../../src/plugins/unified_search/public/mocks'; +import { setAutocomplete } from '@kbn/unified-search-plugin/public/services'; +import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { QueryBarTimeline, From d40927178537df8fb935cfadd70f291da6d7175b Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Mon, 18 Apr 2022 15:17:43 +0500 Subject: [PATCH 12/13] fix Linting --- .../public/autocomplete/providers/kql_query_suggestion/field.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx index b9e372568d4aa..139405f6af9f4 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx +++ b/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx @@ -17,7 +17,6 @@ const keywordComparator = (first: IFieldType, second: IFieldType) => { const extensions = ['raw', 'keyword']; if (extensions.map((ext) => `${first.name}.${ext}`).includes(second.name)) { return 1; - ``; } else if (extensions.map((ext) => `${second.name}.${ext}`).includes(first.name)) { return -1; } From bc59a0fe345c95c5cc06e079d32f5b8e3a64b320 Mon Sep 17 00:00:00 2001 From: Nodir Latipov Date: Wed, 20 Apr 2022 23:11:54 +0500 Subject: [PATCH 13/13] fix functional_with_es_ssl test --- x-pack/plugins/uptime/kibana.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index bb9e48102dcfc..715a497ef79aa 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -18,7 +18,8 @@ "share", "taskManager", "triggersActionsUi", - "usageCollection" + "usageCollection", + "unifiedSearch" ], "server": true, "ui": true,