mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Show deleted detail for deleted schedules
This commit is contained in:
parent
8c21a2aa9e
commit
1aefd39782
@ -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({
|
||||
/>
|
||||
)}
|
||||
<LaunchedByDetail job={job} />
|
||||
{job.launch_type === 'scheduled' && (
|
||||
<Detail
|
||||
dataCy="job-schedule"
|
||||
label={t`Schedule`}
|
||||
value={
|
||||
<Link to={getScheduleUrl(job)}>
|
||||
{job.summary_fields.schedule.name}
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{job.launch_type === 'scheduled' &&
|
||||
(schedule ? (
|
||||
<Detail
|
||||
dataCy="job-schedule"
|
||||
label={t`Schedule`}
|
||||
value={
|
||||
<Link to={getScheduleUrl(job)}>{schedule.name}</Link>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<DeletedDetail label={t`Schedule`} />
|
||||
))}
|
||||
{job_template && (
|
||||
<Detail
|
||||
label={t`Job Template`}
|
||||
|
||||
@ -142,6 +142,25 @@ describe('<JobListItem />', () => {
|
||||
expect(wrapper.find('Td[dataLabel="Type"]').length).toBe(1);
|
||||
});
|
||||
|
||||
test('should not show schedule detail in expanded view', () => {
|
||||
wrapper = mountWithContexts(
|
||||
<table>
|
||||
<tbody>
|
||||
<JobListItem
|
||||
job={{
|
||||
...mockJob,
|
||||
summary_fields: {},
|
||||
}}
|
||||
showTypeColumn
|
||||
isSelected
|
||||
onSelect={() => {}}
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(wrapper.find('Detail[label="Schedule"] dt').length).toBe(1);
|
||||
});
|
||||
|
||||
test('should not display EE for canceled jobs', () => {
|
||||
wrapper = mountWithContexts(
|
||||
<table>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user