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