[Canvas] Extract and inject references for by-value embeddables#115124
Conversation
2030a15 to
afea023
Compare
e4ae94d to
cfd82be
Compare
afea023 to
6b2bc48
Compare
cfd82be to
fc41b40
Compare
320e58c to
98a4faf
Compare
6b2bc48 to
196b94d
Compare
98a4faf to
bd12f1f
Compare
7557017 to
f8dbcaf
Compare
bd12f1f to
2e57111
Compare
f8dbcaf to
34831c5
Compare
2e57111 to
c9dfc60
Compare
⏳ Build in-progress, with failures
Failed CI Steps
History
To update your PR or re-run it, just comment with: |
💔 Build Failed
Failed CI StepsTest FailuresKibana Pipeline / jest / Jest Tests.x-pack/plugins/canvas/storybook.Storyshots components/WorkpadHeader/EditorMenu defaultStandard OutStack TraceKibana Pipeline / jest / Jest Tests.x-pack/plugins/canvas/storybook.Storyshots components/WorkpadHeader/EditorMenu dark modeStandard OutStack TraceKibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/security_solution/tls·ts.apis SecuritySolution Endpoints Tls Test with Packetbeat Tls Overview Test Ensure data is returned for FlowTarget.DestinationStandard OutStack TraceHistory
To update your PR or re-run it, just comment with: |
34831c5 to
6a29232
Compare
3e204cb to
2371a43
Compare
6a29232 to
8ac6d41
Compare
2371a43 to
ed91534
Compare
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
ThomThomson
left a comment
There was a problem hiding this comment.
Code review only - Inject and Extract functions are looking pretty good so far!
Left a couple comments / questions, but much of it might just be me misunderstanding how reference extraction / injection works in Canvas.
x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
These references must get de-duped somewhere in the workpad extract / inject references, but I'm not sure where this happens. Just to make sure: If you look at the workpad in the saved objects explorer, each by reference embeddable has a unique ID?
There was a problem hiding this comment.
Update: Looks like the de-duping is conducted properly inside the workpad, each reference is prepended with the element ID.
There was a problem hiding this comment.
Thanks again for double checking this for me!
ThomThomson
left a comment
There was a problem hiding this comment.
With the one comment addressed, this LGTM!
c637735 to
780f71c
Compare
3fd223f to
aeea737
Compare
|
Don't see any core/telemetry owned changes, removing us from reviews. |
There was a problem hiding this comment.
@cqliu1 I think this is the source of the issue I mentioned to you. inject expects embeddableStateWithType and this is just giving it state.
There was a problem hiding this comment.
| const { type, ...injectedInput } = embeddablePersistableStateService.inject( | |
| input, | |
| references | |
| ); | |
| const { type, ...injectedInput } = embeddablePersistableStateService.inject( | |
| {...input, type: state.type[0]}, | |
| references | |
| ); |
1834014 to
151ceac
Compare
…tion Fixed server interpreter setup Register external functions in canvas_plugin_src plugin def
0104adf to
7125b53
Compare
💛 Build succeeded, but was flaky
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* [Canvas] Generic embeddable function (#104499) * Created generic embeddable function Fixed telemetry Updates expression on input change Fixed ts errors Store embeddable input to expression Added lib functions Added comments Fixed type errors Fixed ts errors Clean up Removed extraneous import Added context type to embeddable function def Fix import Update encode/decode fns Moved embeddable data url lib file Added embeddable test Updated comment * Fix reference extract/inject in embeddable fn * Simplify embeddable toExpression * Moved labsService to flyout.tsx * Added comment * [Canvas] Adds Save and Return Workflow (#111411) * [Canvas] Adds editor menu to Canvas (#113194) * Merge existing embeddable input with incoming embeddable input (#116026) * [Canvas] Extract and inject references for by-value embeddables (#115124) * Extract/inject references for by-value embeddables in embeddable function Fixed server interpreter setup Register external functions in canvas_plugin_src plugin def * Fixed ref name in embeddable.inject * Fixed ts errors * Fix missing type error Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Summary
Blocked by #113194.
This uses the Embeddable Persistable State Service to extract/inject references for by-value embeddables in the
embeddablefunction.Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers