diff --git a/awx/ui/src/components/JobCancelButton/JobCancelButton.js b/awx/ui/src/components/JobCancelButton/JobCancelButton.js index 2423da5888..b766a3b434 100644 --- a/awx/ui/src/components/JobCancelButton/JobCancelButton.js +++ b/awx/ui/src/components/JobCancelButton/JobCancelButton.js @@ -8,12 +8,13 @@ import AlertModal from '../AlertModal'; import ErrorDetail from '../ErrorDetail'; function JobCancelButton({ - job = {}, errorTitle, title, showIconButton, errorMessage, buttonText, + style = {}, + job = {}, }) { const [isOpen, setIsOpen] = useState(false); const { error: cancelError, request: cancelJob } = useRequest( @@ -38,6 +39,7 @@ function JobCancelButton({ ouiaId="cancel-job-button" onClick={() => setIsOpen(true)} variant="plain" + style={style} > @@ -48,6 +50,7 @@ function JobCancelButton({ variant="secondary" ouiaId="cancel-job-button" onClick={() => setIsOpen(true)} + style={style} > {buttonText || t`Cancel Job`} diff --git a/awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js b/awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js index 992e1a8cba..55b8262921 100644 --- a/awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js +++ b/awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js @@ -11,6 +11,7 @@ import { } from '@patternfly/react-icons'; import styled from 'styled-components'; import StatusLabel from 'components/StatusLabel'; +import JobCancelButton from 'components/JobCancelButton'; import { WorkflowDispatchContext, WorkflowStateContext, @@ -61,7 +62,6 @@ const ActionButton = styled(Button)` color: white; } `; - function WorkflowOutputToolbar({ job }) { const dispatch = useContext(WorkflowDispatchContext); const history = useHistory(); @@ -80,6 +80,18 @@ function WorkflowOutputToolbar({ job }) { + {['new', 'pending', 'waiting', 'running'].includes(job?.status) && + job?.summary_fields?.user_capabilities?.start ? ( + + ) : null} + { shouldFind('Button#workflow-output-toggle-legend'); shouldFind('Badge'); shouldFind('Button#workflow-output-toggle-tools'); + shouldFind('JobCancelButton'); }); test('Shows correct number of nodes', () => {