-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Decouple actions from embeddables: step 1 #44503
Decouple actions from embeddables: step 1 #44503
Conversation
Pinging @elastic/kibana-app-arch |
f378893
to
34a463f
Compare
💔 Build Failed |
const triggerContext = {}; | ||
if (isEmbeddable(embeddable) && isTriggerContext(triggerContext)) { | ||
if (isEmbeddable(embeddable)) { | ||
// @ts-ignore | ||
const result = await action.isCompatible({ |
There was a problem hiding this comment.
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
34a463f
to
304f791
Compare
💔 Build Failed |
2bd4f90
to
fb08367
Compare
💚 Build Succeeded |
…bout checking isCompatible.
💚 Build Succeeded |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
…couple-action-embeds
💚 Build Succeeded |
* 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.
* 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.
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 ofActionContext
is now completely up to the specific action implementation.Previously:
Now: