Skip to content

Decouple actions from embeddables: step 1#44503

Merged
stacey-gammon merged 5 commits intoelastic:masterfrom
stacey-gammon:2019-08-30-decouple-action-embeds
Sep 5, 2019
Merged

Decouple actions from embeddables: step 1#44503
stacey-gammon merged 5 commits intoelastic:masterfrom
stacey-gammon:2019-08-30-decouple-action-embeds

Conversation

@stacey-gammon
Copy link
Copy Markdown

@stacey-gammon stacey-gammon commented Aug 30, 2019

Fixes second part of #40491

Second part will be to pull into a separate plugin.

fixes #44342

Dev Docs

The action interface no longer requires an embeddable and triggerContext to be passed in. The shape of ActionContext is now completely up to the specific action implementation.

Previously:

interface Action<
  TEmbeddable extends IEmbeddable = IEmbeddable,	
  TTriggerContext extends {} = {}
> {
  execute(context: { embeddable: TEmbeddable, triggerContext: TriggerContext });
}

Now:

interface Action<ActionContext extends {} = {}> {
  execute(context: ActionContext);
}

@stacey-gammon stacey-gammon added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:AppArch v7.5.0 v8.0.0 labels Aug 30, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app-arch

@stacey-gammon stacey-gammon added Feature:Embedding Embedding content via iFrame Feature:UIActions UI actions. These are client side only, not related to the server side actions.. labels Aug 30, 2019
@stacey-gammon stacey-gammon force-pushed the 2019-08-30-decouple-action-embeds branch from f378893 to 34a463f Compare August 30, 2019 16:08
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is not recommended to use @ts-ignore, if there is some TypeScript type mismatch you can cast to specific type or cast to any.

(action as any).isCompatible
(action.isCompatible as any)
(action as SomeType).isCompatible

@stacey-gammon stacey-gammon force-pushed the 2019-08-30-decouple-action-embeds branch from 34a463f to 304f791 Compare August 31, 2019 13:00
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@stacey-gammon stacey-gammon force-pushed the 2019-08-30-decouple-action-embeds branch from 2bd4f90 to fb08367 Compare September 3, 2019 13:15
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@stacey-gammon stacey-gammon mentioned this pull request Sep 3, 2019
4 tasks
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

LGTM

context.triggerContext &&
context.triggerContext.filters !== undefined
);
return Boolean(root.getInput().filters !== undefined && context.filters !== undefined);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

check embeddable exists as well

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, should be done in latest commit!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@stacey-gammon stacey-gammon merged commit 81d06d5 into elastic:master Sep 5, 2019
stacey-gammon pushed a commit to stacey-gammon/kibana that referenced this pull request Sep 5, 2019
* Decouple actions from embeddables: step 1

* prefer as any instead of is-ignore

* Remove unneccessary test, no more triggerContext to be null.

* Fix bug and fix the test that should have caught it.  Be more strict about checking isCompatible.
@stacey-gammon stacey-gammon requested a review from spong September 5, 2019 14:19
stacey-gammon pushed a commit that referenced this pull request Sep 5, 2019
* Decouple actions from embeddables: step 1

* prefer as any instead of is-ignore

* Remove unneccessary test, no more triggerContext to be null.

* Fix bug and fix the test that should have caught it.  Be more strict about checking isCompatible.
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:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review v7.5.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Embeddables] ApplyFilterAction calling async isCompatible() without await keyword

4 participants