Skip to content

Commit

Permalink
Add screen reader attributes for API key flyout code editors (elastic…
Browse files Browse the repository at this point in the history
…#169265)

## Summary

Closes elastic#169127 


## Fixes

- Added aria-labels for Access control, Role Descriptors and Metadata
code editors
  • Loading branch information
SiddharthMantri authored Oct 23, 2023
1 parent 2146a7e commit 71bbbac
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ export const ApiKeyFlyout: FunctionComponent<ApiKeyFlyoutProps> = ({
<FormField
as={CodeEditorField}
name="access"
aria-label={i18n.translate(
'xpack.security.management.apiKeys.apiKeyFlyout.accessCodeEditor',
{
defaultMessage: 'Code editor for access permissions',
}
)}
value={formik.values.access}
options={{ readOnly: readOnly || (apiKey && !canEdit) }}
onChange={(value: string) => formik.setFieldValue('access', value)}
Expand Down Expand Up @@ -500,6 +506,12 @@ export const ApiKeyFlyout: FunctionComponent<ApiKeyFlyoutProps> = ({
<FormField
as={CodeEditorField}
name="role_descriptors"
aria-label={i18n.translate(
'xpack.security.management.apiKeys.apiKeyFlyout.roleDescriptorsCodeEditor',
{
defaultMessage: 'Code editor for role descriptors of this API key',
}
)}
value={formik.values.role_descriptors}
options={{ readOnly: readOnly || (apiKey && !canEdit) }}
onChange={(value: string) =>
Expand Down Expand Up @@ -631,6 +643,13 @@ export const ApiKeyFlyout: FunctionComponent<ApiKeyFlyoutProps> = ({
<FormField
as={CodeEditorField}
name="metadata"
aria-label={i18n.translate(
'xpack.security.management.apiKeys.apiKeyFlyout.metadataCodeEditor',
{
defaultMessage:
'Code editor for arbitrary metadata associated with the API key',
}
)}
options={{ readOnly: readOnly || (apiKey && !canEdit) }}
value={formik.values.metadata}
onChange={(value: string) => formik.setFieldValue('metadata', value)}
Expand Down

0 comments on commit 71bbbac

Please sign in to comment.