mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 22:46:01 -03:30
Merge pull request #12009 from nixocio/ui_issue_12006
Do not show inventory for project update on job details
This commit is contained in:
@@ -92,6 +92,31 @@ function JobDetail({ job, inventorySourceLabels }) {
|
|||||||
<Link to={`/instance_groups/container_group/${item.id}`}>{item.name}</Link>
|
<Link to={`/instance_groups/container_group/${item.id}`}>{item.name}</Link>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const renderInventoryDetail = () => {
|
||||||
|
if (job.type !== 'project_update') {
|
||||||
|
return inventory ? (
|
||||||
|
<Detail
|
||||||
|
dataCy="job-inventory"
|
||||||
|
label={t`Inventory`}
|
||||||
|
value={
|
||||||
|
<Link
|
||||||
|
to={
|
||||||
|
inventory.kind === 'smart'
|
||||||
|
? `/inventories/smart_inventory/${inventory.id}`
|
||||||
|
: `/inventories/inventory/${inventory.id}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{inventory.name}
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<DeletedDetail label={t`Inventory`} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<DetailList>
|
<DetailList>
|
||||||
@@ -159,25 +184,7 @@ function JobDetail({ job, inventorySourceLabels }) {
|
|||||||
value={jobTypes[job.type]}
|
value={jobTypes[job.type]}
|
||||||
/>
|
/>
|
||||||
<LaunchedByDetail dataCy="job-launched-by" job={job} />
|
<LaunchedByDetail dataCy="job-launched-by" job={job} />
|
||||||
{inventory ? (
|
{renderInventoryDetail()}
|
||||||
<Detail
|
|
||||||
dataCy="job-inventory"
|
|
||||||
label={t`Inventory`}
|
|
||||||
value={
|
|
||||||
<Link
|
|
||||||
to={
|
|
||||||
inventory.kind === 'smart'
|
|
||||||
? `/inventories/smart_inventory/${inventory.id}`
|
|
||||||
: `/inventories/inventory/${inventory.id}`
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{inventory.name}
|
|
||||||
</Link>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<DeletedDetail label={t`Inventory`} />
|
|
||||||
)}
|
|
||||||
{inventory_source && (
|
{inventory_source && (
|
||||||
<>
|
<>
|
||||||
<Detail
|
<Detail
|
||||||
|
|||||||
Reference in New Issue
Block a user