Skip to content

Commit

Permalink
[ML] url generator to support both job and group ids
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Nov 12, 2020
1 parent b48ab5b commit 593cd83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ test('MLLink produces the correct URL', async () => {
);

expect(href).toMatchInlineSnapshot(
`"/app/ml/jobs?_a=(queryText:'groups:(apm)')&_g=(refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"`
`"/app/ml/jobs?_a=(queryText:'id:(something)%20groups:(apm)')&_g=(refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"`
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export function createAnomalyDetectionJobManagementUrl(
}
const { jobId, groupIds, globalState } = params;
if (jobId || groupIds) {
let queryText;
const queryTextArr = [];
if (jobId) {
queryText = getJobQueryText(jobId);
queryTextArr.push(getJobQueryText(jobId));
}
if (groupIds) {
queryText = getGroupQueryText(groupIds);
queryTextArr.push(getGroupQueryText(groupIds));
}
const queryState: Partial<AnomalyDetectionJobsListState> = {
queryText,
...(queryTextArr.length > 0 ? { queryText: queryTextArr.join(' ') } : {}),
};

url = setStateToKbnUrl<Partial<AnomalyDetectionJobsListState>>(
Expand Down

0 comments on commit 593cd83

Please sign in to comment.