mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
fix missing ids/alt for a11y fixes
This commit is contained in:
@@ -138,10 +138,12 @@ function AppContainer({ i18n, navRouteConfig = [], children }) {
|
|||||||
}
|
}
|
||||||
}, [handleLogout, timeRemaining]);
|
}, [handleLogout, timeRemaining]);
|
||||||
|
|
||||||
|
const brandName = config?.license_info?.product_name || 'brand';
|
||||||
|
|
||||||
const header = (
|
const header = (
|
||||||
<PageHeader
|
<PageHeader
|
||||||
showNavToggle
|
showNavToggle
|
||||||
logo={<BrandLogo />}
|
logo={<BrandLogo alt={i18n._(t`${brandName} logo`)} />}
|
||||||
logoProps={{ href: '/' }}
|
logoProps={{ href: '/' }}
|
||||||
headerTools={
|
headerTools={
|
||||||
<PageHeaderToolbar
|
<PageHeaderToolbar
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ const BrandImg = styled.img`
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const BrandLogo = () => <BrandImg src="/static/media/logo-header.svg" />;
|
const BrandLogo = ({ alt }) => (
|
||||||
|
<BrandImg src="/static/media/logo-header.svg" alt={alt} />
|
||||||
|
);
|
||||||
|
|
||||||
export default BrandLogo;
|
export default BrandLogo;
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ function VariablesDetail({ dataCy, helpText, value, label, rows, i18n }) {
|
|||||||
css="grid-column: 1 / -1"
|
css="grid-column: 1 / -1"
|
||||||
>
|
>
|
||||||
<ModeToggle
|
<ModeToggle
|
||||||
|
id={`${dataCy}-preview`}
|
||||||
label={label}
|
label={label}
|
||||||
helpText={helpText}
|
helpText={helpText}
|
||||||
dataCy={dataCy}
|
dataCy={dataCy}
|
||||||
@@ -89,6 +90,7 @@ function VariablesDetail({ dataCy, helpText, value, label, rows, i18n }) {
|
|||||||
css="grid-column: 1 / -1; margin-top: -20px"
|
css="grid-column: 1 / -1; margin-top: -20px"
|
||||||
>
|
>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
|
id={`${dataCy}-preview`}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
value={currentValue}
|
value={currentValue}
|
||||||
readOnly
|
readOnly
|
||||||
@@ -123,6 +125,7 @@ function VariablesDetail({ dataCy, helpText, value, label, rows, i18n }) {
|
|||||||
>
|
>
|
||||||
<div className="pf-c-form">
|
<div className="pf-c-form">
|
||||||
<ModeToggle
|
<ModeToggle
|
||||||
|
id={`${dataCy}-preview-expanded`}
|
||||||
label={label}
|
label={label}
|
||||||
helpText={helpText}
|
helpText={helpText}
|
||||||
dataCy={dataCy}
|
dataCy={dataCy}
|
||||||
@@ -134,6 +137,7 @@ function VariablesDetail({ dataCy, helpText, value, label, rows, i18n }) {
|
|||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
/>
|
/>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
|
id={`${dataCy}-preview-expanded`}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
value={currentValue}
|
value={currentValue}
|
||||||
readOnly
|
readOnly
|
||||||
@@ -160,6 +164,7 @@ VariablesDetail.defaultProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function ModeToggle({
|
function ModeToggle({
|
||||||
|
id,
|
||||||
label,
|
label,
|
||||||
helpText,
|
helpText,
|
||||||
dataCy,
|
dataCy,
|
||||||
@@ -176,7 +181,7 @@ function ModeToggle({
|
|||||||
<SplitItem isFilled>
|
<SplitItem isFilled>
|
||||||
<Split hasGutter css="align-items: baseline">
|
<Split hasGutter css="align-items: baseline">
|
||||||
<SplitItem>
|
<SplitItem>
|
||||||
<div className="pf-c-form__label">
|
<label className="pf-c-form__label" htmlFor={id}>
|
||||||
<span
|
<span
|
||||||
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)"
|
||||||
@@ -186,7 +191,7 @@ function ModeToggle({
|
|||||||
{helpText && (
|
{helpText && (
|
||||||
<Popover header={label} content={helpText} id={dataCy} />
|
<Popover header={label} content={helpText} id={dataCy} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</label>
|
||||||
</SplitItem>
|
</SplitItem>
|
||||||
<SplitItem>
|
<SplitItem>
|
||||||
<MultiButtonToggle
|
<MultiButtonToggle
|
||||||
|
|||||||
@@ -33,12 +33,11 @@ function RoutedTabs(props) {
|
|||||||
<Tabs activeKey={getActiveTabId()} onSelect={handleTabSelect}>
|
<Tabs activeKey={getActiveTabId()} onSelect={handleTabSelect}>
|
||||||
{tabsArray.map(tab => (
|
{tabsArray.map(tab => (
|
||||||
<Tab
|
<Tab
|
||||||
aria-label={typeof tab.name === 'string' ? tab.name : ''}
|
aria-label={typeof tab.name === 'string' ? tab.name : null}
|
||||||
eventKey={tab.id}
|
eventKey={tab.id}
|
||||||
key={tab.id}
|
key={tab.id}
|
||||||
link={tab.link}
|
link={tab.link}
|
||||||
title={<TabTitleText>{tab.name}</TabTitleText>}
|
title={<TabTitleText>{tab.name}</TabTitleText>}
|
||||||
role="tab"
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function ProjectListItem({
|
|||||||
/>
|
/>
|
||||||
<Td id={labelId} dataLabel={i18n._(t`Name`)}>
|
<Td id={labelId} dataLabel={i18n._(t`Name`)}>
|
||||||
<span>
|
<span>
|
||||||
<Link id={labelId} to={`${detailUrl}`}>
|
<Link to={`${detailUrl}`}>
|
||||||
<b>{project.name}</b>
|
<b>{project.name}</b>
|
||||||
</Link>
|
</Link>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user