-
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] tgrid cellActions enhancement (#113419)
* Alerts cellAction enhancement * styling * fix types * expandable topN * fix types * styling for filters * styling * rm getDefaultCellActions * styling * globalFilters for topN * rm unused i18n keys * unit test * add i18n * rename component * fix types * update i18n keys * unit tests * styling for reason row renderer * rename file * fix Circular Dependencies * update wording/icons for show top N * cell value text overflow * reason in grid-view * unit test * default selected option for topN * lint error * configurable paddingSize and showLegend for topN * update snapshot * rename reason title * fix cypress * fix cypress * fix unit tests * fix default cell actions * fix page crashing * unit test * add unit tests * code review * fix missing props * fix expand ip button Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
cdce98c
commit 56a2e78
Showing
55 changed files
with
1,540 additions
and
477 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...ion/public/common/components/event_details/__snapshots__/alert_summary_view.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
6 changes: 4 additions & 2 deletions
6
...curity_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
71 changes: 71 additions & 0 deletions
71
x-pack/plugins/security_solution/public/common/components/links/helpers.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,71 @@ | ||
/* | ||
* 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, { SyntheticEvent } from 'react'; | ||
import { | ||
EuiButton, | ||
EuiButtonEmpty, | ||
EuiButtonIcon, | ||
EuiButtonProps, | ||
EuiLink, | ||
EuiLinkProps, | ||
PropsForAnchor, | ||
PropsForButton, | ||
} from '@elastic/eui'; | ||
import styled from 'styled-components'; | ||
|
||
export const LinkButton: React.FC<PropsForButton<EuiButtonProps> | PropsForAnchor<EuiButtonProps>> = | ||
({ children, ...props }) => <EuiButton {...props}>{children}</EuiButton>; | ||
|
||
export const LinkAnchor: React.FC<EuiLinkProps> = ({ children, ...props }) => ( | ||
<EuiLink {...props}>{children}</EuiLink> | ||
); | ||
|
||
export const Comma = styled('span')` | ||
margin-right: 5px; | ||
margin-left: 5px; | ||
&::after { | ||
content: ' ,'; | ||
} | ||
`; | ||
|
||
Comma.displayName = 'Comma'; | ||
|
||
const GenericLinkButtonComponent: React.FC<{ | ||
children?: React.ReactNode; | ||
/** `Component` is only used with `EuiDataGrid`; the grid keeps a reference to `Component` for show / hide functionality */ | ||
Component?: typeof EuiButtonEmpty | typeof EuiButtonIcon; | ||
dataTestSubj?: string; | ||
href: string; | ||
onClick?: (e: SyntheticEvent) => void; | ||
title?: string; | ||
iconType?: string; | ||
}> = ({ children, Component, dataTestSubj, href, onClick, title, iconType = 'expand' }) => { | ||
return Component ? ( | ||
<Component | ||
data-test-subj={dataTestSubj} | ||
href={href} | ||
iconType={iconType} | ||
onClick={onClick} | ||
title={title} | ||
> | ||
{title ?? children} | ||
</Component> | ||
) : ( | ||
<LinkButton data-test-subj={dataTestSubj} href={href} onClick={onClick}> | ||
{title ?? children} | ||
</LinkButton> | ||
); | ||
}; | ||
|
||
export const GenericLinkButton = React.memo(GenericLinkButtonComponent); | ||
|
||
export const PortContainer = styled.div` | ||
& svg { | ||
position: relative; | ||
top: -1px; | ||
} | ||
`; |
Oops, something went wrong.