From 89a6007881cc308d9d8a2c404807a2109e40c09a Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Wed, 10 Jun 2020 17:19:31 -0700 Subject: [PATCH] [Metrics UI] Fix Inventory View sorting by handling null values (#67889) * [Metrics UI] Fix Inventory View sorting by handling null values * Fixing situation where the id is not unique Co-authored-by: Elastic Machine --- .../metrics/inventory_view/components/waffle/group_of_nodes.tsx | 2 +- .../infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx index a6c9efb5e17d..5fcee6193b35 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx @@ -44,7 +44,7 @@ export const GroupOfNodes: React.FC = ({ {group.nodes.map((node) => ( last(node.path), - value: 'metric.value', + value: (node: SnapshotNode) => node.metric.value || 0, }; export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => {