forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of elastic#53898
- Loading branch information
Showing
16 changed files
with
152 additions
and
128 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,41 @@ | ||
/* | ||
* 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 { plugin } from './index'; | ||
import { LegacySetup, ReportingSetupDeps, ReportingStartDeps } from './plugin'; | ||
import { PluginSetupContract as SecurityPluginSetup } from '../../../../plugins/security/server'; | ||
import { PluginStart as DataPluginStart } from '../../../../../src/plugins/data/server'; | ||
|
||
const buildLegacyDependencies = (server: Legacy.Server): LegacySetup => ({ | ||
config: server.config, | ||
info: server.info, | ||
route: server.route.bind(server), | ||
plugins: { | ||
elasticsearch: server.plugins.elasticsearch, | ||
xpack_main: server.plugins.xpack_main, | ||
}, | ||
savedObjects: server.savedObjects, | ||
uiSettingsServiceFactory: server.uiSettingsServiceFactory, | ||
}); | ||
|
||
export const legacyInit = async (server: Legacy.Server) => { | ||
const coreSetup = server.newPlatform.setup.core; | ||
const pluginInstance = plugin(server.newPlatform.coreContext as PluginInitializerContext); | ||
|
||
await pluginInstance.setup(coreSetup, { | ||
security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, | ||
usageCollection: server.newPlatform.setup.plugins.usageCollection, | ||
__LEGACY: buildLegacyDependencies(server), | ||
} as ReportingSetupDeps); | ||
|
||
// Schedule to call the "start" hook only after start dependencies are ready | ||
coreSetup.getStartServices().then(([core, plugins]) => | ||
pluginInstance.start(core, { | ||
data: (plugins as any).data as DataPluginStart, | ||
} as ReportingStartDeps) | ||
); | ||
}; |
Oops, something went wrong.