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