mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] Stop Job should show when ml job toggle is on (#146407)](https://github.com/elastic/kibana/pull/146407) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2022-11-28T16:47:29Z","message":"[Security Solution] Stop Job should show when ml job toggle is on (#146407)\n\n## Summary\r\n\r\nThis PR fixes incorrect wording of the ML Job run/stop status label.\r\nRight now we always show \"Run job\" label even when job has been started\r\nalready. With this fix we will show \"Stop job\" in case of running job.\r\n\r\nJob is not running state:\r\n\r\n<img width=\"782\" alt=\"Screenshot 2022-11-28 at 15 55 37\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308912-b53fa125-715a-4240-b6a3-e75be68d4251.png\">\r\n\r\nJob is running state:\r\n\r\n<img width=\"785\" alt=\"Screenshot 2022-11-28 at 15 55 29\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308956-c0fb7cae-8c95-4f26-8bae-ddff3e44a214.png\">\r\n\r\nTicket: #145324","sha":"3c30b3f8ce58da3316959a3bee36d89d6fcc2103","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: SecuritySolution","Team:Detection Alerts","backport:prev-minor","ci:cloud-deploy","v8.7.0"],"number":146407,"url":"https://github.com/elastic/kibana/pull/146407","mergeCommit":{"message":"[Security Solution] Stop Job should show when ml job toggle is on (#146407)\n\n## Summary\r\n\r\nThis PR fixes incorrect wording of the ML Job run/stop status label.\r\nRight now we always show \"Run job\" label even when job has been started\r\nalready. With this fix we will show \"Stop job\" in case of running job.\r\n\r\nJob is not running state:\r\n\r\n<img width=\"782\" alt=\"Screenshot 2022-11-28 at 15 55 37\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308912-b53fa125-715a-4240-b6a3-e75be68d4251.png\">\r\n\r\nJob is running state:\r\n\r\n<img width=\"785\" alt=\"Screenshot 2022-11-28 at 15 55 29\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308956-c0fb7cae-8c95-4f26-8bae-ddff3e44a214.png\">\r\n\r\nTicket: #145324","sha":"3c30b3f8ce58da3316959a3bee36d89d6fcc2103"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146407","number":146407,"mergeCommit":{"message":"[Security Solution] Stop Job should show when ml job toggle is on (#146407)\n\n## Summary\r\n\r\nThis PR fixes incorrect wording of the ML Job run/stop status label.\r\nRight now we always show \"Run job\" label even when job has been started\r\nalready. With this fix we will show \"Stop job\" in case of running job.\r\n\r\nJob is not running state:\r\n\r\n<img width=\"782\" alt=\"Screenshot 2022-11-28 at 15 55 37\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308912-b53fa125-715a-4240-b6a3-e75be68d4251.png\">\r\n\r\nJob is running state:\r\n\r\n<img width=\"785\" alt=\"Screenshot 2022-11-28 at 15 55 29\"\r\nsrc=\"https://user-images.githubusercontent.com/2700761/204308956-c0fb7cae-8c95-4f26-8bae-ddff3e44a214.png\">\r\n\r\nTicket: #145324","sha":"3c30b3f8ce58da3316959a3bee36d89d6fcc2103"}}]}] BACKPORT--> Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
This commit is contained in:
parent
1efd35e46d
commit
d3c8d82a88
2 changed files with 10 additions and 4 deletions
|
@ -93,6 +93,7 @@ const MlJobDescriptionComponent: React.FC<{
|
|||
});
|
||||
|
||||
const jobIdSpan = <span data-test-subj="machineLearningJobId">{jobId}</span>;
|
||||
const isStarted = isJobStarted(job.jobState, job.datafeedState);
|
||||
|
||||
const handleJobStateChange = useCallback(
|
||||
async (_, latestTimestampMs: number, enable: boolean) => {
|
||||
|
@ -102,7 +103,7 @@ const MlJobDescriptionComponent: React.FC<{
|
|||
[enableDatafeed, job, refreshJob]
|
||||
);
|
||||
|
||||
return job != null ? (
|
||||
return (
|
||||
<Wrapper>
|
||||
<div>
|
||||
<JobLink href={jobUrl} target="_blank">
|
||||
|
@ -122,12 +123,10 @@ const MlJobDescriptionComponent: React.FC<{
|
|||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false} style={{ marginLeft: '0' }}>
|
||||
{i18n.ML_RUN_JOB_LABEL}
|
||||
{isStarted ? i18n.ML_STOP_JOB_LABEL : i18n.ML_RUN_JOB_LABEL}
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</Wrapper>
|
||||
) : (
|
||||
jobIdSpan
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -98,6 +98,13 @@ export const ML_RUN_JOB_LABEL = i18n.translate(
|
|||
}
|
||||
);
|
||||
|
||||
export const ML_STOP_JOB_LABEL = i18n.translate(
|
||||
'xpack.securitySolution.detectionEngine.ruleDescription.mlStopJobLabel',
|
||||
{
|
||||
defaultMessage: 'Stop job',
|
||||
}
|
||||
);
|
||||
|
||||
export const ML_JOB_STARTED = i18n.translate(
|
||||
'xpack.securitySolution.detectionEngine.ruleDescription.mlJobStartedDescription',
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue