mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Detection Engine] Prevent ML job status warning from being displayed for non-ML rule types (#189003)
Followup to https://github.com/elastic/kibana/pull/188267. A demo instance with these changes can be found [here](https://rylnd-pr-189003-fix-sticky-ml-warning.kbndev.co/app/security/rules/create). When not all ML jobs are started, we display a message conveying that the list of suppression fields might not be complete. In the case of a non-ML rule, this warning isn't helpful and should be hidden. It also only shows the warning if one more more ML jobs have been selected.
This commit is contained in:
parent
42c5d918d3
commit
7aec3f775c
1 changed files with 4 additions and 1 deletions
|
@ -209,6 +209,9 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
|
|||
mlSuppressionFields,
|
||||
} = useMLRuleConfig({ machineLearningJobId });
|
||||
|
||||
const isMlSuppressionIncomplete =
|
||||
isMlRule(ruleType) && machineLearningJobId?.length > 0 && !allJobsStarted;
|
||||
|
||||
const esqlQueryRef = useRef<DefineStepRule['queryBar'] | undefined>(undefined);
|
||||
|
||||
const isAlertSuppressionLicenseValid = license.isAtLeast(MINIMUM_LICENSE_FOR_SUPPRESSION);
|
||||
|
@ -1087,7 +1090,7 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
|
|||
disabledText: suppressionGroupByDisabledText,
|
||||
}}
|
||||
/>
|
||||
{!allJobsStarted && (
|
||||
{isMlSuppressionIncomplete && (
|
||||
<EuiText size="xs" color="warning">
|
||||
{i18n.MACHINE_LEARNING_SUPPRESSION_INCOMPLETE_LABEL}
|
||||
</EuiText>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue