[Accessibility] Spaces List "Roles" Link needs more context #27745 (#36270)

* added aria label
This commit is contained in:
Philipp B 2019-05-13 11:50:25 +03:00 committed by GitHub
parent ecd19d0bab
commit 965340d6a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -15,6 +15,7 @@ exports[`SecureSpaceMessage renders if user profile allows security to be manage
values={
Object {
"rolesLink": <EuiLink
aria-label="Roles management page"
color="primary"
href="#/management/security/roles"
type="button"

View file

@ -6,11 +6,16 @@
import { EuiHorizontalRule, EuiLink, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import React, { Fragment } from 'react';
import { capabilities } from 'ui/capabilities';
export const SecureSpaceMessage = ({}) => {
if (capabilities.get().spaces.manage) {
const rolesLinkTextAriaLabel = i18n.translate(
'xpack.spaces.management.secureSpaceMessage.rolesLinkTextAriaLabel',
{ defaultMessage: 'Roles management page' }
);
return (
<Fragment>
<EuiHorizontalRule />
@ -21,7 +26,7 @@ export const SecureSpaceMessage = ({}) => {
defaultMessage="Want to assign a role to a space? Go to {rolesLink}."
values={{
rolesLink: (
<EuiLink href="#/management/security/roles">
<EuiLink href="#/management/security/roles" aria-label={rolesLinkTextAriaLabel}>
<FormattedMessage
id="xpack.spaces.management.secureSpaceMessage.rolesLinkText"
defaultMessage="Roles"