mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(native-filters): Fix Select Default First Value by clicked Clear All (#15219)
* fix:fix get permission function * fix: fix select first value by clear all * lint: fix lint
This commit is contained in:
@@ -92,7 +92,11 @@ const Header: FC<HeaderProps> = ({
|
||||
const handleClearAll = () => {
|
||||
filterValues.forEach(filter => {
|
||||
setDataMaskSelected(draft => {
|
||||
draft[filter.id] = getInitialDataMask(filter.id);
|
||||
draft[filter.id] = getInitialDataMask(filter.id, {
|
||||
filterState: {
|
||||
value: null,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -37,8 +37,11 @@ import {
|
||||
import { areObjectsEqual } from '../reduxUtils';
|
||||
import { Filters } from '../dashboard/reducers/types';
|
||||
|
||||
export function getInitialDataMask(id?: string): DataMask;
|
||||
export function getInitialDataMask(id: string): DataMaskWithId {
|
||||
export function getInitialDataMask(id?: string, moreProps?: DataMask): DataMask;
|
||||
export function getInitialDataMask(
|
||||
id: string,
|
||||
moreProps: DataMask = {},
|
||||
): DataMaskWithId {
|
||||
let otherProps = {};
|
||||
if (id) {
|
||||
otherProps = {
|
||||
@@ -52,6 +55,7 @@ export function getInitialDataMask(id: string): DataMaskWithId {
|
||||
value: undefined,
|
||||
},
|
||||
ownState: {},
|
||||
...moreProps,
|
||||
} as DataMaskWithId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user