mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Only render edit control if editable
This commit is contained in:
@@ -86,13 +86,19 @@ function ManagementJobList({ i18n }) {
|
|||||||
qsConfig={QS_CONFIG}
|
qsConfig={QS_CONFIG}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
renderItem={({ id, name, description }) => (
|
renderItem={({
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
has_configurable_retention,
|
||||||
|
}) => (
|
||||||
<ManagementJobListItem
|
<ManagementJobListItem
|
||||||
key={id}
|
key={id}
|
||||||
id={id}
|
id={id}
|
||||||
name={name}
|
name={name}
|
||||||
description={description}
|
description={description}
|
||||||
isSuperUser={me?.is_superuser}
|
isSuperUser={me?.is_superuser}
|
||||||
|
isConfigurable={has_configurable_retention}
|
||||||
onLaunchError={setLaunchError}
|
onLaunchError={setLaunchError}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const DataListAction = styled(_DataListAction)`
|
|||||||
function ManagementJobListItem({
|
function ManagementJobListItem({
|
||||||
i18n,
|
i18n,
|
||||||
onLaunchError,
|
onLaunchError,
|
||||||
|
isConfigurable,
|
||||||
isSuperUser,
|
isSuperUser,
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
@@ -91,17 +92,22 @@ function ManagementJobListItem({
|
|||||||
<RocketIcon />
|
<RocketIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip content={i18n._(t`Edit management job`)} position="top">
|
{isConfigurable ? (
|
||||||
<Button
|
<Tooltip
|
||||||
aria-label={i18n._(t`Edit management job`)}
|
content={i18n._(t`Edit management job`)}
|
||||||
variant="plain"
|
position="top"
|
||||||
component={Link}
|
|
||||||
to={editUrl}
|
|
||||||
isDisabled={isLaunchLoading}
|
|
||||||
>
|
>
|
||||||
<PencilAltIcon />
|
<Button
|
||||||
</Button>
|
aria-label={i18n._(t`Edit management job`)}
|
||||||
</Tooltip>
|
variant="plain"
|
||||||
|
component={Link}
|
||||||
|
to={editUrl}
|
||||||
|
isDisabled={isLaunchLoading}
|
||||||
|
>
|
||||||
|
<PencilAltIcon />
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
|
) : null}
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</DataListAction>
|
</DataListAction>
|
||||||
|
|||||||
Reference in New Issue
Block a user