Skip to content

Commit

Permalink
[8.x] fix: [Stateful: Indices: Overview page] Missing focus on New bu…
Browse files Browse the repository at this point in the history
…tton after closing or cancelling Generate API key dialog (#196905) (#197069)

# Backport

This will backport the following commits from `main` to `8.x`:
- [fix: [Stateful: Indices: Overview page] Missing focus on New button
after closing or cancelling Generate API key dialog
(#196905)](#196905)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Alexey
Antonov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-21T13:59:07Z","message":"fix:
[Stateful: Indices: Overview page] Missing focus on New button after
closing or cancelling Generate API key dialog (#196905)\n\nCloses:
#196174\r\n\r\n## Description \r\n\r\nFocus should be visible on any
accessible element and in order when\r\nnavigating through the elements.
Especially for the users using\r\nassistive technology, only
keyboard.\r\nFor the dialogs, after closing them, focus should be
visible on the\r\nelement which opened it.\r\n\r\n## What was changed:
\r\n1. Cleaned up `generate_api_key_panel.tsx`. No need to
open\r\n`GenerateApiKeyModal` from this level. Same logic duplicated
in\r\n`APIGettingStarted` inner component\r\n\r\n##
Screen\r\n\r\n\r\nhttps://github.com/user-attachments/assets/46a23fdd-ba54-4798-9cb7-a78e28d447b8","sha":"47a497cf3671eee56adeb4787cb4c9271671f5e8","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Project:Accessibility","release_note:skip","v9.0.0","backport:prev-minor"],"title":"fix:
[Stateful: Indices: Overview page] Missing focus on New button after
closing or cancelling Generate API key
dialog","number":196905,"url":"https://github.com/elastic/kibana/pull/196905","mergeCommit":{"message":"fix:
[Stateful: Indices: Overview page] Missing focus on New button after
closing or cancelling Generate API key dialog (#196905)\n\nCloses:
#196174\r\n\r\n## Description \r\n\r\nFocus should be visible on any
accessible element and in order when\r\nnavigating through the elements.
Especially for the users using\r\nassistive technology, only
keyboard.\r\nFor the dialogs, after closing them, focus should be
visible on the\r\nelement which opened it.\r\n\r\n## What was changed:
\r\n1. Cleaned up `generate_api_key_panel.tsx`. No need to
open\r\n`GenerateApiKeyModal` from this level. Same logic duplicated
in\r\n`APIGettingStarted` inner component\r\n\r\n##
Screen\r\n\r\n\r\nhttps://github.com/user-attachments/assets/46a23fdd-ba54-4798-9cb7-a78e28d447b8","sha":"47a497cf3671eee56adeb4787cb4c9271671f5e8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196905","number":196905,"mergeCommit":{"message":"fix:
[Stateful: Indices: Overview page] Missing focus on New button after
closing or cancelling Generate API key dialog (#196905)\n\nCloses:
#196174\r\n\r\n## Description \r\n\r\nFocus should be visible on any
accessible element and in order when\r\nnavigating through the elements.
Especially for the users using\r\nassistive technology, only
keyboard.\r\nFor the dialogs, after closing them, focus should be
visible on the\r\nelement which opened it.\r\n\r\n## What was changed:
\r\n1. Cleaned up `generate_api_key_panel.tsx`. No need to
open\r\n`GenerateApiKeyModal` from this level. Same logic duplicated
in\r\n`APIGettingStarted` inner component\r\n\r\n##
Screen\r\n\r\n\r\nhttps://github.com/user-attachments/assets/46a23fdd-ba54-4798-9cb7-a78e28d447b8","sha":"47a497cf3671eee56adeb4787cb4c9271671f5e8"}}]}]
BACKPORT-->

Co-authored-by: Alexey Antonov <[email protected]>
  • Loading branch information
kibanamachine and alexwizp authored Oct 21, 2024
1 parent 5484f87 commit e1c4ca2
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@

import React from 'react';

import { useActions, useValues } from 'kea';
import { useValues } from 'kea';

import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import { GenerateApiKeyModal } from './components/generate_api_key_modal/modal';

import { APIGettingStarted } from './components/getting_started/getting_started';
import { IndexViewLogic } from './index_view_logic';
import { OverviewLogic } from './overview.logic';

export const GenerateApiKeyPanel: React.FC = () => {
const { isGenerateModalOpen } = useValues(OverviewLogic);
const { indexName, isHiddenIndex } = useValues(IndexViewLogic);
const { closeGenerateModal } = useActions(OverviewLogic);
const { isHiddenIndex } = useValues(IndexViewLogic);

return (
<>
{isGenerateModalOpen && (
<GenerateApiKeyModal indexName={indexName} onClose={closeGenerateModal} />
)}
<EuiFlexGroup>
<EuiFlexItem>
<EuiPanel hasBorder paddingSize="xl">
Expand Down

0 comments on commit e1c4ca2

Please sign in to comment.