[v10.4.x] Alerting: Fix max alerts (#87299)

Alerting: Fix max alerts (#87271)

(cherry picked from commit 12fa9e56e6)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-05-03 14:38:37 +03:00
committed by GitHub
co-authored by Gilles De Mey
parent 98b2b9fc32
commit cc9b0fc049
@@ -322,8 +322,12 @@ export const cloudNotifierTypes: Array<NotifierDTO<CloudNotifierType>> = [
'The maximum number of alerts to include in a single webhook message. Alerts above this threshold are truncated. When leaving this at its default value of 0, all alerts are included.',
{
placeholder: '0',
inputType: 'number',
validationRule: '(^\\d+$|^$)',
setValueAs: (value) => (typeof value === 'string' ? parseInt(value, 10) : 0),
setValueAs: (value) => {
const integer = Number(value);
return Number.isFinite(integer) ? integer : 0;
},
}
),
httpConfigOption,