[Lens] move reference handling to server#239029
Conversation
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
dej611
left a comment
There was a problem hiding this comment.
Tested locally and works fine.
Left some minor comments, in particular about type locations.
Will approve to unblock.
This comment was marked as resolved.
This comment was marked as resolved.
bg sessions use the public url transforms which defaults to references from the dashboard url which are now always empty, soon to be removed entirely. But in Lens we had logic to filter references from the dashboard based on references from the lens SO. Instead we should just merge all refs from the lens SO and dashboard.
💛 Build succeeded, but was flakyFailed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
|
| // TODO: Improve these types | ||
| const lensVis = vis as unknown as LensEmbeddableStateWithType; | ||
| return extract(lensVis).references; |
There was a problem hiding this comment.
The types here are complaining because vis.attributes are Record<string, unknown>.
## Summary Move Lens `reference` handling to server side. Close elastic#221943 ## Details Lens no longer relies on `references` from the `buildEmbeddable`. We now inject/extract references on the server. Lens duplicates `references` in it's own serialized state so we just move them there and add the `savedObjectId` for by-ref Lens panels. Lens still inject these `references` internally by type across the Lens code. For now we still store the `references` duplicated in the Lens SO state, but we can clean this up when we extract all the internal reference handling. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> Co-authored-by: dej611 <dej611@gmail.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Move Lens `reference` handling to server side. Close elastic#221943 ## Details Lens no longer relies on `references` from the `buildEmbeddable`. We now inject/extract references on the server. Lens duplicates `references` in it's own serialized state so we just move them there and add the `savedObjectId` for by-ref Lens panels. Lens still inject these `references` internally by type across the Lens code. For now we still store the `references` duplicated in the Lens SO state, but we can clean this up when we extract all the internal reference handling. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> Co-authored-by: dej611 <dej611@gmail.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Move Lens
referencehandling to server side.Close #221943
Details
Lens no longer relies on
referencesfrom thebuildEmbeddable. We now inject/extract references on the server.Lens duplicates
referencesin it's own serialized state so we just move them there and add thesavedObjectIdfor by-ref Lens panels. Lens still inject thesereferencesinternally by type across the Lens code.For now we still store the
referencesduplicated in the Lens SO state, but we can clean this up when we extract all the internal reference handling.Checklist
backport:*labels.