You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/30 01:31:18 UTC

[GitHub] [superset] zhaoyongjie commented on a diff in pull request #22260: fix(dashboard): Fix FilterWithDataMask typing and add null check

zhaoyongjie commented on code in PR #22260:
URL: https://github.com/apache/superset/pull/22260#discussion_r1035442923


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx:
##########
@@ -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,

Review Comment:
   Currently, there are `isNativeFilter` and `isFilterDivider` as the type guard, so I think we should introduce a new type guard for this use case, for example, `isFilterWithDataMask`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org