Merge pull request #6331 from marshmalien/fix-project-schedule-breadcrumb

Add nested project schedule detail breadcrumb

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-03-18 19:33:19 +00:00 committed by GitHub
commit 64139f960f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 });