Skip to content

Commit

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

* add overflow

* fix types error

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
  • Loading branch information
kibanamachine and michaelolo24 authored Aug 24, 2021
1 parent 273ab1e commit 113d5f2
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 113d5f2

Please sign in to comment.