[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 <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
0cfe1166ec
commit
89a6007881
|
@ -44,7 +44,7 @@ export const GroupOfNodes: React.FC<Props> = ({
|
||||||
<Nodes>
|
<Nodes>
|
||||||
{group.nodes.map((node) => (
|
{group.nodes.map((node) => (
|
||||||
<Node
|
<Node
|
||||||
key={node.pathId}
|
key={`${node.pathId}:${node.name}`}
|
||||||
options={options}
|
options={options}
|
||||||
squareSize={group.squareSize}
|
squareSize={group.squareSize}
|
||||||
node={node}
|
node={node}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { WaffleSortOption } from '../hooks/use_waffle_options';
|
||||||
|
|
||||||
const SORT_PATHS = {
|
const SORT_PATHS = {
|
||||||
name: (node: SnapshotNode) => last(node.path),
|
name: (node: SnapshotNode) => last(node.path),
|
||||||
value: 'metric.value',
|
value: (node: SnapshotNode) => node.metric.value || 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => {
|
export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => {
|
||||||
|
|
Loading…
Reference in a new issue