Skip to content

Commit

Permalink
Feature/risk summary build columns variable (elastic#197059)
Browse files Browse the repository at this point in the history
  • Loading branch information
CAWilson94 authored Oct 23, 2024
1 parent fa9bb19 commit d94bf9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface EntityData {
risk: RiskStats;
}

export const buildColumns: () => Array<EuiBasicTableColumn<TableItem>> = () => [
export const columnsArray: Array<EuiBasicTableColumn<TableItem>> = [
{
field: 'category',
name: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import type { RiskScoreState } from '../../api/hooks/use_risk_score';
import { getRiskScoreSummaryAttributes } from '../../lens_attributes/risk_score_summary';

import {
buildColumns,
columnsArray,
getEntityData,
getItems,
isUserRiskData,
Expand Down Expand Up @@ -80,9 +80,6 @@ const FlyoutRiskSummaryComponent = <T extends RiskScoreEntity>({
}, [entityData?.name, entityData?.risk?.calculated_level, riskData]);

const xsFontSize = useEuiFontSize('xxs').fontSize;

const columns = useMemo(() => buildColumns(), []);

const rows = useMemo(() => getItems(entityData), [entityData]);

const onToggle = useCallback(
Expand Down Expand Up @@ -263,7 +260,7 @@ const FlyoutRiskSummaryComponent = <T extends RiskScoreEntity>({
<EuiBasicTable
data-test-subj="risk-summary-table"
responsiveBreakpoint={false}
columns={columns}
columns={columnsArray}
items={rows}
compressed
loading={riskScoreData.loading || recalculatingScore}
Expand Down

0 comments on commit d94bf9a

Please sign in to comment.