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