mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
Closes https://github.com/elastic/kibana/issues/1547 Closes https://github.com/elastic/kibana/issues/190342 Closes https://github.com/elastic/kibana/issues/197716 ## Summary This PR adds the ability for collapsible sections to be created and managed on Dashboards. https://github.com/user-attachments/assets/c5c046d0-58f1-45e1-88b3-33421f3ec002 > [!NOTE] > Most of the work for developing collapsible sections occurred in PRs contained to the `kbn-grid-layout` package (see [this meta issue](https://github.com/elastic/kibana/issues/190342) to track this work) - this PR simply makes them available on Dashboards by adding them as a widget that can be added through the "Add panel" menu. As a result of this, most work is contained in the Dashboard plugin - changes made to the `kbn-grid-layout` package only include adding IDs for additional tests that were added for the Dashboard integration. ### Technical Details #### Content Management Schema The content management schema allows for panels and sections to be mixed within the single `panels` key for a dashboard **without** worrying about section IDs; for example: ``` { "panels": [ { // this is a simplified panel "gridData": { "x": 0, "y": 0, "w": 12, "h": 8, }, "panelConfig": { ... }, }, { // this is a section "gridData": { "y": 9, }, "collapsed": false, "title": "Section title", "panels": [ { // this is a simplified panel "gridData": { "x": 0, "y": 0, "w": 24, "h": 16, }, "panelConfig": { ... }, }, ], }, ] } ``` #### Saved Object Schema The dashboard saved object schema, on the other hand, separates out sections and panels under different keys - this is because, while we are stuck with panels being stored as `panelJSON`, I didn't want to add much to this. So, under grid data for each panel, they have an optional `sectionId` which then links to a section in the `sections` array in the saved object: ``` { "panelsJSON": "<...> \"gridData\":{\"i\":\"panelId\",\"y\":0,\"x\":0,\"w\":12,\"h\":8,\"sectionId\":\"someSectionId\"} <...>" "sections": [ { "collapsed": false, "title": "Section title", "gridData": { "i": "someSectionId", "y": 8. } } ], } ``` This allows sections to be serialized **without** being stringified. This storage also matches how we store this data in runtime using `layout`. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release note Adds collapsible sections to Dashboard, which allow panels to grouped into sections that will not load their contents when their assigned section is collapsed. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
kbn-babel-preset | ||
kbn-bazel-runner | ||
kbn-capture-oas-snapshot-cli | ||
kbn-check-mappings-update-cli | ||
kbn-check-prod-native-modules-cli | ||
kbn-ci-stats-performance-metrics | ||
kbn-ci-stats-shipper-cli | ||
kbn-cli-dev-mode | ||
kbn-dependency-ownership | ||
kbn-dependency-usage | ||
kbn-docs-utils | ||
kbn-eslint-config | ||
kbn-eslint-plugin-disable | ||
kbn-eslint-plugin-eslint | ||
kbn-eslint-plugin-eui-a11y | ||
kbn-eslint-plugin-i18n | ||
kbn-eslint-plugin-imports | ||
kbn-eslint-plugin-telemetry | ||
kbn-failed-test-reporter-cli | ||
kbn-find-used-node-modules | ||
kbn-generate | ||
kbn-generate-console-definitions | ||
kbn-import-locator | ||
kbn-json-ast | ||
kbn-kibana-manifest-schema | ||
kbn-lint-packages-cli | ||
kbn-lint-ts-projects-cli | ||
kbn-lock-manager | ||
kbn-managed-vscode-config | ||
kbn-managed-vscode-config-cli | ||
kbn-manifest | ||
kbn-mock-idp-plugin | ||
kbn-optimizer | ||
kbn-peggy-loader | ||
kbn-performance-testing-dataset-extractor | ||
kbn-picomatcher | ||
kbn-plugin-check | ||
kbn-plugin-generator | ||
kbn-plugin-helpers | ||
kbn-relocate | ||
kbn-repo-file-maps | ||
kbn-repo-linter | ||
kbn-repo-source-classifier | ||
kbn-repo-source-classifier-cli | ||
kbn-set-map | ||
kbn-sort-package-json | ||
kbn-styled-components-mapping-cli | ||
kbn-ts-projects | ||
kbn-ts-type-check-cli | ||
kbn-validate-next-docs-cli | ||
kbn-web-worker-stub | ||
kbn-whereis-pkg-cli | ||
kbn-yarn-lock-validator |