-
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.
[Security solution][Endpoint] Add back button when to the event filte…
…rs list (#101280) * Add back button when to the event filters list. Isolated back to external app button to be used as generic component * Adds unit tests for back button Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
16e66b8
commit e94a34d
Showing
12 changed files
with
151 additions
and
67 deletions.
There are no files selected for viewing
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
52 changes: 52 additions & 0 deletions
52
.../public/management/components/back_to_external_app_button/back_to_external_app_button.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,52 @@ | ||
/* | ||
* 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 React, { memo } from 'react'; | ||
|
||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiButtonEmpty } from '@elastic/eui'; | ||
import styled from 'styled-components'; | ||
|
||
import { ListPageRouteState } from '../../../../common/endpoint/types'; | ||
|
||
import { useNavigateToAppEventHandler } from '../../../common/hooks/endpoint/use_navigate_to_app_event_handler'; | ||
|
||
const EuiButtonEmptyStyled = styled(EuiButtonEmpty)` | ||
margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; | ||
.euiIcon { | ||
width: ${({ theme }) => theme.eui.euiIconSizes.small}; | ||
height: ${({ theme }) => theme.eui.euiIconSizes.small}; | ||
} | ||
.text { | ||
font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; | ||
} | ||
`; | ||
|
||
export const BackToExternalAppButton = memo<ListPageRouteState>( | ||
({ backButtonLabel, backButtonUrl, onBackButtonNavigateTo }) => { | ||
const handleBackOnClick = useNavigateToAppEventHandler(...onBackButtonNavigateTo!); | ||
|
||
return ( | ||
<EuiButtonEmptyStyled | ||
flush="left" | ||
size="xs" | ||
iconType="arrowLeft" | ||
href={backButtonUrl!} | ||
onClick={handleBackOnClick} | ||
textProps={{ className: 'text' }} | ||
data-test-subj="backToOrigin" | ||
> | ||
{backButtonLabel || ( | ||
<FormattedMessage id="xpack.securitySolution.list.backButton" defaultMessage="Back" /> | ||
)} | ||
</EuiButtonEmptyStyled> | ||
); | ||
} | ||
); | ||
|
||
BackToExternalAppButton.displayName = 'BackToExternalAppButton'; |
8 changes: 8 additions & 0 deletions
8
...ugins/security_solution/public/management/components/back_to_external_app_button/index.ts
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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { BackToExternalAppButton } from './back_to_external_app_button'; |
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
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
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