grafana icon indicating copy to clipboard operation
grafana copied to clipboard

Alerting: Fix max alerts

Open gillesdemey opened this issue 10 months ago • 4 comments

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.

image

gillesdemey avatar May 02 '24 17:05 gillesdemey

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.