Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[APM] Anomaly detection Settings page: Link directly to ML jobs manag…
Browse files Browse the repository at this point in the history
…ement to filter for the select environment (elastic#77875)

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
cauemarcondes and elasticmachine authored Sep 21, 2020
1 parent 53142d8 commit ec1f4e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: (
<MLLink path="jobs">
<MLLink path="/jobs">
{i18n.translate(
'xpack.apm.settings.anomalyDetection.jobList.mlDescriptionText.mlJobsLinkText',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))"`
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit ec1f4e5

Please sign in to comment.