Show primary/additional age groups as chips on recipients page#1749
Merged
Conversation
9d15ef7 to
8e1f2da
Compare
The scholarship recipients page still rendered age ranges as a flat comma-separated string while sectors already showed the primary/additional chip treatment. Now that people carry a primary age-group distinction (categorizable_items.is_primary), render the same starred-chip format so the "Ages" strip reads in parallel with "Serves", falling back to the form answer / profile text only when no age groups are tagged. Eager-load categorizable_items on scholarship_applicants so the chips avoid an N+1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new recipients chips read a person's profile age groups first, but the three demo accounts (Umberto, Amy, Aisha) carried no age-range taggings, so the display fell back to plain text for them. Tag each with one primary age group (plus a few additional) so the starred-chip rendering has real data to show, modeling the intended shape: one primary, optionally some additional. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8e1f2da to
8faada9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
The scholarship recipients page rendered age ranges as a flat comma-separated string while sectors already showed the primary/additional chip treatment. Now that people carry a primary age-group distinction (
categorizable_items.is_primary), the "Ages" strip renders the same starred-chip format so it reads in parallel with "Serves".How did you approach the change?
recipients.html.erbnow renders the sharedage_group_tagspartial from the person'sprimary_age_groups/additional_age_groups, falling back to the existing form-answer/profile text only when no age groups are tagged.EventDashboard#scholarship_applicantseager-loadscategorizable_itemsso the chips avoid an N+1. The dev seed (people_profiles.rb) now tags the three demo accounts (Umberto, Amy, Aisha) with one primary age group plus a few additional, so the chips have real data to show — modeling the intended shape of one primary, optionally some additional.UI Testing Checklist
Anything else to add?
Editing connected age categories (including the primary toggle) already exists on the person edit form via
shared/_category_checkbox; no change was needed there. Added a request spec asserting the chips render with the primary one starred. Note: the model and edit form currently allow more than one primary age group to be flagged — this PR seeds a single primary but does not enforce a one-primary constraint; happy to add that separately if desired.