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/23 19:19:05 UTC
(superset) branch master updated: fix(native filters): Make the Apply button available after click on Clear All (#33834)
This is an automated email from the ASF dual-hosted git repository.
vavila pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 784f86c8eb fix(native filters): Make the Apply button available after click on Clear All (#33834)
784f86c8eb is described below
commit 784f86c8eb0092612bcdeeb7fc26474f463224d8
Author: Vitor Avila <96...@users.noreply.github.com>
AuthorDate: Mon Jun 23 16:18:59 2025 -0300
fix(native filters): Make the Apply button available after click on Clear All (#33834)
---
.../dashboard/components/nativeFilters/FilterBar/index.tsx | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
index 909e251c7f..3c8e2a4db9 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 {
} from '@superset-ui/core';
import { Constants } from '@superset-ui/core/components';
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';
@@ -256,25 +256,17 @@ const FilterBar: FC<FiltersBarProps> = ({
}, [dataMaskSelected, dispatch]);
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);