Skip to content

Commit

Permalink
[UXD][AAP-25468] AWX - updates to Teams section buttons and actions (#…
Browse files Browse the repository at this point in the history
…2747)

Co-authored-by: Maeve Hoffer <[email protected]>
  • Loading branch information
tiyiprh and daphnemaeve authored Aug 26, 2024
1 parent 9d7bbbe commit 569782d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/awx/access/teams/teams.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ cyLabel(['upstream'], () => {
id: team.summary_fields.object_roles.member_role.id,
});
cy.filterTableBySingleSelect('name', team.name);
cy.clickTableRowAction('name', team.name, 'remove-users', {
cy.clickTableRowAction('name', team.name, 'remove-users-from-teams', {
inKebab: true,
disableFilter: true,
});
Expand Down Expand Up @@ -283,7 +283,7 @@ cyLabel(['upstream'], () => {
cy.filterTableByMultiSelect('name', arrayOfElementText);
cy.get('tbody tr').should('have.length', 5);
cy.getByDataCy('select-all').click();
cy.clickToolbarKebabAction('delete-selected-teams');
cy.clickToolbarKebabAction('delete-teams');
cy.get('#confirm').click();
cy.intercept('DELETE', awxAPI`/teams/*/`).as('deleted');
cy.clickButton(/^Delete team/);
Expand Down
2 changes: 1 addition & 1 deletion frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('TeamAccess', () => {
// Remove users
cy.selectTableRow('admin', false); // User cannot be removed as they are a system administrator
cy.selectTableRow('user-2', false);
cy.clickToolbarKebabAction('remove-users');
cy.clickToolbarKebabAction('remove-users-from-teams');
// Confirmation modal is displayed with a warning
cy.get('.pf-v5-c-modal-box').within(() => {
cy.hasAlert(
Expand Down
2 changes: 1 addition & 1 deletion frontend/awx/access/teams/Teams.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Teams.cy.ts', () => {
cy.intercept({ method: 'GET', url: '/api/v2/teams/*' }, { fixture: 'teams.json' });
cy.mount(<Teams />);
cy.get('[type="checkbox"][id="select-all"]').check();
cy.clickToolbarKebabAction('delete-selected-teams');
cy.clickToolbarKebabAction('delete-teams');
cy.contains(
'1 of the selected teams cannot be deleted due to insufficient permissions.'
).should('be.visible');
Expand Down
4 changes: 2 additions & 2 deletions frontend/awx/access/teams/hooks/useTeamActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ export function useTeamActions(options: {
type: PageActionType.Button,
selection: PageActionSelection.Single,
icon: PlusCircleIcon,
label: t('Add users'),
label: t('Add users to teams'),
isDisabled: (team: Team) => cannotAddUsers(team),
onClick: (team) => selectUsersAddTeams([team]),
},
{
type: PageActionType.Button,
selection: PageActionSelection.Single,
icon: MinusCircleIcon,
label: t('Remove users'),
label: t('Remove users from teams'),
isDisabled: (team: Team) => cannotRemoveUsers(team),
onClick: (team) => selectAndRemoveUsersFromTeam(team),
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function useTeamToolbarActions(view: IAwxView<Team>) {
type: PageActionType.Button,
selection: PageActionSelection.Multiple,
icon: PlusCircleIcon,
label: t('Add users to selected teams'),
label: t('Add users to teams'),
onClick: () => selectUsersAddTeams(view.selectedItems),
},
{
Expand All @@ -62,7 +62,7 @@ export function useTeamToolbarActions(view: IAwxView<Team>) {
type: PageActionType.Button,
selection: PageActionSelection.Multiple,
icon: TrashIcon,
label: t('Delete selected teams'),
label: t('Delete teams'),
onClick: deleteTeams,
isDanger: true,
},
Expand Down

0 comments on commit 569782d

Please sign in to comment.