diff --git a/public/app/features/alerting/unified/components/rules/RuleDetailsMatchingInstances.tsx b/public/app/features/alerting/unified/components/rules/RuleDetailsMatchingInstances.tsx index 7a7e5d8b22c..b24567c547c 100644 --- a/public/app/features/alerting/unified/components/rules/RuleDetailsMatchingInstances.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleDetailsMatchingInstances.tsx @@ -40,26 +40,44 @@ interface ShowMoreInstancesProps { stats: ShowMoreStats; onClick?: React.ComponentProps['onClick']; href?: React.ComponentProps['href']; + enableFiltering?: boolean; + alertState?: InstanceStateFilter; } -function ShowMoreInstances({ stats, onClick, href }: ShowMoreInstancesProps) { +function ShowMoreInstances({ stats, onClick, href, enableFiltering, alertState }: ShowMoreInstancesProps) { const styles = useStyles2(getStyles); const { visibleItemsCount, totalItemsCount } = stats; return (
- - Showing {{ visibleItemsCount }} out of {{ totalItemsCount }} instances - + {enableFiltering && alertState ? ( + + Showing {{ visibleItemsCount }} {{ alertState }} out of {{ totalItemsCount }} instances + + ) : ( + + Showing {{ visibleItemsCount }} out of {{ totalItemsCount }} instances + + )}
- - Show all {{ totalItemsCount }} alert instances - + {enableFiltering ? ( + Show all + ) : ( + + Show all {{ totalItemsCount }} alert instances + + )}
); @@ -128,6 +146,8 @@ export function RuleDetailsMatchingInstances(props: Props) { stats={stats} onClick={enableFiltering ? resetFilter : undefined} href={!enableFiltering ? ruleViewPageLink : undefined} + enableFiltering={enableFiltering} + alertState={alertState} /> ) : undefined; diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 3ced02e0c08..bdf7943f90e 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -2334,8 +2334,10 @@ "label-tenant-sources": "Tenant sources" }, "rule-details-matching-instances": { - "button-show-all": "Show all {{totalItemsCount}} alert instances", - "showing-count": "Showing {{visibleItemsCount}} out of {{totalItemsCount}} instances" + "button-show-all": "Show all", + "button-show-all-instances": "Show all {{totalItemsCount}} alert instances", + "showing-count": "Showing {{visibleItemsCount}} out of {{totalItemsCount}} instances", + "showing-count-with-state": "Showing {{visibleItemsCount}} {{alertState}} out of {{totalItemsCount}} instances" }, "rule-editor": { "get-content": {