mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix remaining a11y issues (#43420)
* add aria labels * reverting * chore: revert yarn.lock Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
This commit is contained in:
parent
339cfb8736
commit
5db03cf91a
@ -46,6 +46,7 @@ export const AlertManagerPicker: FC<Props> = ({ onChange, current, disabled = fa
|
||||
data-testid="alertmanager-picker"
|
||||
>
|
||||
<Select
|
||||
aria-label={disabled ? 'Alertmanager' : 'Choose Alertmanager'}
|
||||
menuShouldPortal
|
||||
width={29}
|
||||
className="ds-picker select-container"
|
||||
|
@ -97,6 +97,7 @@ export const ReceiversTable: FC<Props> = ({ config, alertManagerName }) => {
|
||||
{!isVanillaAM && (
|
||||
<>
|
||||
<ActionIcon
|
||||
aria-label="Edit"
|
||||
data-testid="edit"
|
||||
to={makeAMLink(
|
||||
`/alerting/notifications/receivers/${encodeURIComponent(receiver.name)}/edit`,
|
||||
|
@ -27,17 +27,24 @@ export const ActionIcon: FC<Props> = ({
|
||||
tooltipPlacement = 'top',
|
||||
...rest
|
||||
}) => {
|
||||
const ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;
|
||||
const iconEl = (
|
||||
<Icon role="button" className={cx(useStyles(getStyle), className)} onClick={onClick} name={icon} {...rest} />
|
||||
<Icon
|
||||
role="button"
|
||||
className={cx(useStyles(getStyle), className)}
|
||||
onClick={onClick}
|
||||
name={icon}
|
||||
{...rest}
|
||||
aria-label={ariaLabel}
|
||||
/>
|
||||
);
|
||||
|
||||
const ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;
|
||||
return (
|
||||
<Tooltip content={tooltip} placement={tooltipPlacement}>
|
||||
{(() => {
|
||||
if (to) {
|
||||
return (
|
||||
<Link aria-label={ariaLabel} to={to} target={target}>
|
||||
<Link to={to} target={target}>
|
||||
{iconEl}
|
||||
</Link>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user