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