mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 02:31:03 -03:30
Adds popout for extra vars on Job Details view
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
|||||||
import { CardBody, CardActionsRow } from 'components/Card';
|
import { CardBody, CardActionsRow } from 'components/Card';
|
||||||
import ChipGroup from 'components/ChipGroup';
|
import ChipGroup from 'components/ChipGroup';
|
||||||
import CredentialChip from 'components/CredentialChip';
|
import CredentialChip from 'components/CredentialChip';
|
||||||
import { VariablesInput as _VariablesInput } from 'components/CodeEditor';
|
import { VariablesDetail } from 'components/CodeEditor';
|
||||||
import DeleteButton from 'components/DeleteButton';
|
import DeleteButton from 'components/DeleteButton';
|
||||||
import ErrorDetail from 'components/ErrorDetail';
|
import ErrorDetail from 'components/ErrorDetail';
|
||||||
import { LaunchButton, ReLaunchDropDown } from 'components/LaunchButton';
|
import { LaunchButton, ReLaunchDropDown } from 'components/LaunchButton';
|
||||||
@@ -29,12 +29,6 @@ import { toTitleCase } from 'util/strings';
|
|||||||
import { formatDateString } from 'util/dates';
|
import { formatDateString } from 'util/dates';
|
||||||
import { Job } from 'types';
|
import { Job } from 'types';
|
||||||
|
|
||||||
const VariablesInput = styled(_VariablesInput)`
|
|
||||||
.pf-c-form__label {
|
|
||||||
--pf-c-form__label--FontWeight: var(--pf-global--FontWeight--bold);
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StatusDetailValue = styled.div`
|
const StatusDetailValue = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: inline-grid;
|
display: inline-grid;
|
||||||
@@ -420,29 +414,29 @@ function JobDetail({ job, inventorySourceLabels }) {
|
|||||||
label={t`Last Modified`}
|
label={t`Last Modified`}
|
||||||
date={job.modified}
|
date={job.modified}
|
||||||
/>
|
/>
|
||||||
|
{job.extra_vars && (
|
||||||
|
<VariablesDetail
|
||||||
|
css="margin: 20px 0"
|
||||||
|
id="job-variables"
|
||||||
|
readOnly
|
||||||
|
value={job.extra_vars}
|
||||||
|
rows={4}
|
||||||
|
label={t`Variables`}
|
||||||
|
name="extra_vars"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{job.artifacts && (
|
||||||
|
<VariablesDetail
|
||||||
|
css="margin: 20px 0"
|
||||||
|
id="job-artifacts"
|
||||||
|
readOnly
|
||||||
|
value={JSON.stringify(job.artifacts)}
|
||||||
|
rows={4}
|
||||||
|
label={t`Artifacts`}
|
||||||
|
name="artifacts"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</DetailList>
|
</DetailList>
|
||||||
{job.extra_vars && (
|
|
||||||
<VariablesInput
|
|
||||||
css="margin: 20px 0"
|
|
||||||
id="job-variables"
|
|
||||||
readOnly
|
|
||||||
value={job.extra_vars}
|
|
||||||
rows={4}
|
|
||||||
label={t`Variables`}
|
|
||||||
name="extra_vars"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{job.artifacts && (
|
|
||||||
<VariablesInput
|
|
||||||
css="margin: 20px 0"
|
|
||||||
id="job-artifacts"
|
|
||||||
readOnly
|
|
||||||
value={JSON.stringify(job.artifacts)}
|
|
||||||
rows={4}
|
|
||||||
label={t`Artifacts`}
|
|
||||||
name="artifacts"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<CardActionsRow>
|
<CardActionsRow>
|
||||||
{job.type !== 'system_job' &&
|
{job.type !== 'system_job' &&
|
||||||
job.summary_fields.user_capabilities.start &&
|
job.summary_fields.user_capabilities.start &&
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ describe('<JobDetail />', () => {
|
|||||||
wrapper.find('button[aria-label="Delete"]').simulate('click');
|
wrapper.find('button[aria-label="Delete"]').simulate('click');
|
||||||
await sleep(1);
|
await sleep(1);
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
const modal = wrapper.find('Modal');
|
const modal = wrapper.find('Modal[aria-label="Alert modal"]');
|
||||||
expect(modal.length).toBe(1);
|
expect(modal.length).toBe(1);
|
||||||
modal.find('button[aria-label="Confirm Delete"]').simulate('click');
|
modal.find('button[aria-label="Confirm Delete"]').simulate('click');
|
||||||
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
||||||
@@ -272,7 +272,7 @@ describe('<JobDetail />', () => {
|
|||||||
);
|
);
|
||||||
wrapper = mountWithContexts(<JobDetail job={mockJobData} />);
|
wrapper = mountWithContexts(<JobDetail job={mockJobData} />);
|
||||||
wrapper.find('button[aria-label="Delete"]').simulate('click');
|
wrapper.find('button[aria-label="Delete"]').simulate('click');
|
||||||
const modal = wrapper.find('Modal');
|
const modal = wrapper.find('Modal[aria-label="Alert modal"]');
|
||||||
expect(modal.length).toBe(1);
|
expect(modal.length).toBe(1);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
modal.find('button[aria-label="Confirm Delete"]').simulate('click');
|
modal.find('button[aria-label="Confirm Delete"]').simulate('click');
|
||||||
|
|||||||
Reference in New Issue
Block a user