[9.0] [A11y][APM] Add aria-label to "Try our new inventory" button (#215633) (#215760)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[A11y][APM] Add `aria-label` to "Try our new inventory" button
(#215633)](https://github.com/elastic/kibana/pull/215633)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Sergi
Romeu","email":"sergi.romeu@elastic.co"},"sourceCommit":{"committedDate":"2025-03-24T16:12:15Z","message":"[A11y][APM]
Add `aria-label` to \"Try our new inventory\" button (#215633)\n\n##
Summary\n\nFixes #210253\n\nThis PR adds an `aria-label` with the same
content as the tooltip to\nsolve the \"Button must have a discernible
text\" A11y critical issue.\n\n## How to test\n1. Download the
[axe\ndevtools](https://chromewebstore.google.com/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd)\n2.
Enable ECO feature flag\n3. Go into service inventory and run the
scanner from axe devtools\n4. You should see a critical error\n5.
Checkout this branch\n6. Error should be
solved\n\n---------\n\nCo-authored-by: Carlos Crespo
<crespocarlos@users.noreply.github.com>","sha":"7512aa30fa242e892f2729a1e2cd44e8a779341f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","apm","Team:obs-ux-infra_services","backport:version","a11y","v8.18.0","v9.1.0","v8.19.0"],"title":"[A11y][APM]
Add `aria-label` to \"Try our new inventory\" button
","number":215633,"url":"https://github.com/elastic/kibana/pull/215633","mergeCommit":{"message":"[A11y][APM]
Add `aria-label` to \"Try our new inventory\" button (#215633)\n\n##
Summary\n\nFixes #210253\n\nThis PR adds an `aria-label` with the same
content as the tooltip to\nsolve the \"Button must have a discernible
text\" A11y critical issue.\n\n## How to test\n1. Download the
[axe\ndevtools](https://chromewebstore.google.com/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd)\n2.
Enable ECO feature flag\n3. Go into service inventory and run the
scanner from axe devtools\n4. You should see a critical error\n5.
Checkout this branch\n6. Error should be
solved\n\n---------\n\nCo-authored-by: Carlos Crespo
<crespocarlos@users.noreply.github.com>","sha":"7512aa30fa242e892f2729a1e2cd44e8a779341f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215633","number":215633,"mergeCommit":{"message":"[A11y][APM]
Add `aria-label` to \"Try our new inventory\" button (#215633)\n\n##
Summary\n\nFixes #210253\n\nThis PR adds an `aria-label` with the same
content as the tooltip to\nsolve the \"Button must have a discernible
text\" A11y critical issue.\n\n## How to test\n1. Download the
[axe\ndevtools](https://chromewebstore.google.com/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd)\n2.
Enable ECO feature flag\n3. Go into service inventory and run the
scanner from axe devtools\n4. You should see a critical error\n5.
Checkout this branch\n6. Error should be
solved\n\n---------\n\nCo-authored-by: Carlos Crespo
<crespocarlos@users.noreply.github.com>","sha":"7512aa30fa242e892f2729a1e2cd44e8a779341f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
This commit is contained in:
Kibana Machine 2025-03-24 19:11:39 +01:00 committed by GitHub
parent 30fe2f3c69
commit 29b255c23d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@
import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiToolTip, EuiButtonIcon } from '@elastic/eui';
import { TechnicalPreviewBadge } from '@kbn/observability-shared-plugin/public';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import type { ApmPluginStartDeps } from '../../../../plugin';
@ -49,6 +50,9 @@ export function EntitiesInventoryCallout({ onDismiss }: EntitiesInventoryCallout
>
<EuiButtonIcon
data-test-subj="apmEntitiesInventoryCalloutDismiss"
aria-label={i18n.translate('xpack.apm.entitiesInventoryCallout.ariaLabel', {
defaultMessage: 'Hide the entities inventory callout',
})}
iconType="cross"
onClick={onDismiss}
/>