Skip to content

Commit

Permalink
[Security Solution][RAC] - Hide hover actions overflow (elastic#109693)
Browse files Browse the repository at this point in the history
* add overflow

* fix types error
  • Loading branch information
michaelolo24 authored and kibanamachine committed Aug 24, 2021
1 parent f13c4a8 commit bda3070
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,22 @@ 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}`,
},
});
} else {
// reset cell style
setCellProps({
style: {
...currentStyles,
backgroundColor: 'inherit',
},
});
Expand Down
11 changes: 9 additions & 2 deletions x-pack/plugins/timelines/public/components/t_grid/body/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bda3070

Please sign in to comment.