diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx index 621d0aae75dd3..39ce0108a4d41 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx @@ -11,13 +11,7 @@ import { HttpSetup } from '@kbn/core/public'; import { init as initHttpRequests } from './http_requests'; import { mockContextValue } from './app_context.mock'; import { AppContextProvider } from '../../../public/application/app_context'; -import { setHttpClient, setSavedObjectsClient } from '../../../public/application/lib/api'; - -const mockSavedObjectsClient = () => { - return { - find: (_params?: any) => {}, - }; -}; +import { setHttpClient } from '../../../public/application/lib/api'; export const WithAppDependencies = (Component: any, httpSetup: HttpSetup) => (props: Record) => { @@ -31,7 +25,5 @@ export const WithAppDependencies = }; export const setupEnvironment = () => { - setSavedObjectsClient(mockSavedObjectsClient() as any); - return initHttpRequests(); }; diff --git a/x-pack/plugins/watcher/public/application/index.tsx b/x-pack/plugins/watcher/public/application/index.tsx index 4b2b83c35980b..dc12832825b81 100644 --- a/x-pack/plugins/watcher/public/application/index.tsx +++ b/x-pack/plugins/watcher/public/application/index.tsx @@ -8,24 +8,22 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { Observable } from 'rxjs'; -import { SavedObjectsClientContract, CoreTheme } from '@kbn/core/public'; +import { CoreTheme } from '@kbn/core/public'; import { KibanaThemeProvider } from './shared_imports'; import { App, AppDeps } from './app'; -import { setHttpClient, setSavedObjectsClient } from './lib/api'; +import { setHttpClient } from './lib/api'; interface BootDeps extends AppDeps { element: HTMLElement; - savedObjects: SavedObjectsClientContract; I18nContext: any; theme$: Observable; } export const renderApp = (bootDeps: BootDeps) => { - const { I18nContext, element, savedObjects, theme$, ...appDeps } = bootDeps; + const { I18nContext, element, theme$, ...appDeps } = bootDeps; setHttpClient(appDeps.http); - setSavedObjectsClient(savedObjects); render( diff --git a/x-pack/plugins/watcher/public/application/lib/api.ts b/x-pack/plugins/watcher/public/application/lib/api.ts index e514c2d4df5d4..4acfc980aef5f 100644 --- a/x-pack/plugins/watcher/public/application/lib/api.ts +++ b/x-pack/plugins/watcher/public/application/lib/api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { HttpSetup, SavedObjectsClientContract } from '@kbn/core/public'; +import { HttpSetup } from '@kbn/core/public'; import { Settings } from '../models/settings'; import { Watch } from '../models/watch'; @@ -27,14 +27,6 @@ export const getHttpClient = () => { return httpClient; }; -let savedObjectsClient: SavedObjectsClientContract; - -export const setSavedObjectsClient = (aSavedObjectsClient: SavedObjectsClientContract) => { - savedObjectsClient = aSavedObjectsClient; -}; - -export const getSavedObjectsClient = () => savedObjectsClient; - const basePath = ROUTES.API_ROOT; const loadWatchesDeserializer = ({ watches = [] }: { watches: any[] }) => { diff --git a/x-pack/plugins/watcher/public/plugin.ts b/x-pack/plugins/watcher/public/plugin.ts index 4305400a9c951..ef8f36986db9f 100644 --- a/x-pack/plugins/watcher/public/plugin.ts +++ b/x-pack/plugins/watcher/public/plugin.ts @@ -48,7 +48,6 @@ export class WatcherUIPlugin implements Plugin { chrome: { docTitle }, i18n: i18nDep, docLinks, - savedObjects, application, executionContext, } = coreStart; @@ -69,7 +68,6 @@ export class WatcherUIPlugin implements Plugin { docLinks, setBreadcrumbs, theme: charts.theme, - savedObjects: savedObjects.client, I18nContext: i18nDep.Context, createTimeBuckets: () => new TimeBuckets(uiSettings, data), history,