mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 04:31:21 -03:30
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:
commit
33c3a6d89b
@ -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`),
|
||||
};
|
||||
|
||||
@ -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={
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user