Align display types for job list and details

This commit is contained in:
Jake McDermott 2020-12-14 11:25:38 -05:00
parent 1a4eab6f25
commit 4033e0f218
No known key found for this signature in database
GPG Key ID: 0E56ED990CDFCB4F
2 changed files with 11 additions and 2 deletions

View File

@ -92,6 +92,15 @@ function JobDetail({ job, i18n }) {
const [errorMsg, setErrorMsg] = useState();
const history = useHistory();
const jobTypes = {
project_update: i18n._(t`Source Control Update`),
inventory_update: i18n._(t`Inventory Sync`),
job: i18n._(t`Playbook Run`),
ad_hoc_command: i18n._(t`Command`),
management_job: i18n._(t`Management Job`),
workflow_job: i18n._(t`Workflow Job`),
};
const { value: launchedByValue, link: launchedByLink } =
getLaunchedByDetails(job) || {};
@ -181,7 +190,7 @@ function JobDetail({ job, i18n }) {
}
/>
)}
<Detail label={i18n._(t`Job Type`)} value={toTitleCase(job.type)} />
<Detail label={i18n._(t`Job Type`)} value={jobTypes[job.type]} />
<Detail
label={i18n._(t`Launched By`)}
value={

View File

@ -45,7 +45,7 @@ describe('<JobDetail />', () => {
assertDetail('Started', '8/8/2019, 7:24:18 PM');
assertDetail('Finished', '8/8/2019, 7:24:50 PM');
assertDetail('Job Template', mockJobData.summary_fields.job_template.name);
assertDetail('Job Type', 'Run');
assertDetail('Job Type', 'Playbook Run');
assertDetail('Launched By', mockJobData.summary_fields.created_by.username);
assertDetail('Inventory', mockJobData.summary_fields.inventory.name);
assertDetail(