Vitor-Avila commented on code in PR #33834:
URL: https://github.com/apache/superset/pull/33834#discussion_r2157723477
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx:
##########
@@ -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)));
- }
Review Comment:
I believe the idea here was to actually have `let dispatchAllowed = true;`,
then set it to `false` if any filter is required, and finally
`dispatch(clearDataMask(id))` for all filters -- this would automatically
trigger the clear all to charts (without the need to click on the **Apply**
button).
I talked with @yousoph about this and it might be a confusing experience, as
no other filter interaction is "automatic" -- every filter change requires
applying them, so I just removed this logic.
If we feel like that's the flow we want to support, we can just re-add this
syntax and set `dispatchAllowed` to initially `true`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]