From ec1f4e5803b006990bd3dcfeece065afce275c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 21 Sep 2020 10:47:06 +0100 Subject: [PATCH] [APM] Anomaly detection Settings page: Link directly to ML jobs management to filter for the select environment (#77875) Co-authored-by: Elastic Machine --- .../components/app/Settings/anomaly_detection/jobs_list.tsx | 2 +- .../shared/Links/MachineLearningLinks/MLLink.test.tsx | 2 +- .../components/shared/Links/MachineLearningLinks/MLLink.tsx | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx index 05ea585108c69..6e95df0dddd84 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx @@ -97,7 +97,7 @@ export function JobsList({ data, status, onAddEnvironments }: Props) { defaultMessage="To add anomaly detection to a new environment, create a machine learning job. Existing machine learning jobs can be managed in {mlJobsLink}." values={{ mlJobsLink: ( - + {i18n.translate( 'xpack.apm.settings.anomalyDetection.jobList.mlDescriptionText.mlJobsLinkText', { diff --git a/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx index da345e35c10b1..4eb886509805d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx @@ -21,6 +21,6 @@ test('MLLink produces the correct URL', async () => { ); expect(href).toMatchInlineSnapshot( - `"/basepath/app/ml#/some/path?_g=(ml:(jobIds:!(something)),refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"` + `"/basepath/app/ml#/some/path?_g=(ml:(jobIds:!(something)),refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))&mlManagement=(groupIds:!(apm))"` ); }); diff --git a/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.tsx b/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.tsx index d8ec212515c6f..93ee9e0db4864 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.tsx @@ -39,7 +39,9 @@ export function MLLink({ children, path = '', query = {}, external }: Props) { const href = url.format({ pathname: core.http.basePath.prepend('/app/ml'), - hash: `${path}?_g=${rison.encode(risonQuery as RisonValue)}`, + hash: `${path}?_g=${rison.encode( + risonQuery as RisonValue + )}&mlManagement=${rison.encode({ groupIds: ['apm'] })}`, }); return (