[8.19] [Dashboards as code] remove client transform of panels array to map (#224314)#225096
Merged
nreese merged 1 commit intoelastic:8.19from Jun 24, 2025
Merged
[8.19] [Dashboards as code] remove client transform of panels array to map (#224314)#225096nreese merged 1 commit intoelastic:8.19from
nreese merged 1 commit intoelastic:8.19from
Conversation
…lastic#224314) Closes elastic#224294 ### External team reviewers @elastic/kibana-presentation team is working on "Dashboards as code" project where we provide a human readable CRUD API for dashboards. Part of this work is aligning dashboard client code with the shape of dashboard server api. As such, we are changing the shape of `panels` from a Map to an Array - to directly consume what is being returned from the dashboard server api. ### PR Overview The goal of this PR is to update dashboard client-side state `panels` type to match the type from dashboard server api. The dashboard server api returns panels as an Array, while the dashboard client-side logic is expecting panels to be a Map keyed by panel id. This type change required the following changes: * Refactored dashboard client code to receive panels as an array and return panels as an array. Biggest work is in layout_manager `deserializeState` and `serializeState` methods. * Remove `convertPanelsArrayToPanelSectionMaps` from `loadDashboardState`. `convertPanelsArrayToPanelSectionMaps` performed 2 tasks 1) Convert panels array to map. This is no longer needed as now dashboard client code accepts panels in its native shape from the dashboard server api. 2) Move `id` and `title` fields into embeddable state. This is no longer needed as now dashboard server api does this transform before sending the dashboard to the client. * Remove `convertPanelSectionMapsToPanelsArray` from `getSerializedState`. `convertPanelSectionMapsToPanelsArray` performed 2 tasks. 1) Convert panels map into panels array. This is no longer needed as now panels is provided to `getSerializedState` in the shape required for the dashboard server api. 2) Lift `id` and `title` fields from into top level panel state. This is no longer needed as all embeddable state should remain under `panelConfig`. * Remove a bunch of code in `dashboard/common` as now the client and server are do not need to depend on shared logic as the client is much simpler and no longer needs to transform the server response. Much of this shared logic was copied into server saved object migrations in elastic#223980 but can now be removed from common since its no longer used in the client. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 3d6954e) # Conflicts: # src/platform/plugins/shared/dashboard/public/dashboard_renderer/grid/dashboard_grid_item.tsx
ThomThomson
approved these changes
Jun 24, 2025
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Contributor
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Contributor
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation