From 264c4f2feb8db080a844175ef780dd7e4800d065 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Mon, 15 Jun 2020 12:22:05 -0700 Subject: [PATCH] [Metrics UI] Fix Inventory View sorting by handling null values (#67889) (#68838) * [Metrics UI] Fix Inventory View sorting by handling null values * Fixing situation where the id is not unique Co-authored-by: Elastic Machine 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 a6c9efb5e17d1..5fcee6193b357 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[]) => {