-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Add linking to dataframe from job management tab #65778
Changes from 4 commits
e6b425e
56b740a
1ec4fde
484b645
58f66a4
7f6ec89
ea3af55
0159072
f3c8367
32dbd1f
4004469
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,7 +367,7 @@ function jobProperty(job, prop) { | |
return job[propMap[prop]]; | ||
} | ||
|
||
export function getJobIdUrl(jobId) { | ||
export function getJobIdUrl(tabId, jobId) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be moved to a common directory since it's shared (maybe Could just create a new ts file with the name of the function with only that function in that file (like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved this |
||
// Create url for filtering by job id for kibana management table | ||
const settings = { | ||
jobId, | ||
|
@@ -376,7 +376,7 @@ export function getJobIdUrl(jobId) { | |
const url = `?mlManagement=${encoded}`; | ||
const basePath = getBasePath(); | ||
|
||
return `${basePath.get()}/app/ml#/jobs${url}`; | ||
return `${basePath.get()}/app/ml#/${tabId}${url}`; | ||
} | ||
|
||
function getUrlVars(url) { | ||
|
@@ -408,3 +408,15 @@ export function clearSelectedJobIdFromUrl(url) { | |
} | ||
} | ||
} | ||
|
||
export function resetMlJobUrl(tabId, url) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this being used anywhere. Unless I'm missing something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I originally did this in case we want to reset the window's url after navigating to the page, but since it's not needed, I have deleted this in f3c8367. |
||
// Change current window's url to just the generic tab url without the job ID | ||
if (typeof url === 'string') { | ||
url = decodeURIComponent(url); | ||
if (url.includes('mlManagement') && url.includes('jobId')) { | ||
const urlParams = getUrlVars(url); | ||
const clearedParams = `ml#/${tabId}?_g=${urlParams._g}`; | ||
window.history.replaceState({}, document.title, clearedParams); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this could be implicit return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to implicit return in f3c8367#diff-5c7fbd428261fc2fd9567311e2e7046cL141.