[dashboard as code] move visualize embeddable reference handling to server#234249
[dashboard as code] move visualize embeddable reference handling to server#234249nreese merged 35 commits intoelastic:mainfrom
Conversation
…ncementsOut functions from embeddable public and server start contracts
|
/ci |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
| }; | ||
| } | ||
|
|
||
| throw new Error('Unable to inject references from Visualization state, unexpected state'); |
There was a problem hiding this comment.
I faced this error when saving a new Visualize chart into a dashboard (chosing Add to New dashboard)
[2025-09-16T12:08:25.551+02:00][WARN ][plugins.dashboard] Unable to transform "visualization" embeddable state on read. Error: Unable to inject references from Visualization state, unexpected state
I get that with both a dataView or a saved search selected as data source.
No visible error on the chart
There was a problem hiding this comment.
resolved in 580ccbf
The warnings where logged when opening the visualize save model. The save modal has a dashboard selector. The selections are populated by fetching the first 30 dashboards. Since these dashboards are read, their panel state is transformed. The warning was coming from "sample web logs dashboard". This dashboard has old state where "by-reference" saved object ids are saved outside of embeddable config. I updated the transforms to better handle this case.
There was a problem hiding this comment.
Wait, why does it need to fetch the first 30 dashboards with all panels here?
Wouldn't be sufficient to fetch the same data as the Dashboard listing page?
There was a problem hiding this comment.
Wait, why does it need to fetch the first 30 dashboards with all panels here?
I am not sure, that is just how the dashboards selector element is currently implemented. If you want to discuss that, we could open a separate issue since that is not related to this PR.
There was a problem hiding this comment.
created #235377 to track dashboard selector optimizations
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
|
|
@elasticmachine merge upstream |
jsanz
left a comment
There was a problem hiding this comment.
Presentation team changes look good to me (code review)
…erver (elastic#234249) PR moves visualize embeddable reference handling to the server. dashboard CRUD APIs no longer contain references from visualize panels. In the screen shot below, notice how `savedSearchId` and `index` fields contain saved object ids and are not references. Notice how the reference array for the dashboard is empty. <img width="2047" height="1020" alt="Screenshot 2025-09-10 at 6 04 00 AM" src="https://github.com/user-attachments/assets/eb0671e8-5dec-4285-b20d-0a5928b0aa93" /> References are extracted on server and stored in dashboard saved object. In the screen shot below, notice how `savedSearchId` has been replaced with `savedSearchRefName` and points to a reference that contains the saved objec tid. Notice how `index` has been replaced with `indexRefName` and points to a reference that contains the saved object id. <img width="2045" height="1015" alt="Screenshot 2025-09-10 at 6 07 27 AM" src="https://github.com/user-attachments/assets/3442615d-d78d-4fc4-9980-073a7229ac30" /> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…erver (#234249) PR moves visualize embeddable reference handling to the server. dashboard CRUD APIs no longer contain references from visualize panels. In the screen shot below, notice how `savedSearchId` and `index` fields contain saved object ids and are not references. Notice how the reference array for the dashboard is empty. <img width="2047" height="1020" alt="Screenshot 2025-09-10 at 6 04 00 AM" src="https://github.com/user-attachments/assets/eb0671e8-5dec-4285-b20d-0a5928b0aa93" /> References are extracted on server and stored in dashboard saved object. In the screen shot below, notice how `savedSearchId` has been replaced with `savedSearchRefName` and points to a reference that contains the saved objec tid. Notice how `index` has been replaced with `indexRefName` and points to a reference that contains the saved object id. <img width="2045" height="1015" alt="Screenshot 2025-09-10 at 6 07 27 AM" src="https://github.com/user-attachments/assets/3442615d-d78d-4fc4-9980-073a7229ac30" /> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…erver (elastic#234249) PR moves visualize embeddable reference handling to the server. dashboard CRUD APIs no longer contain references from visualize panels. In the screen shot below, notice how `savedSearchId` and `index` fields contain saved object ids and are not references. Notice how the reference array for the dashboard is empty. <img width="2047" height="1020" alt="Screenshot 2025-09-10 at 6 04 00 AM" src="https://github.com/user-attachments/assets/eb0671e8-5dec-4285-b20d-0a5928b0aa93" /> References are extracted on server and stored in dashboard saved object. In the screen shot below, notice how `savedSearchId` has been replaced with `savedSearchRefName` and points to a reference that contains the saved objec tid. Notice how `index` has been replaced with `indexRefName` and points to a reference that contains the saved object id. <img width="2045" height="1015" alt="Screenshot 2025-09-10 at 6 07 27 AM" src="https://github.com/user-attachments/assets/3442615d-d78d-4fc4-9980-073a7229ac30" /> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
PR moves visualize embeddable reference handling to the server.
dashboard CRUD APIs no longer contain references from visualize panels. In the screen shot below, notice how

savedSearchIdandindexfields contain saved object ids and are not references. Notice how the reference array for the dashboard is empty.References are extracted on server and stored in dashboard saved object. In the screen shot below, notice how

savedSearchIdhas been replaced withsavedSearchRefNameand points to a reference that contains the saved objec tid. Notice howindexhas been replaced withindexRefNameand points to a reference that contains the saved object id.