mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Show deleted detail for deleted schedules
This commit is contained in:
@@ -12,7 +12,12 @@ import getScheduleUrl from 'util/getScheduleUrl';
|
|||||||
import { ActionsTd, ActionItem, TdBreakWord } from '../PaginatedTable';
|
import { ActionsTd, ActionItem, TdBreakWord } from '../PaginatedTable';
|
||||||
import { LaunchButton, ReLaunchDropDown } from '../LaunchButton';
|
import { LaunchButton, ReLaunchDropDown } from '../LaunchButton';
|
||||||
import StatusLabel from '../StatusLabel';
|
import StatusLabel from '../StatusLabel';
|
||||||
import { DetailList, Detail, LaunchedByDetail } from '../DetailList';
|
import {
|
||||||
|
DetailList,
|
||||||
|
Detail,
|
||||||
|
DeletedDetail,
|
||||||
|
LaunchedByDetail,
|
||||||
|
} from '../DetailList';
|
||||||
import ChipGroup from '../ChipGroup';
|
import ChipGroup from '../ChipGroup';
|
||||||
import CredentialChip from '../CredentialChip';
|
import CredentialChip from '../CredentialChip';
|
||||||
import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail';
|
import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail';
|
||||||
@@ -49,6 +54,7 @@ function JobListItem({
|
|||||||
job_template,
|
job_template,
|
||||||
labels,
|
labels,
|
||||||
project,
|
project,
|
||||||
|
schedule,
|
||||||
source_workflow_job,
|
source_workflow_job,
|
||||||
workflow_job_template,
|
workflow_job_template,
|
||||||
} = job.summary_fields;
|
} = job.summary_fields;
|
||||||
@@ -168,17 +174,18 @@ function JobListItem({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<LaunchedByDetail job={job} />
|
<LaunchedByDetail job={job} />
|
||||||
{job.launch_type === 'scheduled' && (
|
{job.launch_type === 'scheduled' &&
|
||||||
<Detail
|
(schedule ? (
|
||||||
dataCy="job-schedule"
|
<Detail
|
||||||
label={t`Schedule`}
|
dataCy="job-schedule"
|
||||||
value={
|
label={t`Schedule`}
|
||||||
<Link to={getScheduleUrl(job)}>
|
value={
|
||||||
{job.summary_fields.schedule.name}
|
<Link to={getScheduleUrl(job)}>{schedule.name}</Link>
|
||||||
</Link>
|
}
|
||||||
}
|
/>
|
||||||
/>
|
) : (
|
||||||
)}
|
<DeletedDetail label={t`Schedule`} />
|
||||||
|
))}
|
||||||
{job_template && (
|
{job_template && (
|
||||||
<Detail
|
<Detail
|
||||||
label={t`Job Template`}
|
label={t`Job Template`}
|
||||||
|
|||||||
@@ -142,6 +142,25 @@ describe('<JobListItem />', () => {
|
|||||||
expect(wrapper.find('Td[dataLabel="Type"]').length).toBe(1);
|
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', () => {
|
test('should not display EE for canceled jobs', () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<table>
|
<table>
|
||||||
|
|||||||
Reference in New Issue
Block a user