Adds ouiaId's to output page buttons

This commit is contained in:
mabashian 2021-03-18 14:08:55 -04:00
parent ac06f9e432
commit 74460fa2d7
2 changed files with 14 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import {
} from '@patternfly/react-core';
import { RocketIcon } from '@patternfly/react-icons';
function ReLaunchDropDown({ isPrimary = false, handleRelaunch, i18n }) {
function ReLaunchDropDown({ isPrimary = false, handleRelaunch, i18n, ouiaId }) {
const [isOpen, setIsOPen] = useState(false);
const onToggle = () => {
@ -75,6 +75,7 @@ function ReLaunchDropDown({ isPrimary = false, handleRelaunch, i18n }) {
return (
<Dropdown
ouiaId={ouiaId}
isPlain
position={DropdownPosition.right}
isOpen={isOpen}

View File

@ -145,13 +145,17 @@ const OutputToolbar = ({
{job.status === 'failed' && job.type === 'job' ? (
<LaunchButton resource={job}>
{({ handleRelaunch }) => (
<ReLaunchDropDown handleRelaunch={handleRelaunch} />
<ReLaunchDropDown
handleRelaunch={handleRelaunch}
ouiaId="job-output-relaunch-dropdown"
/>
)}
</LaunchButton>
) : (
<LaunchButton resource={job}>
{({ handleRelaunch }) => (
<Button
ouiaId="job-output-relaunch-button"
variant="plain"
onClick={handleRelaunch}
aria-label={i18n._(t`Relaunch`)}
@ -167,7 +171,11 @@ const OutputToolbar = ({
{job.related?.stdout && (
<Tooltip content={i18n._(t`Download Output`)}>
<a href={`${job.related.stdout}?format=txt_download`}>
<Button variant="plain" aria-label={i18n._(t`Download Output`)}>
<Button
ouiaId="job-output-download-button"
variant="plain"
aria-label={i18n._(t`Download Output`)}
>
<DownloadIcon />
</Button>
</a>
@ -177,6 +185,7 @@ const OutputToolbar = ({
['pending', 'waiting', 'running'].includes(jobStatus) && (
<Tooltip content={i18n._(t`Cancel Job`)}>
<Button
ouiaId="job-output-cancel-button"
variant="plain"
aria-label={i18n._(t`Cancel Job`)}
onClick={onCancel}
@ -191,6 +200,7 @@ const OutputToolbar = ({
) && (
<Tooltip content={i18n._(t`Delete Job`)}>
<DeleteButton
ouiaId="job-output-delete-button"
name={job.name}
modalTitle={i18n._(t`Delete Job`)}
onConfirm={onDelete}