kibana/examples
Nathan Reese 3d6954e252
[Dashboards as code] remove client transform of panels array to map (#224314)
Closes https://github.com/elastic/kibana/issues/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
https://github.com/elastic/kibana/pull/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>
2025-06-24 08:48:08 -06:00
..
content_management_examples [SharedUX] Replace KibanaRenderContextProvider usage (#220170) 2025-06-12 08:39:59 -07:00
controls_example Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
data_view_field_editor_example Upgrade EUI to v101.0.1 (#215698) 2025-03-28 19:29:23 +01:00
developer_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
discover_customization_examples [Data Discovery] Remove SO client usages (#224495) 2025-06-23 19:51:27 -03:00
embeddable_examples Fix: success message and scroll after adding panel from library (#220122) 2025-05-09 13:24:49 -04:00
error_boundary Upgrade EUI to v101.0.1 (#215698) 2025-03-28 19:29:23 +01:00
eso_model_version_example APEX-54 Stricter type checking for unsafe_transform functions (#222973) 2025-06-13 12:29:13 +02:00
esql_ast_inspector Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
esql_validation_example Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
expressions_explorer SKA: Update broken references and URLs (#206836) 2025-01-28 03:32:48 +00:00
feature_control_examples [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
feature_flags_example [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
field_formats_example Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
files_example Upgrade EUI to v101.0.1 (#215698) 2025-03-28 19:29:23 +01:00
grid_example [kbn-grid-layout] Flatten grid layout (#218900) 2025-05-21 08:01:13 -06:00
guided_onboarding_example [Search] Remove website search guided onboarding (#224538) 2025-06-19 19:34:32 +02:00
hello_world Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
locator_examples Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
locator_explorer SKA: Update broken references and URLs (#206836) 2025-01-28 03:32:48 +00:00
partial_results_example Upgrade EUI to v101.0.1 (#215698) 2025-03-28 19:29:23 +01:00
portable_dashboards_example [Dashboards as code] remove client transform of panels array to map (#224314) 2025-06-24 08:48:08 -06:00
preboot_example [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
resizable_layout_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
response_stream [Charts] Use chartTheme hook everywhere (#217370) 2025-04-14 18:09:15 +02:00
routing_example [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
screenshot_mode_example Change reporting CODEOWNERS to response ops (#213560) 2025-04-04 23:27:42 +02:00
search_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
share_examples [Reporting] fix dashboard "Copy Post URL" action (#192530) 2024-10-08 01:54:21 +02:00
sse_example [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
state_containers_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
ui_action_examples [SharedUX] Replace KibanaRenderContextProvider usage (#220170) 2025-06-12 08:39:59 -07:00
ui_actions_explorer Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
unified_doc_viewer Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
unified_field_list_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
unified_tabs_examples Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
user_profile_examples Upgrade EUI to v102.3.0 (#222149) 2025-06-09 11:04:46 +02:00
v8_profiler_examples [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
README.asciidoc Adds run without basepath configured to examples readme (#173086) 2023-12-12 11:22:02 -07:00

[[example-plugins]]
== Example plugins

This folder contains example plugins.  To run the plugins in this folder, use the `--run-examples` flag (without a basepath), via

[source,bash]
----
yarn start --run-examples
----