Merge pull request #8888 from jakemcdermott/fix-8856

Make display type unique for different job types and consistent between job list and details

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-12-16 02:07:20 +00:00 committed by GitHub
commit 33c3a6d89b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -39,7 +39,7 @@ function JobListItem({
project_update: i18n._(t`Source Control Update`),
inventory_update: i18n._(t`Inventory Sync`),
job: i18n._(t`Playbook Run`),
command: i18n._(t`Command`),
ad_hoc_command: i18n._(t`Command`),
management_job: i18n._(t`Management Job`),
workflow_job: i18n._(t`Workflow Job`),
};

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.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(