[Security Solution][RAC] - Hide hover actions overflow (#109693)

* add overflow

* fix types error
This commit is contained in:
Michael Olorunnisola 2021-08-24 07:44:27 -04:00 committed by GitHub
parent f0bf877686
commit 9014e113f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -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',
},
});

View file

@ -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;