ensure unique ids on jobs list

This commit is contained in:
Keith J. Grant
2021-07-20 12:13:00 -07:00
parent 29753c6b9b
commit 5fb1b604bf
3 changed files with 11 additions and 6 deletions

View File

@@ -30,6 +30,7 @@ function ExecutionEnvironmentDetail({
virtualEnvironment,
verifyMissingVirtualEnv,
helpText,
dataCy,
}) {
const config = useConfig();
const docsLink = `${getDocsBaseUrl(
@@ -51,7 +52,7 @@ function ExecutionEnvironmentDetail({
</Link>
}
helpText={helpText}
dataCy="execution-environment-detail"
dataCy={dataCy}
/>
);
}
@@ -89,7 +90,7 @@ function ExecutionEnvironmentDetail({
</span>
</>
}
dataCy="missing-execution-environment-detail"
dataCy={`missing-${dataCy}`}
/>
);
}
@@ -113,7 +114,7 @@ function ExecutionEnvironmentDetail({
</span>
</>
}
dataCy="execution-environment-detail"
dataCy={dataCy}
/>
);
}
@@ -127,6 +128,7 @@ ExecutionEnvironmentDetail.propTypes = {
virtualEnvironment: string,
verifyMissingVirtualEnv: bool,
helpText: string,
dataCy: string,
};
ExecutionEnvironmentDetail.defaultProps = {
@@ -135,6 +137,7 @@ ExecutionEnvironmentDetail.defaultProps = {
virtualEnvironment: '',
verifyMissingVirtualEnv: true,
helpText: '',
dataCy: 'execution-environment-detail',
};
export default ExecutionEnvironmentDetail;

View File

@@ -124,6 +124,7 @@ function JobListItem({
<ReLaunchDropDown
handleRelaunch={handleRelaunch}
isLaunching={isLaunching}
id={`relaunch-job-${job.id}`}
/>
)}
</LaunchButton>
@@ -214,6 +215,7 @@ function JobListItem({
<ExecutionEnvironmentDetail
executionEnvironment={execution_environment}
verifyMissingVirtualEnv={false}
dataCy={`execution-environment-detail-${job.id}`}
/>
)}
{credentials && credentials.length > 0 && (

View File

@@ -15,7 +15,7 @@ function ReLaunchDropDown({
isPrimary = false,
handleRelaunch,
isLaunching,
id = 'relaunch-job',
ouiaId,
}) {
const [isOpen, setIsOpen] = useState(false);
@@ -75,7 +75,7 @@ function ReLaunchDropDown({
toggleIndicator={null}
onToggle={onToggle}
aria-label={t`relaunch jobs`}
id="relaunch_jobs"
id={id}
isPrimary
>
{t`Relaunch`}
@@ -97,7 +97,7 @@ function ReLaunchDropDown({
toggleIndicator={null}
onToggle={onToggle}
aria-label={t`relaunch jobs`}
id="relaunch_jobs"
id={id}
>
<RocketIcon />
</DropdownToggle>