Skip to content

Commit

Permalink
[Metrics UI] Fix Inventory View sorting by handling null values (elas…
Browse files Browse the repository at this point in the history
…tic#67889)

* [Metrics UI] Fix Inventory View sorting by handling null values

* Fixing situation where the id is not unique

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
simianhacker and elasticmachine committed Jun 11, 2020
1 parent 29380dc commit cd96b36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const GroupOfNodes: React.FC<Props> = ({
<Nodes>
{group.nodes.map((node) => (
<Node
key={node.pathId}
key={`${node.pathId}:${node.name}`}
options={options}
squareSize={group.squareSize}
node={node}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { WaffleSortOption } from '../hooks/use_waffle_options';

const SORT_PATHS = {
name: (node: SnapshotNode) => last(node.path),
value: 'metric.value',
value: (node: SnapshotNode) => node.metric.value || 0,
};

export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => {
Expand Down

0 comments on commit cd96b36

Please sign in to comment.