Skip to content

Commit

Permalink
[Security Solution] ML job enchancement: update warning message (#147550
Browse files Browse the repository at this point in the history
)

## Summary

These changes update the wording around the ML job selection in ML rule.
As we gonna try to start selected job/s in case those are not running,
we should accordingly mention that in the callout below the job
selection combobox.

Slack
[discussion](https://elastic.slack.com/archives/C03DXS9UZDF/p1670950300234779)

Main ticket:
[#1912](elastic/security-team#1912)

<img width="1860" alt="Screenshot 2022-12-14 at 17 50 48"
src="https://user-images.githubusercontent.com/2700761/207658080-deb81240-3643-4634-aa01-0c9dee59c3b2.png">

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
e40pud and kibanamachine authored Dec 14, 2022
1 parent d6aebef commit b74e7f9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import { EuiIcon, EuiLink, EuiText } from '@elastic/eui';
import { EuiLink, EuiText } from '@elastic/eui';
import styled from 'styled-components';

import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -36,21 +36,20 @@ const HelpTextComponent: React.FC<{ href: string; notRunningJobIds: string[] }>
/>
{notRunningJobIds.length > 0 && (
<HelpTextWarningContainer data-test-subj="ml-warning-not-running-jobs">
<EuiText size="xs" color="warning">
<EuiIcon type="alert" />
<EuiText size="xs">
<span>
{notRunningJobIds.length === 1 ? (
<FormattedMessage
id="xpack.securitySolution.detectionEngine.createRule.stepDefineRule.mlEnableJobSingle"
defaultMessage="The selected ML job, {jobName}, is not currently running. Please set {jobName} to run via 'ML job settings' before enabling this rule."
defaultMessage="The selected ML job, {jobName}, is not currently running. We will start {jobName} when you enable this rule."
values={{
jobName: notRunningJobIds[0],
}}
/>
) : (
<FormattedMessage
id="xpack.securitySolution.detectionEngine.createRule.stepDefineRule.mlEnableJobMulti"
defaultMessage="The selected ML jobs, {jobNames}, are not currently running. Please set all of these jobs to run via 'ML job settings' before enabling this rule."
defaultMessage="The selected ML jobs, {jobNames}, are not currently running. We will start all of these jobs when you enable this rule."
values={{
jobNames: notRunningJobIds.reduce(
(acc, value, i, array) => acc + (i < array.length - 1 ? ', ' : ', and ') + value
Expand Down

0 comments on commit b74e7f9

Please sign in to comment.