From 25d2746e3561f869e48022c968e7d78266ffa7e4 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Wed, 19 Feb 2025 15:26:19 +0530 Subject: [PATCH] stable and unique key for /rules page and key fixes Signed-off-by: amanycodes --- web/ui/mantine-ui/src/pages/AlertsPage.tsx | 2 +- web/ui/mantine-ui/src/pages/RulesPage.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/ui/mantine-ui/src/pages/AlertsPage.tsx b/web/ui/mantine-ui/src/pages/AlertsPage.tsx index 4b73fbfb55..b79ec4005c 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -221,7 +221,7 @@ export default function AlertsPage() { shadow="xs" withBorder p="md" - key={`${g.name}-${g.file}`} // TODO: Find a stable and definitely unique key. + key={`${g.file}-${g.name}`} // TODO: Find a stable and definitely unique key. > diff --git a/web/ui/mantine-ui/src/pages/RulesPage.tsx b/web/ui/mantine-ui/src/pages/RulesPage.tsx index ef1e1d6243..50567a736d 100644 --- a/web/ui/mantine-ui/src/pages/RulesPage.tsx +++ b/web/ui/mantine-ui/src/pages/RulesPage.tsx @@ -86,12 +86,13 @@ export default function RulesPage() { (effectiveActivePage - 1) * ruleGroupsPerPage, effectiveActivePage * ruleGroupsPerPage ) - .map((g, i) => ( + .map((g) => (