From 569782d277453125e2e224008fe96bbdc3f5b65c Mon Sep 17 00:00:00 2001 From: Tina Yip <98424339+tiyiprh@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:10:12 -0400 Subject: [PATCH] [UXD][AAP-25468] AWX - updates to Teams section buttons and actions (#2747) Co-authored-by: Maeve Hoffer --- cypress/e2e/awx/access/teams/teams.cy.ts | 4 ++-- frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx | 2 +- frontend/awx/access/teams/Teams.cy.tsx | 2 +- frontend/awx/access/teams/hooks/useTeamActions.tsx | 4 ++-- frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/awx/access/teams/teams.cy.ts b/cypress/e2e/awx/access/teams/teams.cy.ts index 14bc0ee97f..c769ca3c6a 100644 --- a/cypress/e2e/awx/access/teams/teams.cy.ts +++ b/cypress/e2e/awx/access/teams/teams.cy.ts @@ -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, }); @@ -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/); diff --git a/frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx b/frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx index 00c2d101ab..293d0d610c 100644 --- a/frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx +++ b/frontend/awx/access/teams/TeamPage/TeamAccess.cy.tsx @@ -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( diff --git a/frontend/awx/access/teams/Teams.cy.tsx b/frontend/awx/access/teams/Teams.cy.tsx index 5868e54107..f7058cbb32 100644 --- a/frontend/awx/access/teams/Teams.cy.tsx +++ b/frontend/awx/access/teams/Teams.cy.tsx @@ -58,7 +58,7 @@ describe('Teams.cy.ts', () => { cy.intercept({ method: 'GET', url: '/api/v2/teams/*' }, { fixture: 'teams.json' }); cy.mount(); 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'); diff --git a/frontend/awx/access/teams/hooks/useTeamActions.tsx b/frontend/awx/access/teams/hooks/useTeamActions.tsx index 397d464996..664d66b573 100644 --- a/frontend/awx/access/teams/hooks/useTeamActions.tsx +++ b/frontend/awx/access/teams/hooks/useTeamActions.tsx @@ -65,7 +65,7 @@ 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]), }, @@ -73,7 +73,7 @@ export function useTeamActions(options: { 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), }, diff --git a/frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx b/frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx index be5f6dad6e..4f1b6ff242 100644 --- a/frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx +++ b/frontend/awx/access/teams/hooks/useTeamToolbarActions.tsx @@ -47,7 +47,7 @@ export function useTeamToolbarActions(view: IAwxView) { 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), }, { @@ -62,7 +62,7 @@ export function useTeamToolbarActions(view: IAwxView) { type: PageActionType.Button, selection: PageActionSelection.Multiple, icon: TrashIcon, - label: t('Delete selected teams'), + label: t('Delete teams'), onClick: deleteTeams, isDanger: true, },