Skip to content

Commit

Permalink
[7.x] Alerting plugin migrate to Kibana platform (#57635) (#57921)
Browse files Browse the repository at this point in the history
* resolved conflicts

* Delete codeowners file

* Revert merge conflicts with old version of utility.ts file
  • Loading branch information
YulNaumenko authored Feb 19, 2020
1 parent 71401c6 commit 2366d0d
Show file tree
Hide file tree
Showing 175 changed files with 2,942 additions and 1,934 deletions.
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"paths": {
"xpack.actions": "plugins/actions",
"xpack.advancedUiActions": "plugins/advanced_ui_actions",
"xpack.alerting": "legacy/plugins/alerting",
"xpack.alerting": "plugins/alerting",
"xpack.triggersActionsUI": "plugins/triggers_actions_ui",
"xpack.apm": ["legacy/plugins/apm", "plugins/apm"],
"xpack.beatsManagement": "legacy/plugins/beats_management",
Expand Down
41 changes: 1 addition & 40 deletions x-pack/legacy/plugins/alerting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Legacy } from 'kibana';
import { Root } from 'joi';
import { init } from './server';
import mappings from './mappings.json';

export {
AlertingPlugin,
AlertsClient,
AlertType,
AlertExecutorOptions,
PluginSetupContract,
PluginStartContract,
} from './server';

export function alerting(kibana: any) {
return new kibana.Plugin({
id: 'alerting',
configPrefix: 'xpack.alerting',
require: ['kibana', 'elasticsearch', 'actions', 'task_manager', 'encryptedSavedObjects'],
isEnabled(config: Legacy.KibanaConfig) {
return (
config.get('xpack.alerting.enabled') === true &&
config.get('xpack.actions.enabled') === true &&
config.get('xpack.encryptedSavedObjects.enabled') === true &&
config.get('xpack.task_manager.enabled') === true
);
},
config(Joi: Root) {
return Joi.object()
.keys({
enabled: Joi.boolean().default(true),
})
.default();
},
init,
uiExports: {
mappings,
},
});
}
export * from './server';

This file was deleted.

This file was deleted.

34 changes: 28 additions & 6 deletions x-pack/legacy/plugins/alerting/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,32 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { AlertsClient as AlertsClientClass } from './alerts_client';
import { Legacy } from 'kibana';
import { Root } from 'joi';
import mappings from './mappings.json';

export type AlertsClient = PublicMethodsOf<AlertsClientClass>;

export { init } from './init';
export { AlertType, AlertingPlugin, AlertExecutorOptions } from './types';
export { PluginSetupContract, PluginStartContract } from './plugin';
export function alerting(kibana: any) {
return new kibana.Plugin({
id: 'alerting',
configPrefix: 'xpack.alerting',
require: ['kibana', 'elasticsearch', 'actions', 'task_manager', 'encryptedSavedObjects'],
isEnabled(config: Legacy.KibanaConfig) {
return (
config.get('xpack.alerting.enabled') === true &&
config.get('xpack.actions.enabled') === true &&
config.get('xpack.encryptedSavedObjects.enabled') === true &&
config.get('xpack.task_manager.enabled') === true
);
},
config(Joi: Root) {
return Joi.object()
.keys({
enabled: Joi.boolean().default(true),
})
.default();
},
uiExports: {
mappings,
},
});
}
28 changes: 0 additions & 28 deletions x-pack/legacy/plugins/alerting/server/init.ts

This file was deleted.

176 changes: 0 additions & 176 deletions x-pack/legacy/plugins/alerting/server/plugin.ts

This file was deleted.

Loading

0 comments on commit 2366d0d

Please sign in to comment.