From e785bf687386baf2287971c4bb3b69702bfc53b1 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 23 Dec 2024 08:02:00 -0800 Subject: [PATCH] Remove unnecessary `null` value from type def --- .../scenes/insights/filters/ActionFilter/ActionFilter.tsx | 4 ++-- .../ActionFilter/ActionFilterRow/ActionFilterRow.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilter.tsx b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilter.tsx index 03be753ff14ce..28c1e19d8419c 100644 --- a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilter.tsx +++ b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilter.tsx @@ -87,7 +87,7 @@ export interface ActionFilterProps { orLabel, }: Record) => JSX.Element /** Only show these property math definitions */ - onlyPropertyMathDefinitions?: Array | null + onlyPropertyMathDefinitions?: Array } export const ActionFilter = React.forwardRef(function ActionFilter( @@ -118,7 +118,7 @@ export const ActionFilter = React.forwardRef( buttonType = 'tertiary', readOnly = false, bordered = false, - onlyPropertyMathDefinitions = null, + onlyPropertyMathDefinitions, }, ref ): JSX.Element { diff --git a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx index 7332432621bcf..026f8bdda9de7 100644 --- a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx +++ b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx @@ -127,7 +127,7 @@ export interface ActionFilterRowProps { /** Whether properties shown should be limited to just numerical types */ showNumericalPropsOnly?: boolean /** Only show these property math definitions */ - onlyPropertyMathDefinitions?: Array | null + onlyPropertyMathDefinitions?: Array } export function ActionFilterRow({ @@ -157,7 +157,7 @@ export function ActionFilterRow({ renderRow, trendsDisplayCategory, showNumericalPropsOnly, - onlyPropertyMathDefinitions = null, + onlyPropertyMathDefinitions, }: ActionFilterRowProps): JSX.Element { const { entityFilterVisible } = useValues(logic) const { @@ -647,7 +647,7 @@ interface MathSelectorProps { trendsDisplayCategory: ChartDisplayCategory | null style?: React.CSSProperties /** Only show these property math definitions */ - onlyPropertyMathDefinitions?: Array | null + onlyPropertyMathDefinitions?: Array } function isPropertyValueMath(math: string | undefined): math is PropertyMathType { @@ -767,7 +767,7 @@ function useMathSelectorOptions({ }} options={Object.entries(PROPERTY_MATH_DEFINITIONS) .filter(([key]) => { - if (null === onlyPropertyMathDefinitions) { + if (undefined === onlyPropertyMathDefinitions) { return true } return onlyPropertyMathDefinitions.includes(key)