-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Filter fails to show compound filters with no default value #5657
Conversation
@@ -246,7 +246,9 @@ const useListParams = ({ | |||
...displayedFilterValues, | |||
[filterName]: true, | |||
}; | |||
const filter = set(filterValues, filterName, defaultValue); | |||
const filter = defaultValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was with compound filters (e.f. 'comment.title') with no default value. set returned {comment: {}}
, which is wrong in that case.
describe('showFilter', () => { | ||
it('should initialize displayed filters', () => { | ||
const TestedComponent = () => { | ||
const [_, { showFilter }] = useListParams({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the _
, just leave the slot it empty
const [_, { showFilter }] = useListParams({ | |
const [, { showFilter }] = useListParams({ |
|
||
it('should initialize displayed filters on compound filters', () => { | ||
const TestedComponent = () => { | ||
const [_, { showFilter }] = useListParams({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
const [_, { showFilter }] = useListParams({ | |
const [, { showFilter }] = useListParams({ |
|
||
it('should initialize filters on compound filters', () => { | ||
const TestedComponent = () => { | ||
const [_, { showFilter }] = useListParams({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
const [_, { showFilter }] = useListParams({ | |
const [, { showFilter }] = useListParams({ |
Closes #5653