mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
job detail style tweaks
This commit is contained in:
@@ -32,12 +32,42 @@ const CodeMirror = styled(ReactCodeMirror)`
|
|||||||
background: var(--pf-c-form-control--invalid--Background);
|
background: var(--pf-c-form-control--invalid--Background);
|
||||||
border-bottom-width: var(--pf-c-form-control--invalid--BorderBottomWidth);
|
border-bottom-width: var(--pf-c-form-control--invalid--BorderBottomWidth);
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
|
${props =>
|
||||||
|
props.options &&
|
||||||
|
props.options.readOnly &&
|
||||||
|
`
|
||||||
|
&,
|
||||||
|
&:hover {
|
||||||
|
--pf-c-form-control--BorderBottomColor: var(--pf-global--BorderColor--300);
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-cursors {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lines {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-scroll {
|
||||||
|
background-color: var(--pf-c-form-control--disabled--BackgroundColor);
|
||||||
|
}
|
||||||
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function CodeMirrorInput({ value, onChange, mode, readOnly, hasErrors, rows }) {
|
function CodeMirrorInput({
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
mode,
|
||||||
|
readOnly,
|
||||||
|
hasErrors,
|
||||||
|
rows,
|
||||||
|
className,
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<CodeMirror
|
<CodeMirror
|
||||||
className="pf-c-form-control"
|
className={`pf-c-form-control ${className}`}
|
||||||
value={value}
|
value={value}
|
||||||
onBeforeChange={(editor, data, val) => onChange(val)}
|
onBeforeChange={(editor, data, val) => onChange(val)}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ const SmallButton = styled(Button)`
|
|||||||
font-size: var(--pf-global--FontSize--xs);
|
font-size: var(--pf-global--FontSize--xs);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const SplitItemRight = styled(SplitItem)`
|
||||||
|
margin-bottom: 5px;
|
||||||
|
`;
|
||||||
|
|
||||||
function VariablesInput(props) {
|
function VariablesInput(props) {
|
||||||
const { id, label, readOnly, rows, error, onError, className } = props;
|
const { id, label, readOnly, rows, error, onError, className } = props;
|
||||||
/* eslint-disable react/destructuring-assignment */
|
/* eslint-disable react/destructuring-assignment */
|
||||||
@@ -44,7 +48,7 @@ function VariablesInput(props) {
|
|||||||
{label}
|
{label}
|
||||||
</label>
|
</label>
|
||||||
</SplitItem>
|
</SplitItem>
|
||||||
<SplitItem>
|
<SplitItemRight>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<SmallButton
|
<SmallButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -79,7 +83,7 @@ function VariablesInput(props) {
|
|||||||
JSON
|
JSON
|
||||||
</SmallButton>
|
</SmallButton>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</SplitItem>
|
</SplitItemRight>
|
||||||
</Split>
|
</Split>
|
||||||
<CodeMirrorInput
|
<CodeMirrorInput
|
||||||
mode={mode}
|
mode={mode}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const DetailList = ({ children, stacked, ...props }) => (
|
|||||||
export default styled(DetailList)`
|
export default styled(DetailList)`
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
|
align-items: baseline;
|
||||||
${props =>
|
${props =>
|
||||||
props.stacked
|
props.stacked
|
||||||
? `
|
? `
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { CardBody, Button } from '@patternfly/react-core';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { DetailList, Detail } from '@components/DetailList';
|
import { DetailList, Detail } from '@components/DetailList';
|
||||||
import { ChipGroup, Chip, CredentialChip } from '@components/Chip';
|
import { ChipGroup, Chip, CredentialChip } from '@components/Chip';
|
||||||
import { VariablesInput } from '@components/CodeMirrorInput';
|
import { VariablesInput as _VariablesInput } from '@components/CodeMirrorInput';
|
||||||
import { toTitleCase } from '@util/strings';
|
import { toTitleCase } from '@util/strings';
|
||||||
import { Job } from '../../../types';
|
import { Job } from '../../../types';
|
||||||
|
|
||||||
@@ -15,6 +15,12 @@ const ActionButtonWrapper = styled.div`
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const VariablesInput = styled(_VariablesInput)`
|
||||||
|
.pf-c-form__label {
|
||||||
|
--pf-c-form__label--FontWeight: var(--pf-global--FontWeight--bold);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const VERBOSITY = {
|
const VERBOSITY = {
|
||||||
0: '0 (Normal)',
|
0: '0 (Normal)',
|
||||||
1: '1 (Verbose)',
|
1: '1 (Verbose)',
|
||||||
@@ -128,14 +134,16 @@ function JobDetail({ job, i18n }) {
|
|||||||
label={i18n._(t`Variables`)}
|
label={i18n._(t`Variables`)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<VariablesInput
|
{job.artifacts && (
|
||||||
css="margin: 20px 0"
|
<VariablesInput
|
||||||
id="job-artifacts"
|
css="margin: 20px 0"
|
||||||
readOnly
|
id="job-artifacts"
|
||||||
value={job.artifacts ? JSON.stringify(job.artifacts) : '{}'}
|
readOnly
|
||||||
rows={4}
|
value={JSON.stringify(job.artifacts)}
|
||||||
label={i18n._(t`Artifacts`)}
|
rows={4}
|
||||||
/>
|
label={i18n._(t`Artifacts`)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<ActionButtonWrapper>
|
<ActionButtonWrapper>
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
|
|||||||
Reference in New Issue
Block a user