mirror of https://github.com/apache/superset.git
fix(dashboard): Fix FilterWithDataMask typing and add null check (#22260)
This commit is contained in:
parent
fb3e717573
commit
a642d126f8
|
@ -91,7 +91,7 @@ export type Filter = {
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FilterWithDataMask = Filter & { dataMask: DataMaskWithId };
|
export type FilterWithDataMask = Filter & { dataMask?: DataMaskWithId };
|
||||||
|
|
||||||
export type Divider = Partial<Omit<Filter, 'id' | 'type'>> & {
|
export type Divider = Partial<Omit<Filter, 'id' | 'type'>> & {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -128,7 +128,7 @@ const FilterControls: FC<FilterControlsProps> = ({
|
||||||
const activeOverflowedFiltersInScope = useMemo(
|
const activeOverflowedFiltersInScope = useMemo(
|
||||||
() =>
|
() =>
|
||||||
overflowedFiltersInScope.filter(
|
overflowedFiltersInScope.filter(
|
||||||
filter => isNativeFilter(filter) && filter.dataMask.filterState?.value,
|
filter => isNativeFilter(filter) && filter.dataMask?.filterState?.value,
|
||||||
).length,
|
).length,
|
||||||
[overflowedFiltersInScope],
|
[overflowedFiltersInScope],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue