From 631c24abf44da8c32bc17f81c7bf860c3ab2ffe5 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Thu, 20 Oct 2022 09:15:33 -0500 Subject: [PATCH] [unified search] Query string input uses data views plugin directly instead of via deprecated data plugin reference (#143611) * use data views plugin * remove unneeded dependency * use data views plugin * fix type * type fix * supply dataViews as depedency * supply dataViews as depeden --- .../query_string_input/query_bar_top_row.tsx | 2 ++ .../query_string_input/query_string_input.tsx | 9 +++++-- src/plugins/vis_default_editor/kibana.json | 1 + .../public/components/controls/filter.tsx | 2 ++ .../vis_default_editor/public/types.ts | 2 ++ .../components/query_bar_wrapper.tsx | 1 + .../trace_explorer/trace_search_box/index.tsx | 3 ++- .../fleet/.storybook/context/stubs.tsx | 2 ++ .../fleet/components/search_bar.tsx | 2 ++ .../components/agent_logs/query_bar.tsx | 4 ++-- .../fleet/public/mock/plugin_dependencies.ts | 2 ++ x-pack/plugins/fleet/public/plugin.ts | 2 ++ .../graph/public/components/search_bar.tsx | 2 ++ .../public/pages/logs/stream/page_toolbar.tsx | 13 ++++++++-- .../query_input/query_input.tsx | 4 ++-- .../contexts/kibana/kibana_context.ts | 2 ++ .../exploration_query_bar.tsx | 24 ++++++++++++++++--- .../explorer_query_bar/explorer_query_bar.tsx | 24 ++++++++++++++++--- x-pack/plugins/stack_alerts/kibana.json | 1 + .../geo_containment/query_builder/index.tsx | 7 ++++-- .../alerts/alert_query_bar/query_bar.tsx | 2 ++ .../overview/query_bar/query_bar.tsx | 2 ++ .../public/app/__mocks__/app_dependencies.tsx | 3 +++ .../transform/public/app/app_dependencies.tsx | 2 ++ .../public/app/mount_management_section.ts | 3 ++- .../source_search_bar/source_search_bar.tsx | 2 ++ 26 files changed, 105 insertions(+), 18 deletions(-) diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx index 0780b05778ca0..26b5c1770ee8a 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx @@ -188,6 +188,7 @@ export const QueryBarTopRow = React.memo( notifications, docLinks, http, + dataViews, } = kibana.services; const isQueryLangSelected = props.query && !isOfQueryType(props.query); @@ -550,6 +551,7 @@ export const QueryBarTopRow = React.memo( docLinks, http, uiSettings, + dataViews, }} /> 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 95749ec43ce47..cc4e934b1270e 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 @@ -31,7 +31,11 @@ import { compact, debounce, isEmpty, isEqual, isFunction, partition } from 'loda import { CoreStart, DocLinksStart, Toast } from '@kbn/core/public'; import type { Query } from '@kbn/es-query'; import { DataPublicPluginStart, getQueryLog } from '@kbn/data-plugin/public'; -import { type DataView, DataView as KibanaDataView } from '@kbn/data-views-plugin/public'; +import { + type DataView, + DataView as KibanaDataView, + DataViewsPublicPluginStart, +} 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'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; @@ -61,6 +65,7 @@ export interface QueryStringInputDependencies { http: CoreStart['http']; docLinks: DocLinksStart; uiSettings: CoreStart['uiSettings']; + dataViews: DataViewsPublicPluginStart; } export interface QueryStringInputProps { @@ -196,7 +201,7 @@ export default class QueryStringInputUI extends PureComponent(); const { data, + dataViews, unifiedSearch, usageCollection, storage, @@ -118,6 +119,7 @@ function FilterRow({ size="s" deps={{ data, + dataViews, unifiedSearch, usageCollection, storage, diff --git a/src/plugins/vis_default_editor/public/types.ts b/src/plugins/vis_default_editor/public/types.ts index 3e3d0fbed29f1..2cef7977cd011 100644 --- a/src/plugins/vis_default_editor/public/types.ts +++ b/src/plugins/vis_default_editor/public/types.ts @@ -11,9 +11,11 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import type { AutocompleteStart } from '@kbn/unified-search-plugin/public'; import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; export interface VisDefaultEditorKibanaServices { data: DataPublicPluginStart; + dataViews: DataViewsPublicPluginStart; appName: string; unifiedSearch: { autocomplete: AutocompleteStart; diff --git a/src/plugins/vis_types/timeseries/public/application/components/query_bar_wrapper.tsx b/src/plugins/vis_types/timeseries/public/application/components/query_bar_wrapper.tsx index 05330329105de..c4b2a51afa27b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/query_bar_wrapper.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/query_bar_wrapper.tsx @@ -83,6 +83,7 @@ export function QueryBarWrapper({ docLinks, uiSettings, data, + dataViews, storage, usageCollection, }} diff --git a/x-pack/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx index 9b62ae8e6da89..782197828b098 100644 --- a/x-pack/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx +++ b/x-pack/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx @@ -58,7 +58,7 @@ export function TraceSearchBox({ error, loading, }: Props) { - const { unifiedSearch, core, data } = useApmPluginContext(); + const { unifiedSearch, core, data, dataViews } = useApmPluginContext(); const { notifications, http, docLinks, uiSettings } = core; const { services: { storage }, @@ -153,6 +153,7 @@ export function TraceSearchBox({ docLinks, uiSettings, data, + dataViews, storage, }} /> diff --git a/x-pack/plugins/fleet/.storybook/context/stubs.tsx b/x-pack/plugins/fleet/.storybook/context/stubs.tsx index 092ab680b819f..fd8612aca6611 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' + | 'dataViews' | 'unifiedSearch' | 'deprecations' | 'fatalErrors' @@ -24,6 +25,7 @@ export const stubbedStartServices: StubbedStartServices = { licensing: {} as FleetStartServices['licensing'], storage: {} as FleetStartServices['storage'], data: {} as FleetStartServices['data'], + dataViews: {} as FleetStartServices['dataViews'], unifiedSearch: {} as FleetStartServices['unifiedSearch'], deprecations: {} as FleetStartServices['deprecations'], fatalErrors: {} as FleetStartServices['fatalErrors'], diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx index 6e9aea1d8d2d2..663ebf1aaeb49 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx @@ -45,6 +45,7 @@ export const SearchBar: React.FunctionComponent = ({ }) => { const { data, + dataViews, unifiedSearch, storage, notifications, @@ -131,6 +132,7 @@ export const SearchBar: React.FunctionComponent = ({ docLinks, uiSettings, data, + dataViews, storage, usageCollection, }} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx index 166387780f8cc..684a00eb59e32 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx @@ -28,7 +28,7 @@ export const LogQueryBar: React.FunctionComponent<{ isQueryValid: boolean; onUpdateQuery: (query: string, runQuery?: boolean) => void; }> = memo(({ query, isQueryValid, onUpdateQuery }) => { - const { data, notifications, http, docLinks, uiSettings, unifiedSearch, storage } = + const { data, notifications, http, docLinks, uiSettings, unifiedSearch, storage, dataViews } = useStartServices(); const [indexPatternFields, setIndexPatternFields] = useState(); @@ -81,7 +81,7 @@ export const LogQueryBar: React.FunctionComponent<{ onUpdateQuery(newQuery.query as string, true); }} appName={i18n.translate('xpack.fleet.appTitle', { defaultMessage: 'Fleet' })} - deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }} + deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, dataViews, storage }} /> ); }); diff --git a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts index 3f5ce4a53d1f8..250fb934493c0 100644 --- a/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts +++ b/x-pack/plugins/fleet/public/mock/plugin_dependencies.ts @@ -7,6 +7,7 @@ import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; import { cloudMock } from '@kbn/cloud-plugin/public/mocks'; import { homePluginMock } from '@kbn/home-plugin/public/mocks'; @@ -28,6 +29,7 @@ export const createStartDepsMock = () => { return { licensing: licensingMock.createStart(), data: dataPluginMock.createStartContract(), + dataViews: dataViewPluginMocks.createStartContract(), unifiedSearch: unifiedSearchPluginMock.createStartContract(), navigation: navigationPluginMock.createStartContract(), customIntegrations: customIntegrationsMock.createStart(), diff --git a/x-pack/plugins/fleet/public/plugin.ts b/x-pack/plugins/fleet/public/plugin.ts index 3590a80037b1f..6d41e4073afa0 100644 --- a/x-pack/plugins/fleet/public/plugin.ts +++ b/x-pack/plugins/fleet/public/plugin.ts @@ -37,6 +37,7 @@ import type { import { DEFAULT_APP_CATEGORIES, AppNavLinkStatus } from '@kbn/core/public'; import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; @@ -96,6 +97,7 @@ export interface FleetSetupDeps { export interface FleetStartDeps { licensing: LicensingPluginStart; data: DataPublicPluginStart; + dataViews: DataViewsPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; navigation: NavigationPublicPluginStart; customIntegrations: CustomIntegrationsStart; diff --git a/x-pack/plugins/graph/public/components/search_bar.tsx b/x-pack/plugins/graph/public/components/search_bar.tsx index 28e5c5a8337e8..c3e846adffbd3 100644 --- a/x-pack/plugins/graph/public/components/search_bar.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.tsx @@ -103,6 +103,7 @@ export function SearchBarComponent(props: SearchBarStateProps & SearchBarProps) appName, unifiedSearch, data, + dataViews, storage, notifications, http, @@ -176,6 +177,7 @@ export function SearchBarComponent(props: SearchBarStateProps & SearchBarProps) deps={{ unifiedSearch, data, + dataViews, storage, notifications, http, diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx index 440edcbdd6c0e..210def8f8844c 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx @@ -32,7 +32,7 @@ export const LogsToolbar = () => { const { filterQueryDraft, isFilterQueryDraftValid, applyLogFilterQuery, setLogFilterQueryDraft } = useLogFilterStateContext(); const { setSurroundingLogsId } = useLogEntryFlyoutContext(); - const { http, notifications, docLinks, uiSettings, data, storage, unifiedSearch } = + const { http, notifications, docLinks, uiSettings, data, dataViews, storage, unifiedSearch } = useKibanaContextForPlugin().services; const { @@ -77,7 +77,16 @@ export const LogsToolbar = () => { appName={i18n.translate('xpack.infra.appName', { defaultMessage: 'Infra logs', })} - deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }} + deps={{ + unifiedSearch, + notifications, + http, + docLinks, + uiSettings, + data, + dataViews, + storage, + }} /> diff --git a/x-pack/plugins/lens/public/shared_components/query_input/query_input.tsx b/x-pack/plugins/lens/public/shared_components/query_input/query_input.tsx index 487f14312b495..c5cbdebf20fff 100644 --- a/x-pack/plugins/lens/public/shared_components/query_input/query_input.tsx +++ b/x-pack/plugins/lens/public/shared_components/query_input/query_input.tsx @@ -36,7 +36,7 @@ export const QueryInput = ({ const { inputValue, handleInputChange } = useDebouncedValue({ value, onChange }); const lensAppServices = useKibana().services; - const { data, uiSettings, http, notifications, docLinks, storage, unifiedSearch } = + const { data, uiSettings, http, notifications, docLinks, storage, unifiedSearch, dataViews } = lensAppServices; return ( @@ -74,7 +74,7 @@ export const QueryInput = ({ appName={i18n.translate('xpack.lens.queryInput.appName', { defaultMessage: 'Lens', })} - deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }} + deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage, dataViews }} /> ); }; diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts index e17b0d7eff412..5b9e2f7d2ab27 100644 --- a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts +++ b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts @@ -6,6 +6,7 @@ */ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { useKibana, KibanaReactContextValue } from '@kbn/kibana-react-plugin/public'; @@ -27,6 +28,7 @@ import type { MlServicesContext } from '../../app'; interface StartPlugins { data: DataPublicPluginStart; + dataViews: DataViewsPublicPluginStart; security?: SecurityPluginSetup; licenseManagement?: LicenseManagementUIPluginSetup; share: SharePluginStart; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx index 33ab5e72b9fd1..464d57ff2917a 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx @@ -58,8 +58,17 @@ export const ExplorationQueryBar: FC = ({ const [errorMessage, setErrorMessage] = useState(undefined); const { services } = useMlKibana(); - const { unifiedSearch, data, storage, appName, notifications, http, docLinks, uiSettings } = - services; + const { + unifiedSearch, + data, + storage, + appName, + notifications, + http, + docLinks, + uiSettings, + dataViews, + } = services; const searchChangeHandler = (q: Query) => setSearchInput(q); @@ -203,7 +212,16 @@ export const ExplorationQueryBar: FC = ({ dataTestSubj="mlDFAnalyticsQueryInput" languageSwitcherPopoverAnchorPosition="rightDown" appName={appName} - deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }} + deps={{ + unifiedSearch, + notifications, + http, + docLinks, + uiSettings, + data, + storage, + dataViews, + }} /> {filters && filters.options && ( diff --git a/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx b/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx index 90afeb2efb3b1..7c5390b667866 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx +++ b/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx @@ -113,8 +113,17 @@ export const ExplorerQueryBar: FC = ({ }) => { const { anomalyExplorerCommonStateService } = useAnomalyExplorerContext(); const { services } = useMlKibana(); - const { unifiedSearch, data, storage, appName, notifications, http, docLinks, uiSettings } = - services; + const { + unifiedSearch, + data, + storage, + appName, + notifications, + http, + docLinks, + uiSettings, + dataViews, + } = services; // The internal state of the input query bar updated on every key stroke. const [searchInput, setSearchInput] = useState( @@ -171,7 +180,16 @@ export const ExplorerQueryBar: FC = ({ dataTestSubj="explorerQueryInput" languageSwitcherPopoverAnchorPosition="rightDown" appName={appName} - deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }} + deps={{ + unifiedSearch, + notifications, + http, + docLinks, + uiSettings, + data, + storage, + dataViews, + }} /> } isOpen={errorMessage?.query === searchInput.query && errorMessage?.message !== ''} diff --git a/x-pack/plugins/stack_alerts/kibana.json b/x-pack/plugins/stack_alerts/kibana.json index ff436ef53fae7..21ce302c333ee 100644 --- a/x-pack/plugins/stack_alerts/kibana.json +++ b/x-pack/plugins/stack_alerts/kibana.json @@ -15,6 +15,7 @@ "kibanaReact", "savedObjects", "data", + "dataViews", "kibanaUtils" ], "configPath": ["xpack", "stack_alerts"], diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx index 92db8171450f3..d49ee6c15b83a 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx @@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { fromKueryExpression, luceneStringToDsl } from '@kbn/es-query'; import type { RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public'; -import type { DataView } from '@kbn/data-plugin/common'; +import type { DataView, DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { Query } from '@kbn/es-query'; import { QueryStringInput } from '@kbn/unified-search-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; @@ -45,6 +45,7 @@ const DEFAULT_VALUES = { interface KibanaDeps { http: HttpSetup; docLinks: DocLinksStart; + dataViews: DataViewsPublicPluginStart; uiSettings: IUiSettingsClient; notifications: CoreStart['notifications']; storage: IStorageWrapper; @@ -79,7 +80,7 @@ export const GeoContainmentAlertTypeExpression: React.FunctionComponent< boundaryNameField, } = ruleParams; - const { http, docLinks, uiSettings, notifications, storage, usageCollection } = + const { http, docLinks, uiSettings, notifications, storage, usageCollection, dataViews } = useKibana().services; const [indexPattern, _setIndexPattern] = useState({ @@ -226,6 +227,7 @@ export const GeoContainmentAlertTypeExpression: React.FunctionComponent< docLinks, uiSettings, data, + dataViews, storage, usageCollection, }} @@ -281,6 +283,7 @@ export const GeoContainmentAlertTypeExpression: React.FunctionComponent< docLinks, uiSettings, data, + dataViews, storage, usageCollection, }} diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx index f8ed9cb99fb7c..48932b5789743 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx @@ -31,6 +31,7 @@ export const AlertQueryBar = ({ query = '', onChange }: Props) => { docLinks, uiSettings, data, + dataViews, unifiedSearch, storage, usageCollection, @@ -72,6 +73,7 @@ export const AlertQueryBar = ({ query = '', onChange }: Props) => { deps={{ unifiedSearch, data, + dataViews, storage, notifications, http, diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx index 5ca63c2a758e6..139952c5c6302 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx @@ -43,6 +43,7 @@ export const QueryBar = () => { docLinks, uiSettings, data, + dataViews, unifiedSearch, storage, usageCollection, @@ -100,6 +101,7 @@ export const QueryBar = () => { docLinks, uiSettings, data, + dataViews, storage, usageCollection, }} diff --git a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx index 91fb215c814b0..38e7456c5ba7f 100644 --- a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx +++ b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx @@ -11,6 +11,7 @@ import type { ScopedHistory } from '@kbn/core/public'; import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { savedObjectsPluginMock } from '@kbn/saved-objects-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; @@ -25,6 +26,7 @@ import type { GetMlSharedImportsReturnType } from '../../shared_imports'; const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); const dataStart = dataPluginMock.createStartContract(); +const dataViewsStart = dataViewPluginMocks.createStartContract(); // Replace mock to support syntax using `.then()` as used in transform code. coreStart.savedObjects.client.find = jest.fn().mockResolvedValue({ savedObjects: [] }); @@ -33,6 +35,7 @@ const appDependencies: AppDependencies = { application: coreStart.application, chrome: coreStart.chrome, data: dataStart, + dataViews: dataViewsStart, docLinks: coreStart.docLinks, i18n: coreStart.i18n, notifications: coreSetup.notifications, diff --git a/x-pack/plugins/transform/public/app/app_dependencies.tsx b/x-pack/plugins/transform/public/app/app_dependencies.tsx index 4c3d2ededd2c3..e6caef788c59a 100644 --- a/x-pack/plugins/transform/public/app/app_dependencies.tsx +++ b/x-pack/plugins/transform/public/app/app_dependencies.tsx @@ -19,6 +19,7 @@ import type { } from '@kbn/core/public'; import type { SavedObjectsStart as SavedObjectsPluginStart } from '@kbn/saved-objects-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { ScopedHistory } from '@kbn/core/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; @@ -35,6 +36,7 @@ export interface AppDependencies { application: ApplicationStart; chrome: ChromeStart; data: DataPublicPluginStart; + dataViews: DataViewsPublicPluginStart; docLinks: DocLinksStart; http: HttpSetup; i18n: I18nStart; diff --git a/x-pack/plugins/transform/public/app/mount_management_section.ts b/x-pack/plugins/transform/public/app/mount_management_section.ts index d5b4f07c6ff4d..1ba7253f996fa 100644 --- a/x-pack/plugins/transform/public/app/mount_management_section.ts +++ b/x-pack/plugins/transform/public/app/mount_management_section.ts @@ -29,7 +29,7 @@ export async function mountManagementSection( const startServices = await getStartServices(); const [core, plugins] = startServices; const { application, chrome, docLinks, i18n, overlays, theme, savedObjects, uiSettings } = core; - const { data, share, spaces, triggersActionsUi, unifiedSearch } = plugins; + const { data, dataViews, share, spaces, triggersActionsUi, unifiedSearch } = plugins; const { docTitle } = chrome; // Initialize services @@ -42,6 +42,7 @@ export async function mountManagementSection( application, chrome, data, + dataViews, docLinks, http, i18n, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/source_search_bar/source_search_bar.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/source_search_bar/source_search_bar.tsx index dfbfced03b949..c23d6ed475efc 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/source_search_bar/source_search_bar.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/source_search_bar/source_search_bar.tsx @@ -35,6 +35,7 @@ export const SourceSearchBar: FC = ({ dataView, searchBar http, docLinks, data, + dataViews, storage, unifiedSearch, usageCollection, @@ -73,6 +74,7 @@ export const SourceSearchBar: FC = ({ dataView, searchBar docLinks, uiSettings, data, + dataViews, storage, usageCollection, }}