[SIEM] Remove redundant props.key access in kpi stat items (#37461)

* remove redundant key access

* update snapshot
This commit is contained in:
Angela Chuang 2019-05-31 22:04:55 +08:00 committed by GitHub
parent 9417c16e14
commit b8f94a6eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View file

@ -14,9 +14,7 @@ exports[`Stat Items disable charts it renders the default widget 1`] = `
] ]
} }
> >
<Styled(EuiFlexItem) <Styled(EuiFlexItem)>
key="stat-items-undefined"
>
<EuiFlexItem <EuiFlexItem
className="sc-bxivhb bQCHAr" className="sc-bxivhb bQCHAr"
> >
@ -120,9 +118,7 @@ exports[`Stat Items disable charts it renders the default widget 2`] = `
] ]
} }
> >
<Styled(EuiFlexItem) <Styled(EuiFlexItem)>
key="stat-items-undefined"
>
<EuiFlexItem <EuiFlexItem
className="sc-bxivhb bQCHAr" className="sc-bxivhb bQCHAr"
> >
@ -299,9 +295,7 @@ exports[`Stat Items rendering kpis with charts it renders the default widget 1`]
] ]
} }
> >
<Styled(EuiFlexItem) <Styled(EuiFlexItem)>
key="stat-items-undefined"
>
<EuiFlexItem <EuiFlexItem
className="sc-bxivhb bQCHAr" className="sc-bxivhb bQCHAr"
> >

View file

@ -55,7 +55,7 @@ export interface StatItemsProps extends StatItems {
} }
export const StatItemsComponent = React.memo<StatItemsProps>( export const StatItemsComponent = React.memo<StatItemsProps>(
({ fields, description, key, grow, barChart, areaChart, enableAreaChart, enableBarChart }) => { ({ fields, description, grow, barChart, areaChart, enableAreaChart, enableBarChart }) => {
const isBarChartDataAbailable = const isBarChartDataAbailable =
barChart && barChart &&
barChart.length && barChart.length &&
@ -65,7 +65,7 @@ export const StatItemsComponent = React.memo<StatItemsProps>(
areaChart.length && areaChart.length &&
areaChart.every(item => item.value != null && item.value.length > 0); areaChart.every(item => item.value != null && item.value.length > 0);
return ( return (
<FlexItem key={`stat-items-${key}`} grow={grow}> <FlexItem grow={grow}>
<EuiPanel> <EuiPanel>
<EuiTitle size="xxxs"> <EuiTitle size="xxxs">
<h6>{description}</h6> <h6>{description}</h6>