HOLD: Add communications/notifications section to person edit#1864
Draft
maebeale wants to merge 1 commit into
Draft
HOLD: Add communications/notifications section to person edit#1864maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
Admins managing event registrations already had a communications log on the registration edit page; the same context is useful when working a person record directly, so mirror that section on person edit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 22, 2026
| <% sender_options = sender_users.sort_by { |u| u.full_name.to_s.downcase }.map { |u| [ u.full_name, u.id ] } %> | ||
| <% channel_default = Notification::MANUAL_CHANNELS.include?(f.object.channel) ? f.object.channel : "email" %> | ||
| <% record = local_assigns[:event_registration] %> | ||
| <% record = local_assigns[:record] %> |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Renamed the event_registration: local to a neutral record: so this partial can be shared by both the registration and person notification sections. Both callers updated.
maebeale
commented
Jun 22, 2026
| @person.comments.select { |c| c.persisted? && c.body_changed? }.each { |c| c.updated_by = current_user } | ||
|
|
||
| # Inline-logged notifications are addressed to the person. | ||
| recipient_email = @person.preferred_email.presence || "n/a" |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Falls back to "n/a" when the person has no email, mirroring the registration controller — recipient_email is presence-validated on Notification, so a manual log against an email-less person still saves.
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?
notificationspolymorphic association (as: :noticeable) and nested attributes toPerson, matchingEventRegistration.PersontoNotification::NOTICEABLE_TYPESso person-logged communications appear in the notifications index "Record" filter and links resolve.notifications_attributesinPeopleController#person_paramsand setrecipient_emailon new manual logs in#update(mirrors the registration controller).app/views/people/_notifications.html.erbpartial mirroringevent_registrations/_notifications— read-only paginated history (matched bypreferred_email, newest first) plus inline "Add notification" logging.NotificationPolicy#index?(admin-only — owners editing their own profile don't see it).notifications/_notification_fieldspartial'sevent_registration:local to a neutralrecord:local; updated both the registration and person callers.Anything else to add?
main(resolved conflicts inNotification::NOTICEABLE_TYPESandcomments_attributes).spec/requests/people_notifications_spec.rb(creates a manual log from nested attributes, ignores blank entries, lists past communications on the edit page). Verified no regressions acrosspeople_notifications,event_registrations, and theevent_registration_editsystem spec (98 examples, 0 failures). Lint clean.🤖 Generated with Claude Code