-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure analytics can handle jobid in url. rename util function
- Loading branch information
1 parent
0e4f2ed
commit 148ab2a
Showing
7 changed files
with
55 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
x-pack/plugins/ml/public/application/util/get_job_id_url.ts
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/ml/public/application/util/get_selected_ids_url.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import rison from 'rison-node'; | ||
|
||
import { getBasePath } from './dependency_cache'; | ||
|
||
export enum TAB_IDS { | ||
DATA_FRAME_ANALYTICS = 'data_frame_analytics', | ||
ANOMALY_DETECTION = 'jobs', | ||
} | ||
|
||
export function getSelectedIdsUrl( | ||
tabId: string, | ||
ids: string | string[], | ||
isGroup: boolean = false | ||
): string { | ||
// Create url for filtering by job id or group ids for kibana management table | ||
const settings = { | ||
[isGroup ? 'groupIds' : 'jobId']: Array.isArray(ids) ? ids : [ids], | ||
}; | ||
const encoded = rison.encode(settings); | ||
const url = `?mlManagement=${encoded}`; | ||
const basePath = getBasePath(); | ||
|
||
return `${basePath.get()}/app/ml#/${tabId}${url}`; | ||
} |