From 3dc9cbc8c092890d88b226e25e412b9152c023e3 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Sat, 15 Feb 2025 19:20:21 +0530 Subject: [PATCH 1/4] stable and definitely unique card UI key in /alerts Signed-off-by: amanycodes --- web/ui/mantine-ui/src/pages/AlertsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ui/mantine-ui/src/pages/AlertsPage.tsx b/web/ui/mantine-ui/src/pages/AlertsPage.tsx index afe3d3db90..575207c745 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={i} // TODO: Find a stable and definitely unique key. + key={`${g.name}-${g.file}`} // TODO: Find a stable and definitely unique key. > From de5b5c56e2705a0d810ace8c4283f0df25af0b3e Mon Sep 17 00:00:00 2001 From: amanycodes Date: Sat, 15 Feb 2025 19:45:43 +0530 Subject: [PATCH 2/4] fix-ci-errors Signed-off-by: amanycodes --- web/ui/mantine-ui/src/pages/AlertsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ui/mantine-ui/src/pages/AlertsPage.tsx b/web/ui/mantine-ui/src/pages/AlertsPage.tsx index 575207c745..4b73fbfb55 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -216,7 +216,7 @@ export default function AlertsPage() { // convenient to have in the same file IMO). const renderedPageItems = useMemo( () => - currentPageGroups.map((g, i) => ( + currentPageGroups.map((g) => ( Date: Wed, 19 Feb 2025 15:26:19 +0530 Subject: [PATCH 3/4] 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) => ( From ad8464249cac9cd215afac6995087676c08d7e00 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Wed, 19 Feb 2025 15:28:27 +0530 Subject: [PATCH 4/4] removed comments Signed-off-by: amanycodes --- web/ui/mantine-ui/src/pages/AlertsPage.tsx | 2 +- web/ui/mantine-ui/src/pages/RulesPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ui/mantine-ui/src/pages/AlertsPage.tsx b/web/ui/mantine-ui/src/pages/AlertsPage.tsx index b79ec4005c..a905850628 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.file}-${g.name}`} // TODO: Find a stable and definitely unique key. + key={`${g.file}-${g.name}`} > diff --git a/web/ui/mantine-ui/src/pages/RulesPage.tsx b/web/ui/mantine-ui/src/pages/RulesPage.tsx index 50567a736d..054bea0939 100644 --- a/web/ui/mantine-ui/src/pages/RulesPage.tsx +++ b/web/ui/mantine-ui/src/pages/RulesPage.tsx @@ -92,7 +92,7 @@ export default function RulesPage() { withBorder p="md" mb="md" - key={`${g.file}-${g.name}`} // TODO: Find a stable and definitely unique key. + key={`${g.file}-${g.name}`} >