Merge pull request #8992 from saito-hideki/awx/issue/8839

Add inventory source and project links to details view of Jobs list

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-03-03 02:09:06 +00:00 committed by GitHub
commit 3903e88a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View File

@ -124,7 +124,7 @@ SUMMARIZABLE_FK_FIELDS = {
'last_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
'current_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
'current_job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
'inventory_source': ('source', 'last_updated', 'status'),
'inventory_source': ('id', 'name', 'source', 'last_updated', 'status'),
'custom_inventory_script': DEFAULT_SUMMARY_FIELDS,
'source_script': DEFAULT_SUMMARY_FIELDS,
'role': ('id', 'role_field'),

View File

@ -64,6 +64,8 @@ function JobDetail({ job, i18n }) {
credentials,
instance_group: instanceGroup,
inventory,
inventory_source,
source_project,
job_template: jobTemplate,
workflow_job_template: workflowJobTemplate,
labels,
@ -206,6 +208,33 @@ function JobDetail({ job, i18n }) {
}
/>
)}
{inventory_source && (
<Detail
label={i18n._(t`Inventory Source`)}
value={
<Link
to={`/inventories/inventory/${inventory.id}/sources/${inventory_source.id}`}
>
{inventory_source.name}
</Link>
}
/>
)}
{inventory_source && inventory_source.source === 'scm' && (
<Detail
label={i18n._(t`Project`)}
value={
<StatusDetailValue>
{source_project.status && (
<StatusIcon status={source_project.status} />
)}
<Link to={`/projects/${source_project.id}`}>
{source_project.name}
</Link>
</StatusDetailValue>
}
/>
)}
{project && (
<Detail
label={i18n._(t`Project`)}