Show deleted detail for deleted schedules

This commit is contained in:
Marliana Lara
2022-02-28 15:51:36 -05:00
parent 8c21a2aa9e
commit 1aefd39782
2 changed files with 38 additions and 12 deletions

View File

@@ -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`}

View File

@@ -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>