Skip to content

Commit

Permalink
[Discover] Move discover/saved_searches to Kibana platform (elastic#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Feb 27, 2020
1 parent 11df8d6 commit e5a53c9
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/legacy/core_plugins/kibana/public/discover/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export {
isDateHistogramBucketAggConfig,
setBounds,
} from '../../data/public';
export { createSavedSearchesLoader } from '../../kibana/public/discover/saved_searches/';
export { createSavedSearchesLoader } from '../../../../plugins/discover/public';
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 20 additions & 0 deletions src/plugins/discover/public/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/transform/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e5a53c9

Please sign in to comment.