[uiActions] pass trigger into action handlers#71675
Closed
Dosant wants to merge 11 commits intoelastic:masterfrom
Closed
[uiActions] pass trigger into action handlers#71675Dosant wants to merge 11 commits intoelastic:masterfrom
Dosant wants to merge 11 commits intoelastic:masterfrom
Conversation
Dosant
commented
Jul 15, 2020
| public readonly execute = async (config: Config, context: ActionContext) => { | ||
| public readonly execute = async ( | ||
| config: Config, | ||
| context: ActionExecutionContext<ActionContext> |
Contributor
Author
There was a problem hiding this comment.
If we want tot use trigger, we "specify" special type here which is an extension around regular ActionContext
…s-improve-context # Conflicts: # src/plugins/ui_actions/public/actions/action.ts # src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx # src/plugins/ui_actions/public/triggers/trigger_internal.ts
Contributor
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Contributor
Author
|
@elasticmachine merge upstream |
streamich
approved these changes
Jul 22, 2020
Contributor
streamich
left a comment
There was a problem hiding this comment.
LGTM, ran on Ubuntu/Chrome.
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
Contributor
Author
|
Closing in favour of #74363 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partially addresses #63854.
Triggernow passed into action's execution handlers.This allows to check inside the action which trigger fired the execution.
later can be extended with
disabledActionsuse case described here: #63854Implemented as an enhancement that no changes to existing consumer required.
To access
trigger, need to wrapContexttype with anActionExecutionContextwrapper typeregular usage, as before:
If need to get access to trigger:
Checklist
Delete any items that are not applicable to this PR.