import React from 'react' ; import { Plugin , CoreSetup , AppMountParameters } from 'kibana/public' ; import { PluginSetupContract as AlertingSetup } from '../../../../../../plugins/alerting/public' ; import { SanitizedAlert } from '../../../../../../plugins/alerting/common' ; import { TriggersAndActionsUIPublicPluginSetup } from '../../../../../../plugins/triggers_actions_ui/public' ; export type Setup = void ; export type Start = void ; export interface AlertingExamplePublicSetupDeps { alerting : AlertingSetup ; triggersActionsUi : TriggersAndActionsUIPublicPluginSetup ; } export class AlertingFixturePlugin implements Plugin < Setup , Start , AlertingExamplePublicSetupDeps > { public setup ( core , { alerting , triggersActionsUi } ) { alerting . registerNavigation ( 'alerting_fixture' , 'test.noop' , ( alert ) => `/rule/${ alert . id }` ) ; triggersActionsUi . ruleTypeRegistry . register ( { id : 'test.always-firing' , description : 'Always fires' , iconClass : 'alert' , documentationUrl : null , ruleParamsExpression : ( ) => React . createElement ( 'div' , null , 'Test Always Firing' ) , validate : ( ) => { return { errors : { } } ; } , requiresAppContext : false , } ) ; triggersActionsUi . ruleTypeRegistry . register ( { id : 'test.noop' , description : `Doesn't do anything` , iconClass : 'alert' , documentationUrl : null , ruleParamsExpression : ( ) => React . createElement ( 'div' , null , 'Test Noop' ) , validate : ( ) => { return { errors : { } } ; } , requiresAppContext : false , } ) ; core . application . register ( { id : 'alerting_fixture' , title : 'Alerting Fixture App' , async mount ( params ) { const [ coreStart , depsStart ] = await core . getStartServices ( ) ; const { renderApp } = await import ( './application' ) ; return renderApp ( coreStart , depsStart , params ) ; } , } ) ; } public start ( ) { } public stop ( ) { } }