Alerting: Fix remaining a11y issues (#43420)

* add aria labels

* reverting

* chore: revert yarn.lock

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
pull/43428/head
Peter Holmberg 4 years ago committed by GitHub
parent 339cfb8736
commit 5db03cf91a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      public/app/features/alerting/unified/components/AlertManagerPicker.tsx
  2. 1
      public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx
  3. 13
      public/app/features/alerting/unified/components/rules/ActionIcon.tsx

@ -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…
Cancel
Save