mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 15:08:03 -03:30
fixes setstate, and double tooltip
This commit is contained in:
parent
6c7e1fc4eb
commit
03265c05ca
@ -33,7 +33,7 @@ function JobCancelButton({
|
||||
<Button
|
||||
aria-label={title}
|
||||
ouiaId="cancel job"
|
||||
onClick={setIsOpen}
|
||||
onClick={() => setIsOpen(true)}
|
||||
variant="plain"
|
||||
>
|
||||
<MinusCircleIcon />
|
||||
@ -43,7 +43,7 @@ function JobCancelButton({
|
||||
aria-label={title}
|
||||
variant="secondary"
|
||||
ouiaId="cancel job"
|
||||
onClick={setIsOpen}
|
||||
onClick={() => setIsOpen(true)}
|
||||
>{t`Cancel Sync`}</Button>
|
||||
)}
|
||||
</Tooltip>
|
||||
@ -77,7 +77,7 @@ function JobCancelButton({
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
{t`Are you sure you want to submit the request to cancel this job?`}
|
||||
{t`Are you sure you want to cancel this job?`}
|
||||
</AlertModal>
|
||||
)}
|
||||
{error && (
|
||||
|
||||
@ -92,11 +92,8 @@ function InventorySourceListItem({
|
||||
</Td>
|
||||
<Td dataLabel={t`Type`}>{label}</Td>
|
||||
<ActionsTd dataLabel={t`Actions`}>
|
||||
<ActionItem
|
||||
visible={source.summary_fields.user_capabilities.start}
|
||||
tooltip={t`Sync`}
|
||||
>
|
||||
{['running', 'pending', 'waiting'].includes(source?.status) ? (
|
||||
{['running', 'pending', 'waiting'].includes(source?.status) ? (
|
||||
<ActionItem visible={source.summary_fields.user_capabilities.start}>
|
||||
<JobCancelButton
|
||||
job={{
|
||||
type: 'inventory_update',
|
||||
@ -107,10 +104,15 @@ function InventorySourceListItem({
|
||||
title={t`Cancel Inventory Source Sync`}
|
||||
showIconButton
|
||||
/>
|
||||
) : (
|
||||
</ActionItem>
|
||||
) : (
|
||||
<ActionItem
|
||||
visible={source.summary_fields.user_capabilities.start}
|
||||
tooltip={t`Sync`}
|
||||
>
|
||||
<InventorySourceSyncButton source={source} />
|
||||
)}
|
||||
</ActionItem>
|
||||
</ActionItem>
|
||||
)}
|
||||
<ActionItem
|
||||
visible={source.summary_fields.user_capabilities.edit}
|
||||
tooltip={t`Edit`}
|
||||
|
||||
@ -169,11 +169,10 @@ function ProjectListItem({
|
||||
/>
|
||||
</Td>
|
||||
<ActionsTd dataLabel={t`Actions`}>
|
||||
<ActionItem
|
||||
visible={project.summary_fields.user_capabilities.start}
|
||||
tooltip={t`Sync Project`}
|
||||
>
|
||||
{['running', 'pending', 'waiting'].includes(job?.status) ? (
|
||||
{['running', 'pending', 'waiting'].includes(job?.status) ? (
|
||||
<ActionItem
|
||||
visible={project.summary_fields.user_capabilities.start}
|
||||
>
|
||||
<JobCancelButton
|
||||
job={{ id: job.id, type: 'project_update' }}
|
||||
errorTitle={t`Project Sync Error`}
|
||||
@ -181,13 +180,18 @@ function ProjectListItem({
|
||||
showIconButton
|
||||
errorMessage={t`Failed to cancel Project Sync`}
|
||||
/>
|
||||
) : (
|
||||
</ActionItem>
|
||||
) : (
|
||||
<ActionItem
|
||||
visible={project.summary_fields.user_capabilities.start}
|
||||
tooltip={t`Sync Project`}
|
||||
>
|
||||
<ProjectSyncButton
|
||||
projectId={project.id}
|
||||
lastJobStatus={job && job.status}
|
||||
/>
|
||||
)}
|
||||
</ActionItem>
|
||||
</ActionItem>
|
||||
)}
|
||||
<ActionItem
|
||||
visible={project.summary_fields.user_capabilities.edit}
|
||||
tooltip={t`Edit Project`}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user