diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index 0cfe75365e..01ac2d9db1 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -64,7 +64,7 @@ describe('Inventory Sources', () => { }).then((cred) => { credential = cred; goToSourceList(inventory.name); - cy.clickButton(/^Add source/); + cy.clickButton(/^Create source/); cy.verifyPageTitle('Add new source'); cy.getByDataCy('name').type('project source'); cy.selectDropdownOptionByResourceName('source_control_type', 'Sourced from a Project'); @@ -116,7 +116,7 @@ describe('Inventory Sources', () => { }); cy.getByDataCy('description').clear().type('mock description'); cy.getByDataCy('overwrite').check(); - cy.clickButton(/^Save$/); + cy.clickButton(/^Save source$/); cy.getByDataCy('description').should('contain', 'mock description'); cy.getByDataCy('enabled-options').should('contain', 'Overwrite'); }); diff --git a/cypress/e2e/awx/inventories/inventories.cy.ts b/cypress/e2e/awx/inventories/inventories.cy.ts index 10f5baa14a..a776cedfa4 100644 --- a/cypress/e2e/awx/inventories/inventories.cy.ts +++ b/cypress/e2e/awx/inventories/inventories.cy.ts @@ -132,7 +132,8 @@ describe('Inventories Tests', () => { cy.navigateTo('awx', 'inventories'); cy.filterTableBySingleSelect('name', inventory.name); cy.selectTableRowByCheckbox('name', inventory.name, { disableFilter: true }); - cy.clickToolbarKebabAction('delete-selected-inventories'); + //Add an assertion that the expected inventory name appears where it should + cy.clickToolbarKebabAction('delete-inventories'); cy.get('#confirm').click(); cy.clickButton(/^Delete inventory/); cy.contains(/^Success$/); @@ -157,7 +158,9 @@ describe('Inventories Tests', () => { cy.contains(inv2.name); cy.contains(inv3.name); cy.getByDataCy('select-all').click(); - cy.clickToolbarKebabAction('delete-selected-inventories'); + + cy.clickToolbarKebabAction('delete-inventories'); + cy.get('#confirm').click(); cy.clickButton(/^Delete inventories/); cy.contains(/^Success$/); diff --git a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts index 79e8bdd516..ebaef791e0 100644 --- a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts +++ b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts @@ -70,7 +70,7 @@ describe('Inventory Groups', () => { cy.get('tbody tr').should('have.length', 1); cy.get('[data-cy="checkbox-column-cell"] input').click(); }); - cy.clickToolbarKebabAction('delete-selected-groups'); + cy.clickToolbarKebabAction('delete-groups'); cy.intercept('DELETE', awxAPI`/groups/*/`).as('deleted'); cy.get('[data-cy="delete-groups-dialog-radio-delete"]').click(); cy.get('[data-cy="delete-group-modal-delete-button"]').click(); @@ -122,7 +122,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', inventory.name, { disableFilter: true }); cy.verifyPageTitle(inventory.name); cy.clickTab(/^Groups$/, true); - cy.clickButton(/^Run Command$/); + cy.clickButton(/^Run command$/); runCommand({ selections: 'all', @@ -153,7 +153,7 @@ describe('Inventory Groups', () => { cy.get('tbody tr').should('have.length', 5); cy.getByDataCy('select-all').click(); cy.intercept('DELETE', awxAPI`/groups/*/`).as('deleted'); - cy.clickToolbarKebabAction('delete-selected-groups'); + cy.clickToolbarKebabAction('delete-groups'); cy.getModal().within(() => { cy.get('[data-cy="delete-groups-dialog-radio-delete"]').click(); cy.get('[data-cy="delete-group-modal-delete-button"]').click(); @@ -261,7 +261,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', group.name, { disableFilter: true }); cy.verifyPageTitle(group.name); cy.clickTab(/^Related Groups$/, true); - cy.clickButton(/^New group/); + cy.clickButton(/^Create group/); cy.verifyPageTitle('Create new group'); cy.get('[data-cy="name-form-group"]').type(newRelatedGroup); cy.get('[data-cy="Submit"]').click(); @@ -269,7 +269,7 @@ describe('Inventory Groups', () => { cy.filterTableByMultiSelect('name', [newRelatedGroup]); cy.selectTableRow(newRelatedGroup, false); cy.intercept('POST', awxAPI`/groups/*/children/`).as('disassociateGroup'); - cy.clickToolbarKebabAction('disassociate-selected-groups'); + cy.clickToolbarKebabAction('disassociate-groups'); cy.clickModalConfirmCheckbox(); cy.clickButton(/^Disassociate groups/); cy.wait('@disassociateGroup') @@ -305,7 +305,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', group.name, { disableFilter: true }); cy.verifyPageTitle(group.name); cy.clickTab(/^Related Groups$/, true); - cy.clickButton(/^Existing group/); + cy.clickButton(/^Add existing group/); cy.filterTableByMultiSelect('name', [newGroup]); cy.selectTableRow(newGroup, false); cy.clickButton(/^Add groups/); @@ -329,7 +329,7 @@ describe('Inventory Groups', () => { cy.clickTab(/^Related Groups$/, true); cy.selectTableRow(newGroup, false); cy.intercept('POST', awxAPI`/groups/*/children/`).as('disassociateGroup'); - cy.clickToolbarKebabAction('disassociate-selected-groups'); + cy.clickToolbarKebabAction('disassociate-groups'); cy.clickModalConfirmCheckbox(); cy.clickButton(/^Disassociate groups/); cy.wait('@disassociateGroup') @@ -360,7 +360,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', group.name, { disableFilter: true }); cy.verifyPageTitle(group.name); cy.clickTab(/^Related Groups$/, true); - cy.clickButton(/^New group/); + cy.clickButton(/^Create group/); cy.verifyPageTitle('Create new group'); cy.get('[data-cy="name-form-group"]').type(newRelatedGroup); cy.get('[data-cy="Submit"]').click(); @@ -368,7 +368,7 @@ describe('Inventory Groups', () => { cy.filterTableBySingleSelect('name', newRelatedGroup); cy.selectTableRow(newRelatedGroup, false); cy.intercept('POST', awxAPI`/groups/*/children/`).as('disassociateGroup'); - cy.clickButton(/^Run Command$/); + cy.clickButton(/^Run command$/); runCommand({ selections: newRelatedGroup, @@ -466,7 +466,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', thisInventory.name, { disableFilter: true }); cy.verifyPageTitle(thisInventory.name); cy.clickTab(/^Hosts$/, true); - cy.clickButton(/^Run Command$/); + cy.clickButton(/^Run command$/); runCommand({ selections: 'all', diff --git a/frontend/awx/resources/groups/GroupHosts.cy.tsx b/frontend/awx/resources/groups/GroupHosts.cy.tsx index ab7b1acf43..cbf2a09904 100644 --- a/frontend/awx/resources/groups/GroupHosts.cy.tsx +++ b/frontend/awx/resources/groups/GroupHosts.cy.tsx @@ -80,13 +80,10 @@ describe('GroupHosts', () => { .then(() => { if (kind === '') { cy.get('[data-cy="checkbox-column-cell"] > label > input').click(); - cy.get('[data-cy="disassociate-selected-hosts"]').click(); + cy.get('[data-cy="disassociate-hosts"]').click(); cy.contains('Disassociate host from group?'); } else { - cy.get('body').should( - 'not.have.descendants', - '[data-cy="disassociate-selected-hosts"]' - ); + cy.get('body').should('not.have.descendants', '[data-cy="disassociate-hosts"]'); } }); }); diff --git a/frontend/awx/resources/groups/GroupRelatedGroups.cy.tsx b/frontend/awx/resources/groups/GroupRelatedGroups.cy.tsx index 38000ba263..8c7aca771d 100644 --- a/frontend/awx/resources/groups/GroupRelatedGroups.cy.tsx +++ b/frontend/awx/resources/groups/GroupRelatedGroups.cy.tsx @@ -57,7 +57,7 @@ inventories.forEach((inventory) => { .then((results: InventoryGroup[]) => { const group = results[0]; cy.selectTableRow(group.name, false); - cy.clickToolbarKebabAction('disassociate-selected-groups'); + cy.clickToolbarKebabAction('disassociate-groups'); cy.contains('Permanently disassociate groups'); }); }); @@ -151,7 +151,7 @@ inventories.forEach((inventory) => { .should('be.an', 'array') .then(() => { cy.get('[data-cy="add-group"]').click(); - cy.get('#create-new-group').should('have.attr', 'aria-disabled', 'true'); + cy.get('[data-cy="create-group"]').should('have.attr', 'aria-disabled', 'true'); }); }); } @@ -178,8 +178,8 @@ inventories.forEach((inventory) => { cy.get(`[data-cy="run-command"]`); cy.get(`[data-cy="add-group"]`); - cy.get(`[data-cy="actions-dropdown"]`).click(); - cy.get(`[data-cy="disassociate-selected-groups"]`); + cy.get(`[aria-label="Actions"]`).click(); + cy.get(`[data-cy="disassociate-groups"]`); }); } }); diff --git a/frontend/awx/resources/groups/hooks/useRelatedGroupsEmptyStateActions.tsx b/frontend/awx/resources/groups/hooks/useRelatedGroupsEmptyStateActions.tsx index eebb3e4380..328346e499 100644 --- a/frontend/awx/resources/groups/hooks/useRelatedGroupsEmptyStateActions.tsx +++ b/frontend/awx/resources/groups/hooks/useRelatedGroupsEmptyStateActions.tsx @@ -18,6 +18,7 @@ import { GroupSelectDialog } from './useGroupSelectDialog'; import { postRequest } from '../../../../common/crud/Data'; import { ButtonVariant } from '@patternfly/react-core'; import { IAwxView } from '../../../common/useAwxView'; +import { PlusCircleIcon } from '@patternfly/react-icons'; export function useRelatedGroupsEmptyStateActions(view: IAwxView) { const [_, setDialog] = usePageDialog(); @@ -63,7 +64,8 @@ export function useRelatedGroupsEmptyStateActions(view: IAwxView type: PageActionType.Button, selection: PageActionSelection.None, variant: ButtonVariant.primary, - label: t('Existing group'), + icon: PlusCircleIcon, + label: t('Add existing group'), isPinned: true, onClick: () => setDialog( @@ -77,7 +79,8 @@ export function useRelatedGroupsEmptyStateActions(view: IAwxView type: PageActionType.Button, selection: PageActionSelection.None, variant: ButtonVariant.primary, - label: t('New group'), + icon: PlusCircleIcon, + label: t('Create group'), isPinned: true, onClick: () => pageNavigate(String(AwxRoute.InventoryGroupRelatedGroupsCreate), { diff --git a/frontend/awx/resources/groups/hooks/useRelatedGroupsToolbarActions.tsx b/frontend/awx/resources/groups/hooks/useRelatedGroupsToolbarActions.tsx index 2541682ddc..217bab2ba9 100644 --- a/frontend/awx/resources/groups/hooks/useRelatedGroupsToolbarActions.tsx +++ b/frontend/awx/resources/groups/hooks/useRelatedGroupsToolbarActions.tsx @@ -93,7 +93,7 @@ export function useRelatedGroupsToolbarActions(view: IAwxView) { { type: PageActionType.Button, selection: PageActionSelection.None, - label: t('Create new group'), + label: t('Create group'), isHidden: () => isConstructed, onClick: () => pageNavigate(String(AwxRoute.InventoryGroupRelatedGroupsCreate), { @@ -122,7 +122,7 @@ export function useRelatedGroupsToolbarActions(view: IAwxView) { type: PageActionType.Button, selection: PageActionSelection.Multiple, icon: TrashIcon, - label: t('Disassociate selected groups'), + label: t('Disassociate groups'), onClick: disassociateGroups, isDanger: true, isDisabled: diff --git a/frontend/awx/resources/inventories/InventoryPage/InventoryGroups.cy.tsx b/frontend/awx/resources/inventories/InventoryPage/InventoryGroups.cy.tsx index 8592f96df6..8e5045a5a6 100644 --- a/frontend/awx/resources/inventories/InventoryPage/InventoryGroups.cy.tsx +++ b/frontend/awx/resources/inventories/InventoryPage/InventoryGroups.cy.tsx @@ -57,7 +57,7 @@ types.forEach((type) => { .then((results: InventoryGroup[]) => { const group = results[0]; cy.selectTableRow(group.name, false); - cy.clickToolbarKebabAction('delete-selected-groups'); + cy.clickToolbarKebabAction('delete-groups'); cy.get('[data-cy="delete-group-modal-delete-button"]').should('be.disabled'); cy.get('[data-cy="delete-groups-dialog-radio-delete"]').click(); cy.get('[data-cy="delete-group-modal-delete-button"]').should('be.enabled'); diff --git a/frontend/awx/resources/inventories/InventoryPage/InventorySources.cy.tsx b/frontend/awx/resources/inventories/InventoryPage/InventorySources.cy.tsx index db3fcbd127..1a2de27b02 100644 --- a/frontend/awx/resources/inventories/InventoryPage/InventorySources.cy.tsx +++ b/frontend/awx/resources/inventories/InventoryPage/InventorySources.cy.tsx @@ -23,7 +23,7 @@ describe('InventorySources.cy.ts', () => { .then((results: InventorySource[]) => { const source = results[0]; cy.selectTableRow(source.name, false); - cy.clickToolbarKebabAction('delete-selected-sources'); + cy.clickToolbarKebabAction('delete-sources'); cy.contains('Permanently delete source').should('be.visible'); }); }); diff --git a/frontend/awx/resources/inventories/InventoryPage/InventorySources.tsx b/frontend/awx/resources/inventories/InventoryPage/InventorySources.tsx index 9ec57c0714..de97a8c290 100644 --- a/frontend/awx/resources/inventories/InventoryPage/InventorySources.tsx +++ b/frontend/awx/resources/inventories/InventoryPage/InventorySources.tsx @@ -103,7 +103,7 @@ export function InventorySources() { } emptyStateIcon={canCreateSource ? undefined : CubesIcon} emptyStateButtonIcon={} - emptyStateButtonText={canCreateSource ? t('Add source') : undefined} + emptyStateButtonText={canCreateSource ? t('Create source') : undefined} emptyStateButtonClick={ canCreateSource ? () => diff --git a/frontend/awx/resources/inventories/hooks/useInventoriesGroupActions.tsx b/frontend/awx/resources/inventories/hooks/useInventoriesGroupActions.tsx index e351cfa24f..1e93381e2f 100644 --- a/frontend/awx/resources/inventories/hooks/useInventoriesGroupActions.tsx +++ b/frontend/awx/resources/inventories/hooks/useInventoriesGroupActions.tsx @@ -12,6 +12,7 @@ import { AwxRoute } from '../../../main/AwxRoutes'; import { cannotDeleteResource, cannotEditResource } from '../../../../common/utils/RBAChelpers'; import { useParams } from 'react-router-dom'; import { useDeleteGroups } from '../../groups/hooks/useDeleteGroups'; +import { ButtonVariant } from '@patternfly/react-core'; export function useInventoriesGroupActions() { const { t } = useTranslation(); @@ -33,6 +34,7 @@ export function useInventoriesGroupActions() { selection: PageActionSelection.Single, isPinned: true, icon: PencilAltIcon, + variant: ButtonVariant.primary, label: t('Edit group'), isHidden: () => params.inventory_type === 'constructed_inventory', onClick: (group) => diff --git a/frontend/awx/resources/inventories/hooks/useInventoriesGroupsHostsToolbarActions.tsx b/frontend/awx/resources/inventories/hooks/useInventoriesGroupsHostsToolbarActions.tsx index 4940b9bc94..9ac14aaaa6 100644 --- a/frontend/awx/resources/inventories/hooks/useInventoriesGroupsHostsToolbarActions.tsx +++ b/frontend/awx/resources/inventories/hooks/useInventoriesGroupsHostsToolbarActions.tsx @@ -111,7 +111,7 @@ export function useInventoriesGroupsHostsToolbarActions(view: IAwxView) type: PageActionType.Button, selection: PageActionSelection.Multiple, isPinned: true, - label: t('Disassociate selected hosts'), + label: t('Disassociate hosts'), onClick: disassociateHosts, isDisabled: view.selectedItems.length === 0 ? t('Select at least one item from the list') : undefined, diff --git a/frontend/awx/resources/inventories/hooks/useInventoriesGroupsToolbarActions.tsx b/frontend/awx/resources/inventories/hooks/useInventoriesGroupsToolbarActions.tsx index df8de173a6..84fb308109 100644 --- a/frontend/awx/resources/inventories/hooks/useInventoriesGroupsToolbarActions.tsx +++ b/frontend/awx/resources/inventories/hooks/useInventoriesGroupsToolbarActions.tsx @@ -8,7 +8,7 @@ import { PageActionType, usePageNavigate, } from '../../../../../framework'; -import { PlusCircleIcon, TrashIcon } from '@patternfly/react-icons'; +import { CogIcon, PlusCircleIcon, TrashIcon } from '@patternfly/react-icons'; import { useDeleteGroups } from '../../groups/hooks/useDeleteGroups'; import { useParams } from 'react-router-dom'; import { useOptions } from '../../../../common/crud/useOptions'; @@ -77,7 +77,7 @@ export function useInventoriesGroupsToolbarActions(view: IAwxView( selection: PageActionSelection.None, variant: ButtonVariant.secondary, isPinned: options?.isPinned !== undefined ? options?.isPinned : true, - label: t('Run Command'), + label: t('Run command'), onClick: () => { onClick(params.selectedItems || []); }, @@ -167,7 +167,8 @@ export function useRunCommandAction( type: PageActionType.Button, selection: PageActionSelection.Single, isPinned: options?.isPinned, - label: t('Run Command'), + icon: CogIcon, + label: t('Run command'), onClick: (item) => { onClick([item]); }, diff --git a/frontend/awx/resources/inventories/hooks/useInventoriesSourcesToolbarActions.tsx b/frontend/awx/resources/inventories/hooks/useInventoriesSourcesToolbarActions.tsx index 5036c8406d..4365c4762a 100644 --- a/frontend/awx/resources/inventories/hooks/useInventoriesSourcesToolbarActions.tsx +++ b/frontend/awx/resources/inventories/hooks/useInventoriesSourcesToolbarActions.tsx @@ -66,7 +66,7 @@ export function useInventoriesSourcesToolbarActions( variant: ButtonVariant.primary, isPinned: true, icon: PlusCircleIcon, - label: t('Add source'), + label: t('Create source'), onClick: () => pageNavigate(String(AwxRoute.InventorySourcesAdd), { params: { inventory_type: params.inventory_type, id: params.id }, @@ -83,7 +83,7 @@ export function useInventoriesSourcesToolbarActions( type: PageActionType.Button, selection: PageActionSelection.Multiple, icon: TrashIcon, - label: t('Delete selected sources'), + label: t('Delete sources'), onClick: deleteSources, isDanger: true, isDisabled: (sources: InventorySource[]) => cannotDeleteResources(sources, t), diff --git a/frontend/awx/resources/inventories/hooks/useInventoriesToolbarActions.tsx b/frontend/awx/resources/inventories/hooks/useInventoriesToolbarActions.tsx index fa08186dfc..89199a9fb7 100644 --- a/frontend/awx/resources/inventories/hooks/useInventoriesToolbarActions.tsx +++ b/frontend/awx/resources/inventories/hooks/useInventoriesToolbarActions.tsx @@ -64,7 +64,7 @@ export function useInventoriesToolbarActions(view: IAwxView) { type: PageActionType.Button, selection: PageActionSelection.Multiple, icon: TrashIcon, - label: t('Delete selected inventories'), + label: t('Delete inventories'), onClick: deleteInventories, isDanger: true, }, diff --git a/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostGroups.cy.tsx b/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostGroups.cy.tsx index 19fda6929a..be1ce9cbbd 100644 --- a/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostGroups.cy.tsx +++ b/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostGroups.cy.tsx @@ -123,7 +123,7 @@ describe('Inventory Host Groups List', () => { path: path, initialEntries: initialEntries, }); - cy.contains('button', /^Associate$/).should('have.attr', 'aria-disabled', 'false'); + cy.contains('button', /^Associate group$/).should('have.attr', 'aria-disabled', 'false'); }); it(`Edit inventory group row action is enabled if the user has permission to edit inventory group (${type})`, () => { @@ -148,7 +148,7 @@ describe('Inventory Host Groups List', () => { path: path, initialEntries: initialEntries, }); - cy.contains('button', /^Associate$/).should('have.attr', 'aria-disabled', 'true'); + cy.contains('button', /^Associate group$/).should('have.attr', 'aria-disabled', 'true'); }); it(`Edit inventory group row action is disabled if the user does not have permission to edit inventory group (${type})`, () => { diff --git a/frontend/awx/resources/inventories/inventoryHostsPage/hooks/useHostsGroupsToolbarActions.tsx b/frontend/awx/resources/inventories/inventoryHostsPage/hooks/useHostsGroupsToolbarActions.tsx index a7edc94e3a..3287a0516a 100644 --- a/frontend/awx/resources/inventories/inventoryHostsPage/hooks/useHostsGroupsToolbarActions.tsx +++ b/frontend/awx/resources/inventories/inventoryHostsPage/hooks/useHostsGroupsToolbarActions.tsx @@ -48,7 +48,7 @@ export function useHostsGroupsToolbarActions( variant: ButtonVariant.primary, isPinned: true, icon: PlusCircleIcon, - label: t('Associate'), + label: t('Associate group'), onClick: () => openInventoryHostsGroupsAddModal({ onAdd: associateGroups, @@ -74,7 +74,7 @@ export function useHostsGroupsToolbarActions( arr.push({ type: PageActionType.Button, selection: PageActionSelection.Multiple, - label: t('Disassociate'), + label: t('Disassociate groups'), isDisabled: view.selectedItems.length === 0 ? t('Select at least one item from the list') : undefined, onClick: disassociateGroups, diff --git a/frontend/awx/resources/sources/InventorySourceForm.tsx b/frontend/awx/resources/sources/InventorySourceForm.tsx index 487ea991e8..5d8fc63633 100644 --- a/frontend/awx/resources/sources/InventorySourceForm.tsx +++ b/frontend/awx/resources/sources/InventorySourceForm.tsx @@ -104,7 +104,7 @@ export function CreateInventorySource() { ]} /> navigate(-1)} defaultValue={{ @@ -210,7 +210,7 @@ export function EditInventorySource() { ]} /> navigate(-1)} defaultValue={defaultValue}