mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04: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:
parent
e5187a479a
commit
fe5381dcb8
@ -92,7 +92,11 @@ const Header: FC<HeaderProps> = ({
|
|||||||
const handleClearAll = () => {
|
const handleClearAll = () => {
|
||||||
filterValues.forEach(filter => {
|
filterValues.forEach(filter => {
|
||||||
setDataMaskSelected(draft => {
|
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 { areObjectsEqual } from '../reduxUtils';
|
||||||
import { Filters } from '../dashboard/reducers/types';
|
import { Filters } from '../dashboard/reducers/types';
|
||||||
|
|
||||||
export function getInitialDataMask(id?: string): DataMask;
|
export function getInitialDataMask(id?: string, moreProps?: DataMask): DataMask;
|
||||||
export function getInitialDataMask(id: string): DataMaskWithId {
|
export function getInitialDataMask(
|
||||||
|
id: string,
|
||||||
|
moreProps: DataMask = {},
|
||||||
|
): DataMaskWithId {
|
||||||
let otherProps = {};
|
let otherProps = {};
|
||||||
if (id) {
|
if (id) {
|
||||||
otherProps = {
|
otherProps = {
|
||||||
@ -52,6 +55,7 @@ export function getInitialDataMask(id: string): DataMaskWithId {
|
|||||||
value: undefined,
|
value: undefined,
|
||||||
},
|
},
|
||||||
ownState: {},
|
ownState: {},
|
||||||
|
...moreProps,
|
||||||
} as DataMaskWithId;
|
} as DataMaskWithId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user