Skip to content

Commit

Permalink
[UXD][AAP-25027] AWX - updates to Projects section breadcrumbs & head…
Browse files Browse the repository at this point in the history
…ers (#2721)
  • Loading branch information
tiyiprh authored Aug 12, 2024
1 parent d2f3f2d commit 6e083a8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/awx/resources/projects/project-details.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ describe('Projects', () => {
cy.get(`[data-cy="row-id-${thisProject.id}"]`).within(() => {
cy.get('[data-cy="name-column-cell"]').click();
});
cy.clickTab('Job templates', true);
cy.clickTab('Job Templates', true);
cy.url().should(
'contain',
`/projects/${thisProject.id}/job-templates?page=1&perPage=10&sort=name`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Project Edit, Copy, Sync', () => {
cy.get(`[data-cy="row-id-${project.id}"]`).within(() => {
cy.get('[data-cy="edit-project"]').click();
});
cy.verifyPageTitle('Edit Project');
cy.verifyPageTitle(`Edit ${project.name}`);
cy.get('[data-cy="name"]').should('have.value', `${project.name}`);
cy.get('[data-cy="name"]').clear().type(`${project.name} - edited`);
cy.intercept('PATCH', awxAPI`/projects/${project.id.toString()}/`).as('edited');
Expand All @@ -52,7 +52,7 @@ describe('Project Edit, Copy, Sync', () => {
cy.clickTableRowLink('name', project.name, { disableFilter: true });
cy.verifyPageTitle(project.name);
cy.clickButton(/^Edit project$/);
cy.verifyPageTitle('Edit Project');
cy.verifyPageTitle(`Edit ${project.name}`);
cy.get('[data-cy="name"]').clear().type(`${project.name} - edited`);
cy.intercept('PATCH', awxAPI`/projects/${project.id.toString()}/`).as('edited');
cy.clickButton(/^Save project$/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('ProjectForm.cy.ts', () => {
cy.contains('Name is required.').should('be.visible');
cy.contains('Organization is required.').should('be.visible');
cy.contains('Source control type is required.').should('be.visible');
cy.verifyPageTitle('Create Project');
cy.verifyPageTitle('Create project');
});

it('validates required field for source control types', () => {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('ProjectForm.cy.ts', () => {
);
cy.intercept('PATCH', 'api/v2/projects/*', { statusCode: 201 }).as('editProject');
cy.mount(<EditProject />);
cy.verifyPageTitle('Edit Project');
cy.verifyPageTitle('Edit Demo Project @ 10:44:51');
cy.getByDataCy('name').should('have.value', 'Demo Project @ 10:44:51');
cy.getByDataCy('organization').should('have.text', 'Default');
cy.getByDataCy('signature_validation_credential').should('have.text', 'Select credential');
Expand Down
14 changes: 10 additions & 4 deletions frontend/awx/resources/projects/ProjectPage/ProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export function CreateProject() {
return (
<PageLayout>
<PageHeader
title={t('Create Project')}
title={t('Create project')}
breadcrumbs={[
{ label: t('Projects'), to: getPageUrl(AwxRoute.Projects) },
{ label: t('Create Project') },
{ label: t('Create project') },
]}
/>
<AwxPageForm
Expand Down Expand Up @@ -128,10 +128,16 @@ export function EditProject() {
return (
<PageLayout>
<PageHeader
title={t('Edit Project')}
title={
project?.name ? t('Edit {{projectName}}', { projectName: project?.name }) : t('Project')
}
breadcrumbs={[
{ label: t('Projects'), to: getPageUrl(AwxRoute.Projects) },
{ label: t('Edit Project') },
{
label: project?.name
? t('Edit {{projectName}}', { projectName: project?.name })
: t('Project'),
},
]}
/>
<AwxPageForm<Project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ProjectPage() {
const tabs = [
{ label: t('Details'), page: AwxRoute.ProjectDetails },
{ label: t('Schedules'), page: AwxRoute.ProjectSchedules },
{ label: t('Job templates'), page: AwxRoute.ProjectJobTemplates },
{ label: t('Job Templates'), page: AwxRoute.ProjectJobTemplates },
{ label: t('User Access'), page: AwxRoute.ProjectUsers },
{ label: t('Team Access'), page: AwxRoute.ProjectTeams },
];
Expand Down

0 comments on commit 6e083a8

Please sign in to comment.