From e20f75e09cde866f3116b91285d3b050ffbc5fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 23 Feb 2019 10:59:46 +0000 Subject: [PATCH] fix(ui): use current number of alerts in the count label alertsToRender can be higher than the number of alerts in a group if the number keeps changing. This means we might end up with 'Showing 30/10', so ensuring that we don't show a number higher than the actual group size will make it more accurate --- ui/src/Components/Grid/AlertGrid/AlertGroup/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js index e1dedd169..52cba769f 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js @@ -197,7 +197,10 @@ const AlertGroup = observer( tooltip="Show fewer alerts in this group" /> - {this.renderConfig.alertsToRender} + {Math.min( + this.renderConfig.alertsToRender, + group.alerts.length + )} {" of "} {group.alerts.length}