From 0a1ec8f846cb0c78cfe3ddd0f2c1b4ccd1b3365b Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Mon, 4 Nov 2024 16:47:33 +0200 Subject: [PATCH] fix: [Stateful: Home page] Not accessible element, showing number of active API keys, via keyboard (#197456) Closes: #195209 This PR is based on the following comment: > @cee-chen / @bhavyarm, could you please validate this issue? I'm not sure if the badge should be keyboard accessible. On the other hand, I think it might make sense to move active API keys inside the badge. However, this is more of a design question rather than an a11y one. _Originally posted by @alexwizp in [#195209](https://github.com/elastic/kibana/issues/195209#issuecomment-2429091670)_ This PR move text inside badge to address a11y concerns. ## Screen: image --- .../shared/api_key/api_key_panel.tsx | 34 ++++++++----------- .../panels/api_key_panel_content.tsx | 32 +++++++---------- 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx index 34c7ac66343c9..b9d5cf8c414d6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx @@ -76,6 +76,7 @@ export const ApiKeyPanel: React.FC = () => { {(copy) => ( { {(copy) => ( { - - - - 0 ? 'success' : 'warning'} - data-test-subj="api-keys-count-badge" - > - {apiKeys.length} - - ), - }} - /> - - - + 0 ? 'success' : 'warning'} + data-test-subj="api-keys-count-badge" + > + + diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/api_key_panel_content.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/api_key_panel_content.tsx index ff271a3a3d79e..a220e077f0824 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/api_key_panel_content.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/api_key_panel_content.tsx @@ -102,26 +102,18 @@ export const ApiKeyPanelContent: React.FC = ({ apiKeys, open - - - - 0 ? 'success' : 'warning'} - data-test-subj="api-keys-count-badge" - > - {apiKeys?.length || 0} - - ), - }} - /> - - - + 0 ? 'success' : 'warning'} + data-test-subj="api-keys-count-badge" + > + +