From 931bdc83d78f44ce53fbe3f4d0ee9b5ba575994e Mon Sep 17 00:00:00 2001 From: jennypavlova Date: Fri, 2 Feb 2024 17:44:46 +0100 Subject: [PATCH] [Infra] Add collapsible sections (#176048) Closes #175558 ## Summary This PR makes all asset details overview sections collapsible. All sections will be always open by default and the user should be able to expand/collapse a section. Screenshot 2024-02-01 at 12 04 24 Screenshot 2024-02-01 at 12 03 50 ## Testing 1. Open Host view 2. Open the hosts flyout and go to the overview tab - All sections should be collapsible - All section buttons should be clickable https://github.com/elastic/kibana/assets/14139027/27a6df67-c560-42d6-9166-a8f45880cf8e 3. Open the asset details page and go to the overview tab - All sections should be collapsible - All section buttons should be clickable https://github.com/elastic/kibana/assets/14139027/f7225ddd-c2a3-4a7b-b520-22acb41e9080 --- .../asset_details/tabs/common/popover.tsx | 8 +- .../asset_details/tabs/overview/alerts.tsx | 46 +++++---- .../metadata_summary_list.tsx | 93 ++++++++++--------- .../tabs/overview/metrics/metrics_section.tsx | 23 +++-- .../overview/section/collapsible_section.tsx | 84 +++++++++++++++++ .../test/functional/apps/infra/hosts_view.ts | 6 ++ .../functional/apps/infra/node_details.ts | 6 ++ .../functional/page_objects/asset_details.ts | 11 +++ 8 files changed, 200 insertions(+), 77 deletions(-) create mode 100644 x-pack/plugins/infra/public/components/asset_details/tabs/overview/section/collapsible_section.tsx diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/common/popover.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/common/popover.tsx index a021632a6d5ae..43fb037eacd18 100644 --- a/x-pack/plugins/infra/public/components/asset_details/tabs/common/popover.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/tabs/common/popover.tsx @@ -27,7 +27,13 @@ export const Popover = ({ +