Added location filter for members#25607
Conversation
- Introduced LOCATION_FILTER to the filter.js component for enhanced member filtering options. - Updated index.js to export LOCATION_FILTER, ensuring it is available for use in the application.
WalkthroughAdds location-based member filtering by introducing a new Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Replaced CONTAINS_RELATION_OPTIONS with CONTAINS_ONLY_RELATION_OPTIONS in the location filter component for improved filtering capabilities. - Added new relation options in a separate file to enhance clarity and maintainability. - Updated index.js to export the new relation options.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9fd396d. Configure here.
| {label: 'does not contain', name: 'does-not-contain'}, | ||
| {label: 'starts with', name: 'starts-with'}, | ||
| {label: 'ends with', name: 'ends-with'} | ||
| ]; |
There was a problem hiding this comment.
Near-duplicate relation options file instead of reusing existing
Low Severity
CONTAINS_ONLY_RELATION_OPTIONS is a near-duplicate of the existing CONTAINS_RELATION_OPTIONS, differing only in the absence of the is option. The PR description explicitly lists "is" (exact match) as a supported operator, and the analogous NAME_FILTER and EMAIL_FILTER (also valueType: 'string') both use CONTAINS_RELATION_OPTIONS. The LOCATION_FILTER could simply reuse CONTAINS_RELATION_OPTIONS instead of introducing a new nearly-identical constant and file.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9fd396d. Configure here.





fixes #25557
What does this PR do?
Adds the ability to filter members by location (geolocation) in the Ghost Admin dashboard.
Why is this needed?
Users with large member bases need to filter members by geographic location to:
How does it work?
The implementation adds a new "Location" filter option in the Basic filters group. Since
geolocationis stored as a JSON string containing location data from GeoJS (country, city, region, etc.), the filter uses text-based operators:This allows administrators to filter members using queries like
geolocation:~'United States'to find all members from a specific country.Changes
ghost/admin/app/components/members/filters/location.jsghost/admin/app/components/members/filters/index.jsLOCATION_FILTERto the Basic filters group inghost/admin/app/components/members/filter.jsTesting
Note
Low Risk
Low risk UI/filter definition change; it only adds a new filter option and relation options without altering core data flows or security-sensitive logic.
Overview
Adds a new Members “Location” filter (backed by
geolocation) to the Basic filter group in Admin.Introduces
LOCATION_FILTERand a newCONTAINS_ONLY_RELATION_OPTIONSset (contains / does-not-contain / starts-with / ends-with), and exports both via the existing filters and relation-options indexes.Reviewed by Cursor Bugbot for commit 9fd396d. Bugbot is set up for automated code reviews on this repo. Configure here.