Add optional phone number to users - #5726
Open
costajohnt wants to merge 1 commit into
Open
costajohnt wants to merge 1 commit into
costajohnt wants to merge 1 commit 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
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.
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.