From 2720f47fdb8edbc669048f509e31e936a8d8b0e7 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Sat, 12 Aug 2023 00:15:06 +0200 Subject: [PATCH] UI: Fixed missing key tag in Grid --- pkgs/ui/src/app/nodes/NodeList.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/ui/src/app/nodes/NodeList.tsx b/pkgs/ui/src/app/nodes/NodeList.tsx index 1aa64fbd..cd82dced 100644 --- a/pkgs/ui/src/app/nodes/NodeList.tsx +++ b/pkgs/ui/src/app/nodes/NodeList.tsx @@ -200,10 +200,13 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { }, [tableData]); const cardData = React.useMemo(() => { - let copy = pieData.filter((pieItem) => pieItem.value > 0); - const elem = { name: 'Total', value: copy.reduce((a, b) => a + b.value, 0), color: '#000000' }; - copy.push(elem); - return copy; + return pieData.filter((pieItem) => pieItem.value > 0).concat( + { + name: 'Total', + value: pieData.reduce((a, b) => a + b.value, 0), + color: '#000000' + } + ); }, [pieData]); const cardStack = ( @@ -279,7 +282,7 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { return ( - + {/* Debug Controls */} - + { setDebug(!debug) }} checked={debug} />} label="Debug" /> {/* Pie Chart Grid */} - + {/* Card Stack Grid */} - + {cardStack} {/*Toolbar Grid */} - + {isSelected ? selectedToolbar : unselectedToolbar} @@ -377,7 +380,7 @@ export interface NodeTableProps { } export default function NodeTable(props: NodeTableProps) { - let {tableData} = props; + let { tableData } = props; const [order, setOrder] = React.useState('asc'); const [orderBy, setOrderBy] = React.useState('status'); const [selected, setSelected] = React.useState(undefined);