Repository navigation
Add optional phone number to users - #5726
costajohnt wants to merge 3 commits into
Conversation
Banks sometimes need to call an individual partner user, not only the partner's formal contacts. Add a nullable phone_number to users and expose it wherever a user is invited or edited: the bank's partner-user page, the partner's own user management, the admin user and organization forms, and account settings. Resolves rubyforgood#5687
dorner
left a comment
There was a problem hiding this comment.
One comment, otherwise looks good. Needs manual testing / approval.
| <thead> | ||
| <tr> | ||
| <th>Name & Email</th> | ||
| <th>Name, Email & Phone</th> |
There was a problem hiding this comment.
Probably should read something like "Contact Information"? @ruestitch @janeewheatley
There was a problem hiding this comment.
Renamed the header to "Contact Information" in 64510ce.
|
Tested the phone forms locally with synthetic accounts. New invitations and admin-created users saved the number; blanks were optional, editing/clearing worked, and existing users kept their original contact details. The 90 focused tests and eight supplemental checks passed, and I verified nine Chromium form flows. CSS/fonts were blocked, so I haven't checked the visual layout or run the full suite. I also have a finding I'd like to share privately before this is merged. What's the best maintainer contact? |
|
There are conflicts now. Still waiting to hear from @janeewheatley or @ruestitch for any feedback. If you mean a security concern, you can DM me on the Human Resources Slack (instructions in the contribution guidelines). |
# Conflicts: # db/schema.rb
|
Merged main in and resolved the conflict (just the schema.rb version line). Nothing else changed, so I'll leave it for @janeewheatley / @ruestitch to weigh in. |
Resolves #5687
Description
Banks sometimes need to call an individual partner user, not only the partner's formal contacts. This adds a nullable
phone_numberstring tousers(same shape as thephone_numberadded to partners in 8317eae, no validation, same as vendors and donation sites) and exposes it wherever a user is invited or edited:/partners/:id/users): a Phone Number field on the invite form, saved throughUserInviteService, shown under the email in the users table.Partners::UsersController): invite form, the user's edit form, and a Phone column on the list._user_form_fields), including both create paths./users/edit), through the Deviseaccount_updatesanitizer.UserInviteServiceonly sets the phone on newly invited users. When an existing user is re-invited to another resource their record is not touched, which is what already happens withname.One thing I left alone: blank values from the edit forms are stored as
""while the invite path storesnil(.presence). Neither is rendered differently and it matches howPartner#phone_numberbehaves; happy to add anormalizesif you'd rather havenileverywhere.Type of change
How Has This Been Tested?
spec/requests/partner_users_requests_spec.rb: invite persists the phone; the users page renders it.spec/requests/partners/user_requests_spec.rb: partner-side invite and self-edit persist it.spec/requests/admin/users_requests_spec.rbandspec/requests/admin/organizations_requests_spec.rb: admin create and update persist it.spec/requests/users/registrations_requests_spec.rb(new): account settings update persists it.bundle exec rubocopandbundle exec erb_lintare clean on the changed files.