mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
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> |
||
---|---|---|
.. | ||
content_management_examples | ||
controls_example | ||
data_view_field_editor_example | ||
developer_examples | ||
discover_customization_examples | ||
embeddable_examples | ||
error_boundary | ||
eso_model_version_example | ||
esql_ast_inspector | ||
esql_validation_example | ||
expressions_explorer | ||
feature_control_examples | ||
feature_flags_example | ||
field_formats_example | ||
files_example | ||
grid_example | ||
guided_onboarding_example | ||
hello_world | ||
locator_examples | ||
locator_explorer | ||
partial_results_example | ||
portable_dashboards_example | ||
preboot_example | ||
resizable_layout_examples | ||
response_stream | ||
routing_example | ||
screenshot_mode_example | ||
search_examples | ||
share_examples | ||
sse_example | ||
state_containers_examples | ||
ui_action_examples | ||
ui_actions_explorer | ||
unified_doc_viewer | ||
unified_field_list_examples | ||
unified_tabs_examples | ||
user_profile_examples | ||
v8_profiler_examples | ||
README.asciidoc |
[[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 ----