mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Security Solution][RAC] - Hide hover actions overflow (#109693)
* add overflow * fix types error
This commit is contained in:
parent
f0bf877686
commit
9014e113f5
2 changed files with 14 additions and 3 deletions
|
@ -192,11 +192,14 @@ export const allowSorting = ({
|
|||
export const addBuildingBlockStyle = (
|
||||
ecs: Ecs,
|
||||
theme: EuiTheme,
|
||||
setCellProps: EuiDataGridCellValueElementProps['setCellProps']
|
||||
setCellProps: EuiDataGridCellValueElementProps['setCellProps'],
|
||||
defaultStyles?: React.CSSProperties
|
||||
) => {
|
||||
const currentStyles = defaultStyles ?? {};
|
||||
if (isEventBuildingBlockType(ecs)) {
|
||||
setCellProps({
|
||||
style: {
|
||||
...currentStyles,
|
||||
backgroundColor: `${theme.eui.euiColorHighlight}`,
|
||||
},
|
||||
});
|
||||
|
@ -204,6 +207,7 @@ export const addBuildingBlockStyle = (
|
|||
// reset cell style
|
||||
setCellProps({
|
||||
style: {
|
||||
...currentStyles,
|
||||
backgroundColor: 'inherit',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -596,10 +596,17 @@ export const BodyComponent = React.memo<StatefulBodyProps>(
|
|||
const rowData = rowIndex < data.length ? data[rowIndex].data : null;
|
||||
const header = columnHeaders.find((h) => h.id === columnId);
|
||||
const eventId = rowIndex < data.length ? data[rowIndex]._id : null;
|
||||
const defaultStyles = useMemo(
|
||||
() => ({
|
||||
overflow: 'hidden',
|
||||
}),
|
||||
[]
|
||||
);
|
||||
setCellProps({ style: { ...defaultStyles } });
|
||||
|
||||
useEffect(() => {
|
||||
addBuildingBlockStyle(data[rowIndex].ecs, theme, setCellProps);
|
||||
}, [rowIndex, setCellProps]);
|
||||
addBuildingBlockStyle(data[rowIndex].ecs, theme, setCellProps, defaultStyles);
|
||||
}, [rowIndex, setCellProps, defaultStyles]);
|
||||
|
||||
if (rowData == null || header == null || eventId == null) {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue