kibana/examples
Nathan Reese 768f87d143
[8.19] [Dashboards as code] remove client transform of panels array to map (#224314) (#225096)
# 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-->
2025-06-24 18:22:02 +01:00
..
bfetch_explorer Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
content_management_examples [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +02:00
controls_example [8.19] [Embeddables] Serialized State Only (#215947) (#220308) 2025-05-07 04:56:55 +02:00
data_view_field_editor_example [8.x] Upgrade EUI to v101.1.0-classic.0 (#216208) 2025-04-03 16:23:08 +02:00
developer_examples [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +02:00
discover_customization_examples [8.19] [Data Discovery] Remove SO client usages (#224495) (#224978) 2025-06-24 08:58:19 +02:00
embeddable_examples [8.19] Fix: success message and scroll after adding panel from library (#220122) (#220703) 2025-05-09 15:10:15 -04:00
error_boundary [8.x] Upgrade EUI to v101.1.0-classic.0 (#216208) 2025-04-03 16:23:08 +02:00
eso_model_version_example [8.x] More strict plugin type definitions (#205232) (#205778) 2025-01-07 17:32:59 +00:00
esql_ast_inspector [8.x] [ES|QL] Source AST node parsing improvements and source selector parsing (#217299) (#217345) 2025-04-07 18:10:44 +02:00
esql_validation_example [8.19] [ES|QL] Renames the ESQLRealField type to ESQLFieldWithMetadata (#219894) (#220190) 2025-05-06 09:14:15 +02:00
expressions_explorer [8.x] SKA: Update broken references and URLs (#206836) (#208479) 2025-01-28 10:09:09 +01:00
feature_control_examples [8.x] [Authz] Migrated routes with access tags to security config (#209756) (#210596) 2025-02-11 17:37:06 +01:00
feature_flags_example [8.19] [Feature flags example] Apply FF naming conventions (#196535) (#218722) 2025-04-21 14:16:04 +02:00
field_formats_example [8.x] Upgrade EUI to v101.1.0-classic.0 (#216208) 2025-04-03 16:23:08 +02:00
files_example [8.x] Upgrade EUI to v101.1.0-classic.0 (#216208) 2025-04-03 16:23:08 +02:00
grid_example [8.19] [kbn-grid-layout] Flatten grid layout (#218900) (#221130) 2025-05-22 08:38:26 -06:00
guided_onboarding_example [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +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 [8.x] SKA: Update broken references and URLs (#206836) (#208479) 2025-01-28 10:09:09 +01:00
partial_results_example [8.x] Upgrade EUI to v101.1.0-classic.0 (#216208) 2025-04-03 16:23:08 +02:00
portable_dashboards_example [8.19] [Dashboards as code] remove client transform of panels array to map (#224314) (#225096) 2025-06-24 18:22:02 +01:00
preboot_example Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
resizable_layout_examples [8.x] Preparation for High Contrast Mode, Analytics Experience domains (#202608) (#204120) 2024-12-12 15:08:55 -06:00
response_stream [8.x] [Charts] Use chartTheme hook everywhere (#217370) (#218147) 2025-04-15 19:40:46 +02:00
routing_example [8.x] SKA: Update broken references and URLs (#206836) (#208479) 2025-01-28 10:09:09 +01:00
screenshot_mode_example Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
search_examples [8.x] SKA: Update broken references and URLs (#206836) (#208479) 2025-01-28 10:09:09 +01:00
share_examples [8.x] [Reporting] fix dashboard &quot;Copy Post URL&quot; action (#192530) (#195334) 2024-10-08 03:44:43 +02:00
state_containers_examples [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +02:00
ui_action_examples [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +02:00
ui_actions_explorer [8.19] [SharedUX] Replace KibanaRenderContextProvider usage (#220170) (#224470) 2025-06-23 10:45:52 +02:00
unified_doc_viewer [8.x] Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-data-discovery (#205267) 2024-12-30 13:03:12 -06:00
unified_field_list_examples [8.x] Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-data-discovery (#205267) 2024-12-30 13:03:12 -06:00
user_profile_examples [8.19] Upgrade EUI to v102.3.0 (#222149) (#223098) 2025-06-10 14:32:56 +02:00
v8_profiler_examples Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06: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
----