Skip to content

Commit

Permalink
[ML] Add linking to df analytics job list from management tab
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed May 12, 2020
1 parent e6b425e commit 56b740a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
EuiLink,
RIGHT_ALIGNMENT,
} from '@elastic/eui';
// @ts-ignore
import { getJobIdUrl } from '../../../../../jobs/jobs_list/components/utils';

import { getAnalysisType, DataFrameAnalyticsId } from '../../../../common';
import { getResultsUrl } from './common';
Expand Down Expand Up @@ -136,11 +138,7 @@ export const progressColumn = {
};

export const getDFAnalyticsJobIdLink = (item: DataFrameAnalyticsListRow) => {
return (
<EuiLink href={getResultsUrl(item.id, getAnalysisType(item.config.analysis))}>
{item.id}
</EuiLink>
);
return <EuiLink href={getJobIdUrl('data_frame_analytics', item.id)}>{item.id}</EuiLink>;
};

export const getColumns = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class JobsList extends Component {
return id;
}

return <EuiLink href={getJobIdUrl(id)}>{id}</EuiLink>;
return <EuiLink href={getJobIdUrl('jobs', id)}>{id}</EuiLink>;
}

getPageOfJobs(index, size, sortField, sortDirection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function jobProperty(job, prop) {
return job[propMap[prop]];
}

export function getJobIdUrl(jobId) {
export function getJobIdUrl(tabId, jobId) {
// Create url for filtering by job id for kibana management table
const settings = {
jobId,
Expand All @@ -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) {
Expand Down

0 comments on commit 56b740a

Please sign in to comment.