mirror of
https://github.com/ansible/awx.git
synced 2026-01-24 07:51:23 -03:30
fix job detail breadcrumbs
This commit is contained in:
parent
552164c25c
commit
e3d67117e7
@ -6,19 +6,10 @@ import {
|
||||
DataListItemCells,
|
||||
DataListCheck,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import DataListCell from '@components/DataListCell';
|
||||
import VerticalSeparator from '@components/VerticalSeparator';
|
||||
import { toTitleCase } from '@util/strings';
|
||||
|
||||
const JOB_TYPE_URLS = {
|
||||
job: 'playbook',
|
||||
project_update: 'project',
|
||||
system_job: 'system',
|
||||
inventory_update: 'inventory',
|
||||
ad_hoc_command: 'command',
|
||||
workflow_job: 'workflow',
|
||||
};
|
||||
import { JOB_TYPE_URLS } from '../constants';
|
||||
|
||||
class JobListItem extends Component {
|
||||
render() {
|
||||
|
||||
@ -2,11 +2,10 @@ import React, { Component, Fragment } from 'react';
|
||||
import { Route, withRouter, Switch } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
import Breadcrumbs from '@components/Breadcrumbs/Breadcrumbs';
|
||||
|
||||
import Job from './Job';
|
||||
import JobList from './JobList/JobList';
|
||||
import { JOB_TYPE_URLS } from './constants';
|
||||
|
||||
class Jobs extends Component {
|
||||
constructor(props) {
|
||||
@ -28,11 +27,12 @@ class Jobs extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const type =JOB_TYPE_URLS[job.type];
|
||||
const breadcrumbConfig = {
|
||||
'/jobs': i18n._(t`Jobs`),
|
||||
[`/jobs/${job.id}`]: `${job.name}`,
|
||||
[`/jobs/${job.id}/details`]: i18n._(t`Details`),
|
||||
[`/jobs/${job.id}/output`]: i18n._(t`Output`),
|
||||
[`/jobs/${type}/${job.id}`]: `${job.name}`,
|
||||
[`/jobs/${type}/${job.id}/details`]: i18n._(t`Details`),
|
||||
[`/jobs/${type}/${job.id}/output`]: i18n._(t`Output`),
|
||||
};
|
||||
|
||||
this.setState({ breadcrumbConfig });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user