Skip to content

Commit

Permalink
Remove unnecessary null value from type def
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Dec 23, 2024
1 parent 6627118 commit e785bf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface ActionFilterProps {
orLabel,
}: Record<string, JSX.Element | string | undefined>) => JSX.Element
/** Only show these property math definitions */
onlyPropertyMathDefinitions?: Array<string> | null
onlyPropertyMathDefinitions?: Array<string>
}

export const ActionFilter = React.forwardRef<HTMLDivElement, ActionFilterProps>(function ActionFilter(
Expand Down Expand Up @@ -118,7 +118,7 @@ export const ActionFilter = React.forwardRef<HTMLDivElement, ActionFilterProps>(
buttonType = 'tertiary',
readOnly = false,
bordered = false,
onlyPropertyMathDefinitions = null,
onlyPropertyMathDefinitions,
},
ref
): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> | null
onlyPropertyMathDefinitions?: Array<string>
}

export function ActionFilterRow({
Expand Down Expand Up @@ -157,7 +157,7 @@ export function ActionFilterRow({
renderRow,
trendsDisplayCategory,
showNumericalPropsOnly,
onlyPropertyMathDefinitions = null,
onlyPropertyMathDefinitions,
}: ActionFilterRowProps): JSX.Element {
const { entityFilterVisible } = useValues(logic)
const {
Expand Down Expand Up @@ -647,7 +647,7 @@ interface MathSelectorProps {
trendsDisplayCategory: ChartDisplayCategory | null
style?: React.CSSProperties
/** Only show these property math definitions */
onlyPropertyMathDefinitions?: Array<string> | null
onlyPropertyMathDefinitions?: Array<string>
}

function isPropertyValueMath(math: string | undefined): math is PropertyMathType {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e785bf6

Please sign in to comment.