fix settings pages a11y issues

This commit is contained in:
Keith J. Grant
2021-07-21 15:14:56 -07:00
parent 5fb1b604bf
commit 77f2729a76
2 changed files with 6 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ import Popover from '../Popover';
function CodeDetail({ value, label, mode, rows, helpText, dataCy }) { function CodeDetail({ value, label, mode, rows, helpText, dataCy }) {
const labelCy = dataCy ? `${dataCy}-label` : null; const labelCy = dataCy ? `${dataCy}-label` : null;
const valueCy = dataCy ? `${dataCy}-value` : null; const valueCy = dataCy ? `${dataCy}-value` : null;
const editorId = dataCy ? `${dataCy}-editor` : 'code-editor';
return ( return (
<> <>
@@ -27,12 +28,13 @@ function CodeDetail({ value, label, mode, rows, helpText, dataCy }) {
data-cy={labelCy} data-cy={labelCy}
> >
<div className="pf-c-form__label"> <div className="pf-c-form__label">
<span <label
htmlFor={editorId}
className="pf-c-form__label-text" className="pf-c-form__label-text"
css="font-weight: var(--pf-global--FontWeight--bold)" css="font-weight: var(--pf-global--FontWeight--bold)"
> >
{label} {label}
</span> </label>
{helpText && ( {helpText && (
<Popover header={label} content={helpText} id={dataCy} /> <Popover header={label} content={helpText} id={dataCy} />
)} )}
@@ -45,6 +47,7 @@ function CodeDetail({ value, label, mode, rows, helpText, dataCy }) {
data-cy={valueCy} data-cy={valueCy}
> >
<CodeEditor <CodeEditor
id={editorId}
mode={mode} mode={mode}
value={value} value={value}
readOnly readOnly

View File

@@ -29,7 +29,7 @@ const DetailValue = styled(
${(props) => ${(props) =>
(props.isEncrypted || props.isNotConfigured) && (props.isEncrypted || props.isNotConfigured) &&
` `
color: var(--pf-global--Color--400); color: var(--pf-global--disabled-color--100);
`} `}
`; `;