Age ranges: single primary like sectors + visibility toggle#1747
Draft
maebeale wants to merge 1 commit into
Draft
Age ranges: single primary like sectors + visibility toggle#1747maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
4a6dcb3 to
e32d01a
Compare
Collaborator
Author
|
🤖 From Claude: Rebased onto latest main (33 commits). Conflicts resolved: Heads-up on the backfill migration ( |
e32d01a to
f9f2d56
Compare
f9f2d56 to
6ff3233
Compare
Builds on #1717's primary/additional age groups, reshaping them to match sectors exactly and adding a per-profile visibility toggle. - Registration: "Primary age range" is now a single-select dropdown (one primary) and "Additional ages served" stays multi-select; a data migration converts existing forms' field type + labels. - Enforce a single primary: AgeGroupTaggable's tag_age_groups and apply_primary_age_groups! keep exactly one primary (a new primary demotes the old), backed by an at-most-one-primary validation. A migration normalizes any existing data that marked several primaries down to one. - Edit forms keep one "Primary" toggle checked at a time via a new single-select-checkbox Stimulus controller. - profile_show_age_ranges toggle (people + orgs) gates the "Age ranges served" section, mirroring profile_show_sectors. - Event dashboard age breakdown now reads both the primary and additional age-range answers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6ff3233 to
0e4f260
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?
How did you approach the change?
Registration form
primary_age_groupfield to a dropdown and renames both questions.Single primary (sector parity)
AgeGroupTaggable#tag_age_groupsand#apply_primary_age_groups!keep exactly one primary — choosing a new primary demotes the previous one — backed by anat_most_one_primary_age_groupvalidation.single-select-checkboxStimulus controller (allows zero or one, like the star toggle on sectors).Visibility toggle
profile_show_age_rangeson people + organizations gates the "Age ranges served" section, mirroringprofile_show_sectors. Added a "Show age ranges" checkbox to both edit forms.Reporting
Anything else to add?
AgeGroupTaggablespec (single-primary, demote, validation), added a builder spec for the new age field types. Full affected suite green; rubocop clean; dev seed + Vite dev build run.🤖 Generated with Claude Code