mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML][Rules] Fixes deletion in Check interval input for anomaly detection rule (#193420)
## Summary It was trying to parse `null` values. After:  Fixes [#190732](https://github.com/elastic/kibana/issues/190732) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9f67292bca
commit
65b7bf9586
1 changed files with 5 additions and 2 deletions
|
@ -32,13 +32,15 @@ export const ConfigValidator: FC<ConfigValidatorProps> = React.memo(
|
|||
({ jobConfigs = [], alertInterval, alertParams, alertNotifyWhen, maxNumberOfBuckets }) => {
|
||||
if (jobConfigs.length === 0) return null;
|
||||
|
||||
const alertIntervalInSeconds = parseInterval(alertInterval)!.asSeconds();
|
||||
const alertIntervalInSeconds = parseInterval(alertInterval)?.asSeconds();
|
||||
|
||||
const lookbackIntervalInSeconds =
|
||||
!!alertParams.lookbackInterval && parseInterval(alertParams.lookbackInterval)?.asSeconds();
|
||||
|
||||
const isAlertIntervalTooHigh =
|
||||
lookbackIntervalInSeconds && lookbackIntervalInSeconds < alertIntervalInSeconds;
|
||||
lookbackIntervalInSeconds &&
|
||||
alertIntervalInSeconds &&
|
||||
lookbackIntervalInSeconds < alertIntervalInSeconds;
|
||||
|
||||
const jobWithoutStartedDatafeed = jobConfigs
|
||||
.filter((job) => job.datafeed_config.state !== DATAFEED_STATE.STARTED)
|
||||
|
@ -49,6 +51,7 @@ export const ConfigValidator: FC<ConfigValidatorProps> = React.memo(
|
|||
const notifyWhenWarning =
|
||||
alertNotifyWhen === 'onActiveAlert' &&
|
||||
lookbackIntervalInSeconds &&
|
||||
alertIntervalInSeconds &&
|
||||
alertIntervalInSeconds < lookbackIntervalInSeconds;
|
||||
|
||||
const bucketSpanDuration = parseInterval(jobConfigs[0].analysis_config.bucket_span!);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue