Skip to content

Commit

Permalink
Delete data legacy dependencies plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Oct 27, 2019
1 parent 973d7a1 commit d801397
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 77 deletions.
7 changes: 1 addition & 6 deletions src/legacy/core_plugins/data/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@
*/

import { npSetup, npStart } from 'ui/new_platform';
import { LegacyDependenciesPlugin } from './shim/legacy_dependencies_plugin';
import { plugin } from '.';

const dataPlugin = plugin();
const legacyPlugin = new LegacyDependenciesPlugin();

export const setup = dataPlugin.setup(npSetup.core, {
__LEGACY: legacyPlugin.setup(),
});
export const setup = dataPlugin.setup(npSetup.core);

export const start = dataPlugin.start(npStart.core, {
data: npStart.plugins.data,
uiActions: npSetup.plugins.uiActions,
__LEGACY: legacyPlugin.start(),
});
34 changes: 10 additions & 24 deletions src/legacy/core_plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
*/

import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
import { SearchService, SearchStart, createSearchBar, StatetfulSearchBarProps } from './search';
import { QueryService, QuerySetup } from './query';
import { FilterService, FilterSetup, FilterStart } from './filter';
import { TimefilterService, TimefilterSetup } from './timefilter';
import { IndexPatternsService, IndexPatternsSetup, IndexPatternsStart } from './index_patterns';
import {
LegacyDependenciesPluginSetup,
LegacyDependenciesPluginStart,
} from './shim/legacy_dependencies_plugin';
import { Storage } from '../../../../../src/plugins/kibana_utils/public';
import { DataPublicPluginStart } from '../../../../plugins/data/public';
import { initLegacyModule } from './shim/legacy_module';
import { IUiActionsSetup } from '../../../../plugins/ui_actions/public';
Expand All @@ -36,19 +34,9 @@ import {
} from './filter/action/apply_filter_action';
import { APPLY_FILTER_TRIGGER } from '../../../../plugins/embeddable/public';

/**
* Interface for any dependencies on other plugins' `setup` contracts.
*
* @internal
*/
export interface DataPluginSetupDependencies {
__LEGACY: LegacyDependenciesPluginSetup;
}

export interface DataPluginStartDependencies {
data: DataPublicPluginStart;
uiActions: IUiActionsSetup;
__LEGACY: LegacyDependenciesPluginStart;
}

/**
Expand Down Expand Up @@ -90,9 +78,7 @@ export interface DataStart {
* in the setup/start interfaces. The remaining items exported here are either types,
* or static code.
*/
export class DataPlugin
implements
Plugin<DataSetup, DataStart, DataPluginSetupDependencies, DataPluginStartDependencies> {
export class DataPlugin implements Plugin<DataSetup, DataStart, {}, DataPluginStartDependencies> {
// Exposed services, sorted alphabetically
private readonly filter: FilterService = new FilterService();
private readonly indexPatterns: IndexPatternsService = new IndexPatternsService();
Expand All @@ -101,13 +87,16 @@ export class DataPlugin
private readonly timefilter: TimefilterService = new TimefilterService();

private setupApi!: DataSetup;
private storage!: IStorageWrapper;

public setup(core: CoreSetup, { __LEGACY }: DataPluginSetupDependencies): DataSetup {
public setup(core: CoreSetup): DataSetup {
const { uiSettings } = core;

this.storage = new Storage(window.localStorage);

const timefilterService = this.timefilter.setup({
uiSettings,
storage: __LEGACY.storage,
storage: this.storage,
});
const filterService = this.filter.setup({
uiSettings,
Expand All @@ -122,10 +111,7 @@ export class DataPlugin
return this.setupApi;
}

public start(
core: CoreStart,
{ __LEGACY, data, uiActions }: DataPluginStartDependencies
): DataStart {
public start(core: CoreStart, { data, uiActions }: DataPluginStartDependencies): DataStart {
const { uiSettings, http, notifications, savedObjects } = core;

const indexPatternsService = this.indexPatterns.start({
Expand All @@ -140,7 +126,7 @@ export class DataPlugin
const SearchBar = createSearchBar({
core,
data,
storage: __LEGACY.storage,
storage: this.storage,
timefilter: this.setupApi.timefilter,
filterManager: this.setupApi.filter.filterManager,
});
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions src/plugins/kibana_utils/public/storage/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* under the License.
*/

// This is really silly, but I wasn't prepared to rename the kibana Storage class everywhere it is used
// and this is the only way I could figure out how to use the type definition for a built in object
// in a file that creates a type with the same name as that built in object.
import { IStorage, IStorageWrapper } from './types';

export class Storage implements IStorageWrapper {
Expand Down

0 comments on commit d801397

Please sign in to comment.