Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uiActions] pass trigger into action handlers #71675

Closed
wants to merge 11 commits into from

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Jul 14, 2020

Summary

Partially addresses #63854.

Trigger now passed into action's execution handlers.
This allows to check inside the action which trigger fired the execution.
later can be extended with disabledActions use case described here: #63854

Implemented as an enhancement that no changes to existing consumer required.
To access trigger, need to wrap Context type with an ActionExecutionContext wrapper type

regular usage, as before:

execute: async (context: Context) => {

},

If need to get access to trigger:

execute: async (context: ActionExecutionContext<Context>) => {
  context?.trigger // trigger is passed here if available
},

Checklist

Delete any items that are not applicable to this PR.

@Dosant Dosant requested a review from streamich July 14, 2020 15:45
@Dosant Dosant changed the title [uiActions] pass meta with trigger info into execution handlers [uiActions] pass trigger into action handlers Jul 15, 2020
public readonly execute = async (config: Config, context: ActionContext) => {
public readonly execute = async (
config: Config,
context: ActionExecutionContext<ActionContext>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want tot use trigger, we "specify" special type here which is an extension around regular ActionContext

Dosant added 3 commits July 15, 2020 14:55
…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
@Dosant Dosant added Feature:UIActions UI actions. These are client side only, not related to the server side actions.. release_note:skip Skip the PR/issue when compiling release notes Team:AppArch v7.10.0 v8.0.0 labels Jul 16, 2020
@Dosant Dosant marked this pull request as ready for review July 16, 2020 12:15
@Dosant Dosant requested a review from a team as a code owner July 16, 2020 12:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Jul 16, 2020
@Dosant
Copy link
Contributor Author

Dosant commented Jul 20, 2020

@elasticmachine merge upstream

Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ran on Ubuntu/Chrome.

@Dosant
Copy link
Contributor Author

Dosant commented Aug 5, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
embeddable 428.7KB +15.0B 428.7KB
uiActions 212.7KB +2.4KB 210.2KB
total - +2.4KB -

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@Dosant
Copy link
Contributor Author

Dosant commented Aug 6, 2020

Closing in favour of #74363

@Dosant Dosant closed this Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Embedding Embedding content via iFrame Feature:UIActions UI actions. These are client side only, not related to the server side actions.. release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants