From 1aefd39782874c24c9e370a17e081c538381dde2 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Mon, 28 Feb 2022 15:51:36 -0500 Subject: [PATCH] Show deleted detail for deleted schedules --- awx/ui/src/components/JobList/JobListItem.js | 31 ++++++++++++------- .../components/JobList/JobListItem.test.js | 19 ++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/awx/ui/src/components/JobList/JobListItem.js b/awx/ui/src/components/JobList/JobListItem.js index 93f398c741..364b4279c0 100644 --- a/awx/ui/src/components/JobList/JobListItem.js +++ b/awx/ui/src/components/JobList/JobListItem.js @@ -12,7 +12,12 @@ import getScheduleUrl from 'util/getScheduleUrl'; import { ActionsTd, ActionItem, TdBreakWord } from '../PaginatedTable'; import { LaunchButton, ReLaunchDropDown } from '../LaunchButton'; import StatusLabel from '../StatusLabel'; -import { DetailList, Detail, LaunchedByDetail } from '../DetailList'; +import { + DetailList, + Detail, + DeletedDetail, + LaunchedByDetail, +} from '../DetailList'; import ChipGroup from '../ChipGroup'; import CredentialChip from '../CredentialChip'; import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail'; @@ -49,6 +54,7 @@ function JobListItem({ job_template, labels, project, + schedule, source_workflow_job, workflow_job_template, } = job.summary_fields; @@ -168,17 +174,18 @@ function JobListItem({ /> )} - {job.launch_type === 'scheduled' && ( - - {job.summary_fields.schedule.name} - - } - /> - )} + {job.launch_type === 'scheduled' && + (schedule ? ( + {schedule.name} + } + /> + ) : ( + + ))} {job_template && ( ', () => { expect(wrapper.find('Td[dataLabel="Type"]').length).toBe(1); }); + test('should not show schedule detail in expanded view', () => { + wrapper = mountWithContexts( + + + {}} + /> + +
+ ); + expect(wrapper.find('Detail[label="Schedule"] dt').length).toBe(1); + }); + test('should not display EE for canceled jobs', () => { wrapper = mountWithContexts(