-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
162224 fix action menu overlaps flyout (#162664)
## Summary Fixes #162224. Currently when **create custom link** button is clicked, though the flyout opens, but action menu persisted over the flyout making the create custom link flyout unusable. On this PR necessary restructuring and refactoring was done to fix this behavior. [Screencast from 07-28-2023 01:52:15 AM.webm](https://github.com/elastic/kibana/assets/5312918/33b7ad00-d10f-41dc-9901-1ccf3006e895) ### Checklist - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
feb2493
commit a29e4aa
Showing
4 changed files
with
115 additions
and
29 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
x-pack/plugins/apm/public/components/shared/transaction_action_menu/custom_link_flyout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { useMemo } from 'react'; | ||
import React from 'react'; | ||
import { Transaction } from '../../../../typings/es_schemas/ui/transaction'; | ||
import { Filter } from '../../../../common/custom_link/custom_link_types'; | ||
import { useFetcher } from '../../../hooks/use_fetcher'; | ||
import { convertFiltersToQuery } from '../../app/settings/custom_link/create_edit_custom_link_flyout/helper'; | ||
import { CreateEditCustomLinkFlyout } from '../../app/settings/custom_link/create_edit_custom_link_flyout'; | ||
|
||
export function CustomLinkFlyout({ | ||
transaction, | ||
isOpen, | ||
onClose, | ||
}: { | ||
transaction?: Transaction; | ||
isOpen: boolean; | ||
onClose: () => void; | ||
}) { | ||
const filters = useMemo( | ||
() => | ||
[ | ||
{ key: 'service.name', value: transaction?.service.name }, | ||
{ key: 'service.environment', value: transaction?.service.environment }, | ||
{ key: 'transaction.name', value: transaction?.transaction.name }, | ||
{ key: 'transaction.type', value: transaction?.transaction.type }, | ||
].filter((filter): filter is Filter => typeof filter.value === 'string'), | ||
[transaction] | ||
); | ||
|
||
const { refetch } = useFetcher( | ||
(callApmApi) => | ||
callApmApi('GET /internal/apm/settings/custom_links', { | ||
isCachable: false, | ||
params: { query: convertFiltersToQuery(filters) }, | ||
}), | ||
[filters] | ||
); | ||
|
||
return ( | ||
<> | ||
{isOpen && ( | ||
<CreateEditCustomLinkFlyout | ||
defaults={{ filters }} | ||
onClose={() => { | ||
onClose(); | ||
}} | ||
onSave={() => { | ||
onClose(); | ||
refetch(); | ||
}} | ||
onDelete={() => { | ||
onClose(); | ||
refetch(); | ||
}} | ||
/> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters