1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

Fix nested project schedule breadcrumb

This commit is contained in:
Marliana Lara 2020-03-18 13:17:42 -04:00
parent e210ee4077
commit eb28800082
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE

View File

@ -24,13 +24,15 @@ class Projects extends Component {
};
}
setBreadcrumbConfig = project => {
setBreadcrumbConfig = (project, nested) => {
const { i18n } = this.props;
if (!project) {
return;
}
const projectSchedulesPath = `/projects/${project.id}/schedules`;
const breadcrumbConfig = {
'/projects': i18n._(t`Projects`),
'/projects/add': i18n._(t`Create New Project`),
@ -40,7 +42,12 @@ class Projects extends Component {
[`/projects/${project.id}/access`]: i18n._(t`Access`),
[`/projects/${project.id}/notifications`]: i18n._(t`Notifications`),
[`/projects/${project.id}/job_templates`]: i18n._(t`Job Templates`),
[`/projects/${project.id}/schedules`]: i18n._(t`Schedules`),
[`${projectSchedulesPath}`]: i18n._(t`Schedules`),
[`${projectSchedulesPath}/${nested?.id}`]: `${nested?.name}`,
[`${projectSchedulesPath}/${nested?.id}/details`]: i18n._(
t`Edit Details`
),
};
this.setState({ breadcrumbConfig });