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:
parent
f4e87389f1
commit
5c23a52119
@ -99,6 +99,8 @@ export const CopyStrategyIconMenu: VFC<ICopyStrategyIconMenuProps> = ({
|
|||||||
checkAccess(CREATE_FEATURE_STRATEGY, environment),
|
checkAccess(CREATE_FEATURE_STRATEGY, environment),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const label = `Copy to environment${enabled ? '' : ' (Access denied)'}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ChangeRequestDialogue
|
<ChangeRequestDialogue
|
||||||
@ -115,15 +117,12 @@ export const CopyStrategyIconMenu: VFC<ICopyStrategyIconMenuProps> = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip title={label}>
|
||||||
title={`Copy to environment${
|
|
||||||
enabled ? '' : ' (Access denied)'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<IconButton
|
<IconButton
|
||||||
size='large'
|
size='large'
|
||||||
id={`copy-strategy-icon-menu-${strategy.id}`}
|
id={`copy-strategy-icon-menu-${strategy.id}`}
|
||||||
|
aria-label={label}
|
||||||
aria-controls={open ? 'basic-menu' : undefined}
|
aria-controls={open ? 'basic-menu' : undefined}
|
||||||
aria-haspopup='true'
|
aria-haspopup='true'
|
||||||
aria-expanded={open ? 'true' : undefined}
|
aria-expanded={open ? 'true' : undefined}
|
||||||
|
@ -32,13 +32,16 @@ export const FeatureOverviewSidePanelEnvironmentHider = ({
|
|||||||
setHiddenEnvironments(environment.name);
|
setHiddenEnvironments(environment.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isHidden = hiddenEnvironments.has(environment.name);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledVisibilityToggle
|
<StyledVisibilityToggle
|
||||||
onClick={toggleHiddenEnvironments}
|
onClick={toggleHiddenEnvironments}
|
||||||
visibilityOff={hiddenEnvironments.has(environment.name)}
|
visibilityOff={isHidden}
|
||||||
|
aria-label={`${isHidden ? 'Show' : 'Hide'} environment "${environment.name}"`}
|
||||||
>
|
>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={hiddenEnvironments.has(environment.name)}
|
condition={isHidden}
|
||||||
show={<VisibilityOff />}
|
show={<VisibilityOff />}
|
||||||
elseShow={<Visibility />}
|
elseShow={<Visibility />}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user