You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by va...@apache.org on 2025/06/19 20:44:17 UTC

(superset) branch fix/clear-all-filters created (now 27e270c5ee)

This is an automated email from the ASF dual-hosted git repository.

vavila pushed a change to branch fix/clear-all-filters
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 27e270c5ee fix(native filters): Make the Apply button available after click on Clear All

This branch includes the following new commits:

     new 27e270c5ee fix(native filters): Make the Apply button available after click on Clear All

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: fix(native filters): Make the Apply button available after click on Clear All

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vavila pushed a commit to branch fix/clear-all-filters
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 27e270c5ee90f2a3e21c6e60144fd9f0ae7e4679
Author: Vitor Avila <vi...@preset.io>
AuthorDate: Thu Jun 19 17:43:59 2025 -0300

    fix(native filters): Make the Apply button available after click on Clear All
---
 .../src/dashboard/components/nativeFilters/FilterBar/index.tsx | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
index 4083755b8d..e0156f4b2d 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
@@ -40,7 +40,7 @@ import {
   styled,
 } from '@superset-ui/core';
 import { useHistory } from 'react-router-dom';
-import { updateDataMask, clearDataMask } from 'src/dataMask/actions';
+import { updateDataMask } from 'src/dataMask/actions';
 import { useImmer } from 'use-immer';
 import { isEmpty, isEqual, debounce } from 'lodash';
 import { getInitialDataMask } from 'src/dataMask/reducer';
@@ -257,24 +257,18 @@ const FilterBar: FC<FiltersBarProps> = ({
 
   const handleClearAll = useCallback(() => {
     const clearDataMaskIds: string[] = [];
-    let dispatchAllowed = false;
     filtersInScope.filter(isNativeFilter).forEach(filter => {
       const { id } = filter;
       if (dataMaskSelected[id]) {
-        if (filter.controlValues?.enableEmptyFilter) {
-          dispatchAllowed = false;
-        }
         clearDataMaskIds.push(id);
         setDataMaskSelected(draft => {
           if (draft[id].filterState?.value !== undefined) {
             draft[id].filterState!.value = undefined;
           }
+          draft[id].extraFormData = {};
         });
       }
     });
-    if (dispatchAllowed) {
-      clearDataMaskIds.forEach(id => dispatch(clearDataMask(id)));
-    }
   }, [dataMaskSelected, dispatch, filtersInScope, setDataMaskSelected]);
 
   useFilterUpdates(dataMaskSelected, setDataMaskSelected);