mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[RAM] Fix error message flash and throttle value reset (#154497)
## Summary Fixes #152943 - Error message will no longer flash when switching notify when to `On custom action intervals` - Switching away and back to `On custom action intervals` will preserve the throttle value as well as the throttle unit
This commit is contained in:
parent
b6a113ccfa
commit
04f1be1edd
2 changed files with 6 additions and 3 deletions
|
@ -258,8 +258,10 @@ export const ActionTypeForm = ({
|
|||
)}
|
||||
onThrottleChange={useCallback(
|
||||
(throttle: number | null, throttleUnit: string) => {
|
||||
setActionThrottle(throttle);
|
||||
setActionThrottleUnit(throttleUnit);
|
||||
if (throttle) {
|
||||
setActionThrottle(throttle);
|
||||
setActionThrottleUnit(throttleUnit);
|
||||
}
|
||||
setActionFrequencyProperty(
|
||||
'throttle',
|
||||
throttle ? `${throttle}${throttleUnit}` : null,
|
||||
|
|
|
@ -60,7 +60,8 @@ export function validateBaseProperties(
|
|||
}
|
||||
|
||||
const invalidThrottleActions = ruleObject.actions.filter((a) => {
|
||||
const throttleDuration = a.frequency?.throttle ? parseDuration(a.frequency.throttle) : 0;
|
||||
if (!a.frequency?.throttle) return false;
|
||||
const throttleDuration = parseDuration(a.frequency.throttle);
|
||||
const intervalDuration =
|
||||
ruleObject.schedule.interval && ruleObject.schedule.interval.length > 1
|
||||
? parseDuration(ruleObject.schedule.interval)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue