-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting/FieldFormats] expose
setFieldFormats
and call from Repor…
…tingPlugin.start (#56563) (#56875) * [Reporting] New Platform Migration Part of #53898 * fix CI * fix typescript Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
d5a1546
commit 736ed90
Showing
16 changed files
with
174 additions
and
121 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,4 @@ | |
* under the License. | ||
*/ | ||
|
||
export * from './create_getter_setter'; | ||
export * from './create_kibana_utils_core'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { Get, Set, createGetterSetter } from '../common'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { PluginInitializerContext } from 'src/core/server'; | ||
import { ReportingPlugin as Plugin } from './plugin'; | ||
|
||
export const plugin = (context: PluginInitializerContext) => { | ||
return new Plugin(context); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { Legacy } from 'kibana'; | ||
import { PluginInitializerContext } from 'src/core/server'; | ||
import { SecurityPluginSetup } from '../../../../plugins/security/server'; | ||
import { ReportingPluginSpecOptions } from '../types'; | ||
import { plugin } from './index'; | ||
import { LegacySetup, ReportingStartDeps } from './plugin'; | ||
|
||
const buildLegacyDependencies = ( | ||
server: Legacy.Server, | ||
reportingPlugin: ReportingPluginSpecOptions | ||
): LegacySetup => ({ | ||
config: server.config, | ||
info: server.info, | ||
route: server.route.bind(server), | ||
plugins: { | ||
elasticsearch: server.plugins.elasticsearch, | ||
xpack_main: server.plugins.xpack_main, | ||
reporting: reportingPlugin, | ||
}, | ||
savedObjects: server.savedObjects, | ||
uiSettingsServiceFactory: server.uiSettingsServiceFactory, | ||
}); | ||
|
||
export const legacyInit = async ( | ||
server: Legacy.Server, | ||
reportingPlugin: ReportingPluginSpecOptions | ||
) => { | ||
const coreSetup = server.newPlatform.setup.core; | ||
const pluginInstance = plugin(server.newPlatform.coreContext as PluginInitializerContext); | ||
|
||
await pluginInstance.setup(coreSetup, { | ||
elasticsearch: coreSetup.elasticsearch, | ||
security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, | ||
usageCollection: server.newPlatform.setup.plugins.usageCollection, | ||
__LEGACY: buildLegacyDependencies(server, reportingPlugin), | ||
}); | ||
|
||
// Schedule to call the "start" hook only after start dependencies are ready | ||
coreSetup.getStartServices().then(([core, plugins]) => | ||
pluginInstance.start(core, { | ||
data: (plugins as ReportingStartDeps).data, | ||
}) | ||
); | ||
}; |
Oops, something went wrong.