feat(grants): add filters to shortlist page (needs_funds_for_travel, need_visa, need_accommodation, country_type)#4651
Conversation
…ortlist Add four new client-side filters to the grants review shortlist page: needs_funds_for_travel, need_visa, need_accommodation, and country_type. Refactors the existing status-only filter JS into a unified applyFilters() function that ANDs all active filter groups together.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Adds client-side filters (needs_funds_for_travel, need_visa, need_accommodation, country_type) to the grants shortlist page, refactoring per-field status filter JS into a unified i18n inconsistency
Behavior change in status filter not documented
Incomplete test coverage
Cryptic test failure on missing grant
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4651 +/- ##
=======================================
Coverage 92.52% 92.52%
=======================================
Files 359 359
Lines 10791 10791
Branches 821 821
=======================================
Hits 9984 9984
Misses 696 696
Partials 111 111 🚀 New features to boost your workflow:
|
- Remove dead fields from grantsById JS object; filters read from data-*
attributes only, so the object fields were a false source-of-truth
- Move the null country_type sentinel ("", "Unknown") into the adapter
context so the template loop handles all options uniformly
- Call applyFilters() on page load to sync rows with bfcache-restored state
- Treat all-unchecked filter group as "show all" via matchesFilter helper,
preventing silent blank tables when every option in a group is unchecked
- Add three pytest tests: country_type_choices present in context, grant
with no departure_country maps to the empty-string sentinel, and
needs_funds_for_travel boolean is correctly exposed on queryset items
|
@claude do the code review again. |
|
Claude finished @estyxx's task in 1m 49s —— View job Code Review - Re-review
Summary: The feedback from my previous review has been addressed well. The code is now in good shape for merging. Issues Fixed ✅All five issues from my previous review have been addressed:
Minor Observations (Non-blocking)
VerdictLGTM 👍 — The PR addresses the review feedback thoroughly and the implementation is solid. Ready to merge. | |
Summary
/admin/reviews/reviewsession/<id>/review/shortlist/Grant.CountryTypevia the context)country_type_choicesinGrantsReviewAdapter.get_shortlist_contextso the template can render the country-type options dynamicallydata-needs-funds-for-travel,data-need-visa,data-need-accommodation,data-country-typeHTMLdata-*attributes on each<tr class="grant-item">rowapplyFilters()function that ANDs all five filter groups together; all checkboxes start checked (show all), unchecking hides matching rowsTest plan
needs_funds_for_travel=Truehide; re-check → they reappear