WAIT: Show combined primary + additional sectors on the recipients header#1837
Open
maebeale wants to merge 1 commit into
Open
WAIT: Show combined primary + additional sectors on the recipients header#1837maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
The recipients "Serves" strip read only the additional-sector answer (and a single normalized "sector" key), so a registrant's primary sector and the rest of their additional sectors weren't shown together. EventDashboard now exposes #header_sectors_for, which combines the single-select primary and multi-select additional sector answers for the event — uniqued, primary first — read from the form answers themselves (independent of the registration-derived is_primary profile tags, which legacy data marks all-primary), falling back to profile tags when no sector answers are on file. The header renders them as chips with the primary starred, then the additional sectors alphabetically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 22, 2026
| # named no sectors on a form. | ||
| def header_sectors_for(person) | ||
| ids = header_sector_ids_by_applicant[person.id] | ||
| return profile_sector_pairs(person) unless ids && (ids[:primary].any? || ids[:additional].any?) |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Form answers are the authority here, not the profile is_primary tags — legacy/prod registrations were tagged all-primary by the old assign_tags, so reading tags would star every sector. Profile tags are only the fallback when the registrant named no sectors on a form.
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.
🤖 PR, suggested 👤 review level: 📖 Read — light-logic: a new dashboard read method + a view swap; no writes, no migration
Why
The recipients "Serves" strip read only the additional-sector answer (under a single normalized
sectorkey), so a registrant's primary sector and their additional sectors weren't shown together.What
EventDashboard#header_sectors_for(person)— combines the single-select primary and multi-select additional sector answers for the event, uniqued, primary first. Read straight from the form answers (so it's independent of the registration-derivedis_primaryprofile tags, which legacy data marks all-primary), falling back to the person's profile sector tags when no sector answers are on file.HEADER_SECTOR_KEY/header_answer_key;HEADER_ANSWER_IDENTIFIERSis now age-group-only.Verification
event_dashboard_spec(new#header_sectors_forcases incl. legacy identifiers + profile fallback) andevents_specgreen; rubocop clean.★Disability Services, Fundraising/Donor Engagement— primary starred, additional following, uniqued.