Skip to content
Merged
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 @@ -278,6 +278,25 @@ export const AlertsTableComponent: FC<DetectionEngineAlertTableProps> = ({
};
}, [isEventRenderedView]);

/**
* if records are too less, we don't want table to be of fixed height.
* it should shrink to the content height.
* Height setting enables/disables virtualization depending on fixed/undefined height values respectively.
* */
const alertTableHeight = useMemo(
() =>
isEventRenderedView
? `${DEFAULT_DATA_GRID_HEIGHT}px`
: /*
* We keep fixed height in Event rendered because of the row height issue
* as mentioned here
*/
count > 20
? `${DEFAULT_DATA_GRID_HEIGHT}px`
: undefined,
[count, isEventRenderedView]
);

const alertStateProps: AlertsTableStateProps = useMemo(
() => ({
alertsTableConfigurationRegistry: triggersActionsUi.alertsTableConfigurationRegistry,
Expand All @@ -296,10 +315,7 @@ export const AlertsTableComponent: FC<DetectionEngineAlertTableProps> = ({
cellContext,
onLoaded: onLoad,
toolbarVisibility,
// if records are too less, we don't want table to be of fixed height.
// it should shrink to the content height.
// Height setting enables/disables virtualization depending on fixed/undefined height values respectively.
height: count >= 20 ? `${DEFAULT_DATA_GRID_HEIGHT}px` : undefined,
height: alertTableHeight,
initialPageSize: 50,
runtimeMappings: sourcererDataView.runtimeFieldMap as RunTimeMappings,
}),
Expand All @@ -316,8 +332,8 @@ export const AlertsTableComponent: FC<DetectionEngineAlertTableProps> = ({
cellContext,
onLoad,
toolbarVisibility,
count,
sourcererDataView.runtimeFieldMap,
alertTableHeight,
]
);

Expand Down