-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Reporting] Use ES plugin from NP #56209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7b8cdb2
a1f95bc
7c529b5
a5eef5b
5cd44fd
b7f4ad6
c1ef352
83e6dd1
f68ffa6
e60cebe
1d7fc29
bf5ebbc
d2dc904
9398e43
9e8bb6f
f4baa0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| */ | ||
|
|
||
| import * as Rx from 'rxjs'; | ||
| import { ElasticsearchServiceSetup } from 'kibana/server'; | ||
| import { catchError, map, mergeMap, takeUntil } from 'rxjs/operators'; | ||
|
Comment on lines
7
to
9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: |
||
| import { | ||
| ServerFacade, | ||
|
|
@@ -28,6 +29,7 @@ type QueuedPdfExecutorFactory = ExecuteJobFactory<ESQueueWorkerExecuteFn<JobDocP | |
|
|
||
| export const executeJobFactory: QueuedPdfExecutorFactory = function executeJobFactoryFn( | ||
| server: ServerFacade, | ||
| elasticsearch: ElasticsearchServiceSetup, | ||
| parentLogger: Logger, | ||
| { browserDriverFactory }: { browserDriverFactory: HeadlessChromiumDriverFactory } | ||
| ) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,12 +12,7 @@ import { PluginStart as DataPluginStart } from '../../../../src/plugins/data/ser | |
| import { PluginSetupContract as SecurityPluginSetup } from '../../../plugins/security/server'; | ||
| import { PLUGIN_ID, UI_SETTINGS_CUSTOM_PDF_LOGO } from './common/constants'; | ||
| import { config as reportingConfig } from './config'; | ||
| import { | ||
| LegacySetup, | ||
| ReportingPlugin, | ||
| reportingPluginFactory, | ||
| ReportingSetupDeps, | ||
| } from './server/plugin'; | ||
| import { LegacySetup, ReportingPlugin, reportingPluginFactory } from './server/plugin'; | ||
| import { ReportingConfigOptions, ReportingPluginSpecOptions } from './types.d'; | ||
|
|
||
| const kbToBase64Length = (kb: number) => { | ||
|
|
@@ -74,10 +69,6 @@ export const reporting = (kibana: any) => { | |
|
|
||
| async init(server: Legacy.Server) { | ||
| const coreSetup = server.newPlatform.setup.core; | ||
| const pluginsSetup: ReportingSetupDeps = { | ||
| security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, | ||
| usageCollection: server.newPlatform.setup.plugins.usageCollection, | ||
| }; | ||
|
|
||
| const fieldFormatServiceFactory = async (uiSettings: IUiSettingsClient) => { | ||
| const [, plugins] = await coreSetup.getStartServices(); | ||
|
|
@@ -90,18 +81,22 @@ export const reporting = (kibana: any) => { | |
| config: server.config, | ||
| info: server.info, | ||
| route: server.route.bind(server), | ||
| plugins: { | ||
| elasticsearch: server.plugins.elasticsearch, | ||
| xpack_main: server.plugins.xpack_main, | ||
| }, | ||
| plugins: { xpack_main: server.plugins.xpack_main }, | ||
| savedObjects: server.savedObjects, | ||
| fieldFormatServiceFactory, | ||
| uiSettingsServiceFactory: server.uiSettingsServiceFactory, | ||
| }; | ||
|
|
||
| const initializerContext = server.newPlatform.coreContext; | ||
| const plugin: ReportingPlugin = reportingPluginFactory(initializerContext, __LEGACY, this); | ||
| await plugin.setup(coreSetup, pluginsSetup); | ||
| const plugin: ReportingPlugin = reportingPluginFactory( | ||
| server.newPlatform.coreContext, | ||
| __LEGACY, | ||
| this | ||
| ); | ||
| await plugin.setup(coreSetup, { | ||
| elasticsearch: coreSetup.elasticsearch, | ||
| security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, | ||
| usageCollection: server.newPlatform.setup.plugins.usageCollection, | ||
| }); | ||
|
Comment on lines
+95
to
+99
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant parameters:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The params are forced to fit the |
||
| }, | ||
|
|
||
| deprecations({ unused }: any) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's recommended to use the provided mocks when mocking core services. (multiple occurences, will comment only once)