Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,13 @@ export const mapSortingColumns = ({
export const addBuildingBlockStyle = (
ecs: Ecs,
theme: EuiTheme,
setCellProps: EuiDataGridCellValueElementProps['setCellProps'],
defaultStyles?: React.CSSProperties
setCellProps: EuiDataGridCellValueElementProps['setCellProps']
) => {
const currentStyles = defaultStyles ?? {};
if (isEventBuildingBlockType(ecs)) {
setCellProps({
style: {
...currentStyles,
backgroundColor: `${theme.eui.euiColorHighlight}`,
},
});
setCellProps({ style: { backgroundColor: `${theme.eui.euiColorHighlight}` } });
} else {
// reset cell style
setCellProps({
style: {
...currentStyles,
backgroundColor: 'inherit',
},
});
setCellProps({ style: { backgroundColor: 'inherit' } });
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,8 @@ export const DataTableComponent = React.memo<DataTableProps>(
const ecs = pageRowIndex < data.length ? data[pageRowIndex].ecs : null;

useEffect(() => {
const defaultStyles = { overflow: 'hidden' };
setCellProps({ style: { ...defaultStyles } });
if (ecs && rowData) {
addBuildingBlockStyle(ecs, theme, setCellProps, defaultStyles);
addBuildingBlockStyle(ecs, theme, setCellProps);
} else {
// disable the cell when it has no data
setCellProps({ style: { display: 'none' } });
Expand Down