mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Local actions (#57451)
* feat: 🎸 create UiActionsService * feat: 🎸 add UiActionsServvice.fork() method * feat: 🎸 instantiate UiActionsService in plugin * feat: 🎸 add UiActionsService.registerTrigger(), remove old * feat: 🎸 move attach/detachAction() methods to UiActionsService * refactor: 💡 move remaining actions API to UiActionsService * chore: 🤖 clean up /trigger folder * test: 💍 move registry tests into UiActiosnService tests * fix: 🐛 fix TypeScript typecheck errors * test: 💍 add .fork() trigger tests * feat: 🎸 remove actionIds from ui_actions Trigger interface * fix: 🐛 remove usage of actionIds * fix: 🐛 attach hello world action to trigger in plugin lifecycle * feat: 🎸 fork also trigger to action attachments * fix: 🐛 clear mapping registry in .clear(), improve type
This commit is contained in:
parent
9388ff7b43
commit
ca5e25c139
36 changed files with 764 additions and 734 deletions
|
@ -18,11 +18,9 @@
|
|||
*/
|
||||
|
||||
import { Trigger } from '../../../src/plugins/ui_actions/public';
|
||||
import { HELLO_WORLD_ACTION_TYPE } from './hello_world_action';
|
||||
|
||||
export const HELLO_WORLD_TRIGGER_ID = 'HELLO_WORLD_TRIGGER_ID';
|
||||
|
||||
export const helloWorldTrigger: Trigger = {
|
||||
id: HELLO_WORLD_TRIGGER_ID,
|
||||
actionIds: [HELLO_WORLD_ACTION_TYPE],
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public';
|
||||
import { UiActionsSetup, UiActionsStart } from '../../../src/plugins/ui_actions/public';
|
||||
import { createHelloWorldAction } from './hello_world_action';
|
||||
import { createHelloWorldAction, HELLO_WORLD_ACTION_TYPE } from './hello_world_action';
|
||||
import { helloWorldTrigger } from './hello_world_trigger';
|
||||
|
||||
interface UiActionExamplesSetupDependencies {
|
||||
|
@ -33,8 +33,9 @@ interface UiActionExamplesStartDependencies {
|
|||
export class UiActionExamplesPlugin
|
||||
implements
|
||||
Plugin<void, void, UiActionExamplesSetupDependencies, UiActionExamplesStartDependencies> {
|
||||
public setup(core: CoreSetup, deps: UiActionExamplesSetupDependencies) {
|
||||
deps.uiActions.registerTrigger(helloWorldTrigger);
|
||||
public setup(core: CoreSetup, { uiActions }: UiActionExamplesSetupDependencies) {
|
||||
uiActions.registerTrigger(helloWorldTrigger);
|
||||
uiActions.attachAction(helloWorldTrigger.id, HELLO_WORLD_ACTION_TYPE);
|
||||
}
|
||||
|
||||
public start(coreStart: CoreStart, deps: UiActionExamplesStartDependencies) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue