From bf9c68c7f14da8dd722ca7d24273d781e42ece71 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 4ce42d9059..de2f722ea9 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -220,7 +220,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 5db9a9d2cf1c44b25c513d0d9c035b0933a0868e 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 de2f722ea9..d6402199e9 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -215,7 +215,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 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/ui/mantine-ui/src/pages/AlertsPage.tsx b/web/ui/mantine-ui/src/pages/AlertsPage.tsx index d6402199e9..e180bfccd6 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -220,7 +220,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 0888fe4737..fff95f0900 100644 --- a/web/ui/mantine-ui/src/pages/RulesPage.tsx +++ b/web/ui/mantine-ui/src/pages/RulesPage.tsx @@ -86,13 +86,13 @@ export default function RulesPage() { (effectiveActivePage - 1) * ruleGroupsPerPage, effectiveActivePage * ruleGroupsPerPage ) - .map((g, i) => ( + .map((g) => ( From 11baddb19b146abbe569a00e74b2d0d26d5252f2 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 e180bfccd6..87b0d01cb9 100644 --- a/web/ui/mantine-ui/src/pages/AlertsPage.tsx +++ b/web/ui/mantine-ui/src/pages/AlertsPage.tsx @@ -220,7 +220,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 fff95f0900..90ddc89195 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}`} >