Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export enum AppSection {
export type FilterState = { value?: any; [key: string]: any };

export type DataMask = {
__cache?: FilterState;
extraFormData?: ExtraFormData;
filterState?: FilterState;
ownState?: JsonObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ const VerticalFilterBar: React.FC<VerticalBarProps> = ({
/>
</FilterControlsWrapper>
),
[canEdit, dataMaskSelected, filterValues.length, onSelectionChange],
[
canEdit,
JSON.stringify(dataMaskSelected),
filterValues.length,
onSelectionChange,
],
);

const filterSetsTabs = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const FilterBar: React.FC<FiltersBarProps> = ({
verticalConfig,
hidden = false,
}) => {
console.log('rerender');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Suggested change
console.log('rerender');
console.log('rerender');

const history = useHistory();
const dataMaskApplied: DataMaskStateWithId = useNativeFiltersDataMask();
const [dataMaskSelected, setDataMaskSelected] =
Expand Down Expand Up @@ -166,7 +167,7 @@ const FilterBar: React.FC<FiltersBarProps> = ({
};
});
},
[dataMaskSelected, dispatch, setDataMaskSelected],
[JSON.stringify(dataMaskSelected), dispatch, setDataMaskSelected],
);

useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/dataMask/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function getInitialDataMask(
}
return {
...otherProps,
__cache: {},
extraFormData: {},
filterState: {},
ownState: {},
Expand Down