1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-14 01:16:17 +02:00

fix: add some missing button labels on the project page (#9299)

Adds aria-labels to the env visibility toggle button and the "copy
env" button.
This commit is contained in:
Thomas Heartman 2025-02-12 09:39:03 +01:00 committed by GitHub
parent f4e87389f1
commit 5c23a52119
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -99,6 +99,8 @@ export const CopyStrategyIconMenu: VFC<ICopyStrategyIconMenuProps> = ({
checkAccess(CREATE_FEATURE_STRATEGY, environment),
);
const label = `Copy to environment${enabled ? '' : ' (Access denied)'}`;
return (
<div>
<ChangeRequestDialogue
@ -115,15 +117,12 @@ export const CopyStrategyIconMenu: VFC<ICopyStrategyIconMenuProps> = ({
/>
}
/>
<Tooltip
title={`Copy to environment${
enabled ? '' : ' (Access denied)'
}`}
>
<Tooltip title={label}>
<div>
<IconButton
size='large'
id={`copy-strategy-icon-menu-${strategy.id}`}
aria-label={label}
aria-controls={open ? 'basic-menu' : undefined}
aria-haspopup='true'
aria-expanded={open ? 'true' : undefined}

View File

@ -32,13 +32,16 @@ export const FeatureOverviewSidePanelEnvironmentHider = ({
setHiddenEnvironments(environment.name);
};
const isHidden = hiddenEnvironments.has(environment.name);
return (
<StyledVisibilityToggle
onClick={toggleHiddenEnvironments}
visibilityOff={hiddenEnvironments.has(environment.name)}
visibilityOff={isHidden}
aria-label={`${isHidden ? 'Show' : 'Hide'} environment "${environment.name}"`}
>
<ConditionallyRender
condition={hiddenEnvironments.has(environment.name)}
condition={isHidden}
show={<VisibilityOff />}
elseShow={<Visibility />}
/>