Feature: add the ability to filter members in the SOG nametrainer#1071
Feature: add the ability to filter members in the SOG nametrainer#1071
Conversation
📝 WalkthroughWalkthroughAdds a checkbox UI toggle and a tracked Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 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)
No actionable comments were generated in the recent review. 🎉 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 |
There was a problem hiding this comment.
Pull request overview
Adds a UI toggle to include/exclude former members in the SOG name trainer, so the trainer can focus on current members by default while still allowing training on old members when desired.
Changes:
- Add a “Toon oudleden” checkbox to the name trainer settings screen.
- Add controller state (
showFormerMembers) and apply membership filtering logic when loading users for the trainer.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/templates/sog/name-trainer.hbs | Adds checkbox UI to control whether former members are included. |
| app/controllers/sog/name-trainer.js | Tracks the new flag and filters memberships before building the trainer user list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #1071 +/- ##
===========================================
- Coverage 13.02% 13.01% -0.02%
===========================================
Files 450 450
Lines 3124 3127 +3
===========================================
Hits 407 407
- Misses 2717 2720 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| async getUsers() { | ||
| const group = await this.group; | ||
| if (!group) { | ||
| return []; | ||
| } | ||
| const memberships = await group.get('memberships'); | ||
| let memberships = await group.get('memberships'); | ||
|
|
||
| if (!this.showFormerMembers) { | ||
| memberships = memberships.filterBy('userIsCurrentlyMember', true); | ||
| } | ||
|
|
||
| return await Promise.all(memberships.mapBy('user')); | ||
| } |
There was a problem hiding this comment.
The new former-member filtering behavior in getUsers() isn’t covered by tests. Given there are existing unit tests for controllers/routes in this repo, please add a test that verifies getUsers() returns only current members by default and includes former members when showFormerMembers is enabled (and that the returned list contains the associated user records).
This PR introduces the ability to filter for former members when using the nametrainer.
This fixes #872
Summary by CodeRabbit