Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UXD][AAP-25027] AWX - updates to Credentials & Cred Types section breadcrumbs & headers #2735

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('Credential Types', () => {
cy.navigateTo('awx', 'credential-types');
cy.filterTableByMultiSelect('name', [credType1.name]);
cy.getByDataCy('edit-credential-type').click();
cy.verifyPageTitle('Edit Credential Type');
cy.verifyPageTitle(`Edit ${credType1.name}`);
cy.url().should('contain', `/credential-types/${credType1.id}/edit`);
cy.getBy('[class*="view-lines monaco-mouse-cursor-text"]')
.eq(0)
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('Credential Types', () => {
const editedCredentialTypeName = (credType1.name ?? '') + ' edited';
cy.filterTableByMultiSelect('name', [credType1.name]);
cy.clickTableRowPinnedAction(credType1.name, 'edit-credential-type', false);
cy.verifyPageTitle('Edit Credential Type');
cy.verifyPageTitle(`Edit ${credType1.name}`);
cy.url().then((currentUrl) => {
expect(currentUrl.includes('edit')).to.be.true;
});
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('Credential Types', () => {
cy.filterTableByMultiSelect('name', [credType1.name]);
cy.clickTableRowLink('name', credType1.name, { disableFilter: true });
cy.clickButton('Edit credential type');
cy.verifyPageTitle('Edit Credential Type');
cy.verifyPageTitle(`Edit ${credType1.name}`);
cy.get('[data-cy="name"]').clear().type(editedCredentialTypeName);
cy.get('[data-cy="description"]').clear().type('this is a new description after editing');
cy.intercept('PATCH', awxAPI`/credential_types/${credType1.id.toString()}/`).as(
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/awx/access/credentials/credentials.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Credentials', () => {
cy.get(`[data-cy="row-id-${credential.id}"]`).within(() => {
cy.getByDataCy('edit-credential').click();
});
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credential.name}`);
cy.getByDataCy('name').clear().type(`${credential.name} - edited`);
cy.clickButton(/^Save credential$/);
cy.clearAllFilters();
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('Credentials', () => {
disableFilter: true,
});
cy.clickButton(/^Edit credential$/);
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credential.name}`);
cy.getByDataCy('name')
.clear()
.type(credential.name + '-edited');
Expand Down Expand Up @@ -415,7 +415,7 @@ describe('Credentials: Credential Types Tests', () => {
cy.contains('Vault Password').should('be.visible');
cy.getByDataCy('vault-password').contains('Encrypted');
cy.getByDataCy('edit-credential').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.get('[data-cy="vault-password"]').then(($pwd) => {
cy.wrap($pwd).should('have.value', 'ENCRYPTED');
});
Expand Down Expand Up @@ -463,7 +463,7 @@ describe('Credentials: Credential Types Tests', () => {
cy.getByDataCy('label-description').contains('Description');
cy.getByDataCy('description').contains('description');
cy.getByDataCy('edit-credential').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
const ModifiedCredentialName = credentialName + ' - edited';
cy.getByDataCy('name').type(ModifiedCredentialName);
cy.get('input[data-cy="username"]').then(($username) => {
Expand Down Expand Up @@ -521,7 +521,7 @@ describe('Credentials: Credential Types Tests', () => {
cy.contains('Password').should('be.visible');
cy.getByDataCy('password').contains('Prompt on launch');
cy.getByDataCy('edit-credential').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.getByDataCy('ask_password').uncheck();
cy.getByDataCy('password').type('password');
cy.clickButton(/^Save credential$/);
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/awx-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Cypress.Commands.add(
const credentialTypeDesc = 'This is a custom credential type that is not managed';
cy.navigateTo('awx', 'credential-types');
cy.clickLink(/^Create credential type$/);
cy.verifyPageTitle('Create Credential Type');
cy.verifyPageTitle('Create credential type');
cy.url().then((currentUrl) => {
expect(currentUrl.includes('/credential-types/create')).to.be.true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('CredentialTypeForm.cy.ts', () => {

it('should preload the form with current values', () => {
cy.mount(<EditCredentialType />);
cy.verifyPageTitle('Edit Credential Type');
cy.verifyPageTitle('Edit Mock Credential Type');
cy.get('[data-cy="name"]').should('have.value', 'Mock Credential Type');
cy.get('[data-cy="description"]').should('have.value', 'mock credential type description');
cy.dataEditorShouldContain('[data-cy="inputs"]', credentialType.inputs);
Expand Down
16 changes: 12 additions & 4 deletions frontend/awx/access/credential-types/CredentialTypeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export function CreateCredentialType() {
return (
<PageLayout>
<PageHeader
title={t('Create Credential Type')}
title={t('Create credential type')}
breadcrumbs={[
{ label: t('Credential Types'), to: getPageUrl(AwxRoute.CredentialTypes) },
{ label: t('Create Credential Type') },
{ label: t('Create credential type') },
]}
/>
<AwxPageForm<CredentialType>
Expand Down Expand Up @@ -79,10 +79,18 @@ export function EditCredentialType() {
return (
<PageLayout>
<PageHeader
title={t('Edit Credential Type')}
title={
credentialType?.name
? t('Edit {{credentialtypeName}}', { credentialtypeName: credentialType?.name })
: t('Credential Types')
}
breadcrumbs={[
{ label: t('Credential Types'), to: getPageUrl(AwxRoute.CredentialTypes) },
{ label: t('Edit Credential Type') },
{
label: credentialType?.name
? t('Edit {{credentialtypeName}}', { credentialtypeName: credentialType?.name })
: t('Credential Types'),
},
]}
/>
{hasCredentialType && (
Expand Down
16 changes: 12 additions & 4 deletions frontend/awx/access/credentials/CredentialForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export function CreateCredential() {
return (
<PageLayout>
<PageHeader
title={t('Create Credential')}
title={t('Create credential')}
breadcrumbs={[
{ label: t('Credentials'), to: getPageUrl(AwxRoute.Credentials) },
{ label: t('Create Credential') },
{ label: t('Create credential') },
]}
/>
<AwxPageForm
Expand Down Expand Up @@ -429,10 +429,18 @@ export function EditCredential() {
return (
<PageLayout>
<PageHeader
title={t('Edit Credential')}
title={
credential?.name
? t('Edit {{credentialName}}', { credentialName: credential?.name })
: t('Credentials')
}
breadcrumbs={[
{ label: t('Credentials'), to: getPageUrl(AwxRoute.Credentials) },
{ label: t('Edit Credential') },
{
label: credential?.name
? t('Edit {{credentialName}}', { credentialName: credential?.name })
: t('Credentials'),
},
]}
/>
<AwxPageForm
Expand Down
Loading