mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
# Backport This will backport the following commits from `main` to `8.19`: - [[Dashboards as code] remove client transform of panels array to map (#224314)](https://github.com/elastic/kibana/pull/224314) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-06-24T14:48:08Z","message":"[Dashboards as code] remove client transform of panels array to map (#224314)\n\nCloses https://github.com/elastic/kibana/issues/224294\n\n### External team reviewers\n@elastic/kibana-presentation team is working on \"Dashboards as code\"\nproject where we provide a human readable CRUD API for dashboards. Part\nof this work is aligning dashboard client code with the shape of\ndashboard server api. As such, we are changing the shape of `panels`\nfrom a Map to an Array - to directly consume what is being returned from\nthe dashboard server api.\n\n### PR Overview\n\nThe goal of this PR is to update dashboard client-side state `panels`\ntype to match the type from dashboard server api. The dashboard server\napi returns panels as an Array, while the dashboard client-side logic is\nexpecting panels to be a Map keyed by panel id.\n\nThis type change required the following changes:\n* Refactored dashboard client code to receive panels as an array and\nreturn panels as an array. Biggest work is in layout_manager\n`deserializeState` and `serializeState` methods.\n* Remove `convertPanelsArrayToPanelSectionMaps` from\n`loadDashboardState`. `convertPanelsArrayToPanelSectionMaps` performed 2\ntasks\n1) Convert panels array to map. This is no longer needed as now\ndashboard client code accepts panels in its native shape from the\ndashboard server api.\n2) Move `id` and `title` fields into embeddable state. This is no longer\nneeded as now dashboard server api does this transform before sending\nthe dashboard to the client.\n* Remove `convertPanelSectionMapsToPanelsArray` from\n`getSerializedState`. `convertPanelSectionMapsToPanelsArray` performed 2\ntasks.\n1) Convert panels map into panels array. This is no longer needed as now\npanels is provided to `getSerializedState` in the shape required for the\ndashboard server api.\n2) Lift `id` and `title` fields from into top level panel state. This is\nno longer needed as all embeddable state should remain under\n`panelConfig`.\n* Remove a bunch of code in `dashboard/common` as now the client and\nserver are do not need to depend on shared logic as the client is much\nsimpler and no longer needs to transform the server response. Much of\nthis shared logic was copied into server saved object migrations in\nhttps://github.com/elastic/kibana/pull/223980 but can now be removed\nfrom common since its no longer used in the client.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"3d6954e25284014527209cb8ba50db255cbfe41a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","Team:obs-ux-infra_services","Team:obs-ux-management","backport:version","Project:Dashboards API","v9.1.0","v8.19.0"],"title":"[Dashboards as code] remove client transform of panels array to map","number":224314,"url":"https://github.com/elastic/kibana/pull/224314","mergeCommit":{"message":"[Dashboards as code] remove client transform of panels array to map (#224314)\n\nCloses https://github.com/elastic/kibana/issues/224294\n\n### External team reviewers\n@elastic/kibana-presentation team is working on \"Dashboards as code\"\nproject where we provide a human readable CRUD API for dashboards. Part\nof this work is aligning dashboard client code with the shape of\ndashboard server api. As such, we are changing the shape of `panels`\nfrom a Map to an Array - to directly consume what is being returned from\nthe dashboard server api.\n\n### PR Overview\n\nThe goal of this PR is to update dashboard client-side state `panels`\ntype to match the type from dashboard server api. The dashboard server\napi returns panels as an Array, while the dashboard client-side logic is\nexpecting panels to be a Map keyed by panel id.\n\nThis type change required the following changes:\n* Refactored dashboard client code to receive panels as an array and\nreturn panels as an array. Biggest work is in layout_manager\n`deserializeState` and `serializeState` methods.\n* Remove `convertPanelsArrayToPanelSectionMaps` from\n`loadDashboardState`. `convertPanelsArrayToPanelSectionMaps` performed 2\ntasks\n1) Convert panels array to map. This is no longer needed as now\ndashboard client code accepts panels in its native shape from the\ndashboard server api.\n2) Move `id` and `title` fields into embeddable state. This is no longer\nneeded as now dashboard server api does this transform before sending\nthe dashboard to the client.\n* Remove `convertPanelSectionMapsToPanelsArray` from\n`getSerializedState`. `convertPanelSectionMapsToPanelsArray` performed 2\ntasks.\n1) Convert panels map into panels array. This is no longer needed as now\npanels is provided to `getSerializedState` in the shape required for the\ndashboard server api.\n2) Lift `id` and `title` fields from into top level panel state. This is\nno longer needed as all embeddable state should remain under\n`panelConfig`.\n* Remove a bunch of code in `dashboard/common` as now the client and\nserver are do not need to depend on shared logic as the client is much\nsimpler and no longer needs to transform the server response. Much of\nthis shared logic was copied into server saved object migrations in\nhttps://github.com/elastic/kibana/pull/223980 but can now be removed\nfrom common since its no longer used in the client.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"3d6954e25284014527209cb8ba50db255cbfe41a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224314","number":224314,"mergeCommit":{"message":"[Dashboards as code] remove client transform of panels array to map (#224314)\n\nCloses https://github.com/elastic/kibana/issues/224294\n\n### External team reviewers\n@elastic/kibana-presentation team is working on \"Dashboards as code\"\nproject where we provide a human readable CRUD API for dashboards. Part\nof this work is aligning dashboard client code with the shape of\ndashboard server api. As such, we are changing the shape of `panels`\nfrom a Map to an Array - to directly consume what is being returned from\nthe dashboard server api.\n\n### PR Overview\n\nThe goal of this PR is to update dashboard client-side state `panels`\ntype to match the type from dashboard server api. The dashboard server\napi returns panels as an Array, while the dashboard client-side logic is\nexpecting panels to be a Map keyed by panel id.\n\nThis type change required the following changes:\n* Refactored dashboard client code to receive panels as an array and\nreturn panels as an array. Biggest work is in layout_manager\n`deserializeState` and `serializeState` methods.\n* Remove `convertPanelsArrayToPanelSectionMaps` from\n`loadDashboardState`. `convertPanelsArrayToPanelSectionMaps` performed 2\ntasks\n1) Convert panels array to map. This is no longer needed as now\ndashboard client code accepts panels in its native shape from the\ndashboard server api.\n2) Move `id` and `title` fields into embeddable state. This is no longer\nneeded as now dashboard server api does this transform before sending\nthe dashboard to the client.\n* Remove `convertPanelSectionMapsToPanelsArray` from\n`getSerializedState`. `convertPanelSectionMapsToPanelsArray` performed 2\ntasks.\n1) Convert panels map into panels array. This is no longer needed as now\npanels is provided to `getSerializedState` in the shape required for the\ndashboard server api.\n2) Lift `id` and `title` fields from into top level panel state. This is\nno longer needed as all embeddable state should remain under\n`panelConfig`.\n* Remove a bunch of code in `dashboard/common` as now the client and\nserver are do not need to depend on shared logic as the client is much\nsimpler and no longer needs to transform the server response. Much of\nthis shared logic was copied into server saved object migrations in\nhttps://github.com/elastic/kibana/pull/223980 but can now be removed\nfrom common since its no longer used in the client.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"3d6954e25284014527209cb8ba50db255cbfe41a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> |
||
---|---|---|
.. | ||
bfetch_explorer | ||
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 | ||
state_containers_examples | ||
ui_action_examples | ||
ui_actions_explorer | ||
unified_doc_viewer | ||
unified_field_list_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 ----