Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCM Type detail to job detail view #12145

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions awx/ui/src/screens/Job/JobDetail/JobDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ function JobDetail({ job, inventorySourceLabels }) {
workflow_job: t`Workflow Job`,
};

const scmTypes = {
'': t`Manual`,
git: t`Git`,
svn: t`Subversion`,
insights: t`Red Hat Insights`,
archive: t`Remote Archive`,
};

const deleteJob = async () => {
try {
await getJobModel(job.type).destroy(job.id);
Expand Down Expand Up @@ -241,6 +249,11 @@ function JobDetail({ job, inventorySourceLabels }) {
label={t`Job Type`}
value={jobTypes[job.type]}
/>
<Detail
dataCy="source-control-type"
label={t`Source Control Type`}
value={scmTypes[job.scm_type]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be scmTypes[job.scm_type] || scmTypes[''], or will job.scm_type always be an empty string if it's not one of the four specific types?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Not every job will have a scm_type, so in those cases we wouldn't want to display the Source Control Type detail.

/>
<LaunchedByDetail dataCy="job-launched-by" job={job} />
{renderInventoryDetail()}
{inventory_source && (
Expand Down