-
Notifications
You must be signed in to change notification settings - Fork 14
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
[CIVIC-1449] Fixed Automated list filters not being hidden. #1157
Conversation
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.
@mudrasamey
Please see inline comments and update accordingly.
Also, please add Behat tests that demonstrate the case when:
- All filters selected
- Some filters selected
- None filters selected.
thank you
$show_filters = !empty(array_filter(explode(', ', $settings['filters_exp']))); | ||
if (!$show_filters) { | ||
// Exposed filters. | ||
$exposed_filter = explode(', ', $settings['filters_exp']); |
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.
$exposed_filters
if (!$show_filters) { | ||
// Exposed filters. | ||
$exposed_filter = explode(', ', $settings['filters_exp']); | ||
$show_filters = !empty(array_filter($exposed_filter)); |
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.
please remove this and just use the count($exposed_filters)>0
// Disable filters based on the component settings. | ||
$view_filters = $view->display_handler->getOption('filters'); | ||
foreach ($view_filters as $key => $filter) { | ||
if (isset($filter['exposed']) && |
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.
replace
isset($filter['exposed']) &&
$filter['exposed'] &&
with
!empty($filter['exposed'])
if ($show_filters) { | ||
// Disable filters based on the component settings. | ||
$view_filters = $view->display_handler->getOption('filters'); | ||
foreach ($view_filters as $key => $filter) { |
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.
replace $key
with $filter_identifier
583449a
to
407cafc
Compare
@AlexSkrypnyk i have made the changes as per your suggestion. I have also added supporting behat test |
@mudrasamey Could you please fix the code to make the CI pass. Thank you |
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.
@mudrasamey
Thank you for your contribution!
https://salsadigital.atlassian.net/browse/CIVIC-1449
Checklist before requesting a review
[CS-123] Verb in past tense with dot at the end.
Changed
section about WHY something was done if this was not a normal implementationchanges, and they passed
Changed
Screenshots