grafana
grafana copied to clipboard
Alerting: Fix max alerts
Fixes a small regression from https://github.com/grafana/grafana/pull/86651 that would not allow creation of new webhook receivers if max alerts
was empty.
In the scenario where the user did not fill in the field, setValueAs
would return NaN
and this in turn would fail the validationRule
regular expression.
This PR changes the behaviour to cast to a Number with the Number
constructor (which returns 0
on undefined | ""
) but can still return NaN
– so we also check if the result is finite.
This PR must be merged before a backport PR will be created.
This PR must be merged before a backport PR will be created.
This PR must be merged before a backport PR will be created.
This PR must be merged before a backport PR will be created.