diff --git a/src/legacy/core_plugins/kibana/public/discover/build_services.ts b/src/legacy/core_plugins/kibana/public/discover/build_services.ts index 81f1c911f1cc9..6b0d2368cc1a2 100644 --- a/src/legacy/core_plugins/kibana/public/discover/build_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/build_services.ts @@ -30,13 +30,14 @@ import { IndexPatternsContract, DataPublicPluginStart, } from 'src/plugins/data/public'; -import { createSavedSearchesLoader } from './saved_searches'; + import { DiscoverStartPlugins } from './plugin'; import { SharePluginStart } from '../../../../../plugins/share/public'; import { SavedSearch } from './np_ready/types'; import { DocViewsRegistry } from './np_ready/doc_views/doc_views_registry'; import { ChartsPluginStart } from '../../../../../plugins/charts/public'; import { VisualizationsStart } from '../../../visualizations/public'; +import { createSavedSearchesLoader } from '../../../../../plugins/discover/public'; export interface DiscoverServices { addBasePath: (path: string) => string; diff --git a/src/legacy/core_plugins/kibana/public/discover/index.ts b/src/legacy/core_plugins/kibana/public/discover/index.ts index 33b2ad4bf8171..b449b70418d02 100644 --- a/src/legacy/core_plugins/kibana/public/discover/index.ts +++ b/src/legacy/core_plugins/kibana/public/discover/index.ts @@ -20,8 +20,6 @@ import { PluginInitializerContext } from 'kibana/public'; import { DiscoverPlugin } from './plugin'; -export { createSavedSearchesLoader } from './saved_searches/saved_searches'; - // Core will be looking for this when loading our plugin in the new platform export const plugin = (context: PluginInitializerContext) => { return new DiscoverPlugin(); diff --git a/src/legacy/core_plugins/kibana/public/management/saved_object_registry.ts b/src/legacy/core_plugins/kibana/public/management/saved_object_registry.ts index e0756b2e78e25..604575a6e6220 100644 --- a/src/legacy/core_plugins/kibana/public/management/saved_object_registry.ts +++ b/src/legacy/core_plugins/kibana/public/management/saved_object_registry.ts @@ -22,8 +22,8 @@ import { i18n } from '@kbn/i18n'; import { npStart } from 'ui/new_platform'; import { SavedObjectLoader } from '../../../../../plugins/saved_objects/public'; import { createSavedDashboardLoader } from '../dashboard'; -import { createSavedSearchesLoader } from '../discover'; import { TypesService, createSavedVisLoader } from '../../../visualizations/public'; +import { createSavedSearchesLoader } from '../../../../../plugins/discover/public'; /** * This registry is used for the editing mode of Saved Searches, Visualizations, diff --git a/src/legacy/core_plugins/visualizations/public/legacy_imports.ts b/src/legacy/core_plugins/visualizations/public/legacy_imports.ts index 223c130df3505..385117be8ae2e 100644 --- a/src/legacy/core_plugins/visualizations/public/legacy_imports.ts +++ b/src/legacy/core_plugins/visualizations/public/legacy_imports.ts @@ -25,4 +25,4 @@ export { isDateHistogramBucketAggConfig, setBounds, } from '../../data/public'; -export { createSavedSearchesLoader } from '../../kibana/public/discover/saved_searches/'; +export { createSavedSearchesLoader } from '../../../../plugins/discover/public'; diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/saved_visualizations/_saved_vis.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/saved_visualizations/_saved_vis.ts index f3539b3564c56..2458ed5008ddd 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/saved_visualizations/_saved_vis.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/public/saved_visualizations/_saved_vis.ts @@ -34,7 +34,7 @@ import { extractReferences, injectReferences } from './saved_visualization_refer import { IIndexPattern } from '../../../../../../../plugins/data/public'; import { VisSavedObject } from '../types'; import { VisImpl } from '../vis_impl'; -import { createSavedSearchesLoader } from '../../../legacy_imports'; +import { createSavedSearchesLoader } from '../../../../../../../plugins/discover/public'; async function _afterEsResp(savedVis: VisSavedObject, services: any) { await _getLinkedSavedSearch(savedVis, services); diff --git a/src/plugins/discover/public/index.ts b/src/plugins/discover/public/index.ts new file mode 100644 index 0000000000000..2ccfe39748024 --- /dev/null +++ b/src/plugins/discover/public/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { createSavedSearchesLoader } from './saved_searches/saved_searches'; diff --git a/src/legacy/core_plugins/kibana/public/discover/saved_searches/_saved_search.ts b/src/plugins/discover/public/saved_searches/_saved_search.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/saved_searches/_saved_search.ts rename to src/plugins/discover/public/saved_searches/_saved_search.ts index 7bd0eef8c19af..72983b7835eee 100644 --- a/src/legacy/core_plugins/kibana/public/discover/saved_searches/_saved_search.ts +++ b/src/plugins/discover/public/saved_searches/_saved_search.ts @@ -16,11 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -import { - createSavedObjectClass, - SavedObjectKibanaServices, -} from '../../../../../../plugins/saved_objects/public'; +import { createSavedObjectClass, SavedObjectKibanaServices } from '../../../saved_objects/public'; export function createSavedSearchClass(services: SavedObjectKibanaServices) { const SavedObjectClass = createSavedObjectClass(services); diff --git a/src/legacy/core_plugins/kibana/public/discover/saved_searches/index.ts b/src/plugins/discover/public/saved_searches/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/saved_searches/index.ts rename to src/plugins/discover/public/saved_searches/index.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/saved_searches/saved_searches.ts b/src/plugins/discover/public/saved_searches/saved_searches.ts similarity index 92% rename from src/legacy/core_plugins/kibana/public/discover/saved_searches/saved_searches.ts rename to src/plugins/discover/public/saved_searches/saved_searches.ts index ebd341eba99fd..9d815bee41af8 100644 --- a/src/legacy/core_plugins/kibana/public/discover/saved_searches/saved_searches.ts +++ b/src/plugins/discover/public/saved_searches/saved_searches.ts @@ -17,10 +17,7 @@ * under the License. */ -import { - SavedObjectLoader, - SavedObjectKibanaServices, -} from '../../../../../../plugins/saved_objects/public'; +import { SavedObjectLoader, SavedObjectKibanaServices } from '../../../saved_objects/public'; import { createSavedSearchClass } from './_saved_search'; export function createSavedSearchesLoader(services: SavedObjectKibanaServices) { diff --git a/x-pack/legacy/plugins/transform/public/plugin.ts b/x-pack/legacy/plugins/transform/public/plugin.ts index 2e29ecfc19510..d55695f891bb7 100644 --- a/x-pack/legacy/plugins/transform/public/plugin.ts +++ b/x-pack/legacy/plugins/transform/public/plugin.ts @@ -15,7 +15,7 @@ import { documentationLinksService } from './app/services/documentation'; import { httpService } from './app/services/http'; import { textService } from './app/services/text'; import { uiMetricService } from './app/services/ui_metric'; -import { createSavedSearchesLoader } from '../../../../../src/legacy/core_plugins/kibana/public/discover/saved_searches'; +import { createSavedSearchesLoader } from '../../../../../src/plugins/discover/public'; const REACT_ROOT_ID = 'transformReactRoot'; const KBN_MANAGEMENT_SECTION = 'elasticsearch/transform';