Skip to content

Commit

Permalink
cleaned up dependency on TM in other plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Jan 9, 2020
1 parent 3dd94d5 commit 35d55e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
5 changes: 2 additions & 3 deletions x-pack/legacy/plugins/lens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as Joi from 'joi';
import { resolve } from 'path';
import { LegacyPluginInitializer } from 'src/legacy/types';
import KbnServer, { Server } from 'src/legacy/server/kbn_server';
import { CoreStart } from 'kibana/server';
import mappings from './mappings.json';
import { PLUGIN_ID, getEditPath, NOT_INTERNATIONALIZED_PRODUCT_NAME } from './common';
import { lensServerPlugin } from './server';
Expand All @@ -19,7 +18,7 @@ export const lens: LegacyPluginInitializer = kibana => {
id: PLUGIN_ID,
configPrefix: `xpack.${PLUGIN_ID}`,
// task_manager could be required, but is only used for telemetry
require: ['kibana', 'elasticsearch', 'xpack_main', 'interpreter', 'data'],
require: ['kibana', 'elasticsearch', 'xpack_main', 'interpreter', 'data', 'task_manager'],
publicDir: resolve(__dirname, 'public'),

uiExports: {
Expand Down Expand Up @@ -69,7 +68,7 @@ export const lens: LegacyPluginInitializer = kibana => {
taskManager: getTaskManagerSetup(server)!,
});

plugin.start((kbnServer.newPlatform.start.core as unknown) as CoreStart, {
plugin.start(kbnServer.newPlatform.start.core, {
server,
taskManager: getTaskManagerStart(server)!,
});
Expand Down
27 changes: 0 additions & 27 deletions x-pack/legacy/plugins/maps/server/test_utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,3 @@ export const getMockCallWithInternal = (hits = defaultMockSavedObjects) => {
export const getMockTaskFetch = (docs = defaultMockTaskDocs) => {
return () => Promise.resolve({ docs });
};

export const getMockKbnServer = (
mockCallWithInternal = getMockCallWithInternal(),
mockTaskFetch = getMockTaskFetch()
) => ({
plugins: {
elasticsearch: {
getCluster: () => ({
callWithInternalUser: mockCallWithInternal,
}),
},
xpack_main: {},
},
newPlatform: {
start: {
plugins: {
taskManager: {
registerTaskDefinitions: () => undefined,
schedule: () => Promise.resolve(),
fetch: mockTaskFetch,
},
},
},
},
config: () => ({ get: () => '' }),
log: () => undefined,
});

0 comments on commit 35d55e7

Please sign in to comment.