Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add phone number to donor profile #7331

Merged
merged 25 commits into from
Mar 29, 2024

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Mar 26, 2024

Resolves GIVE-531

Description

This PR adds a phone input to the donor profile page. The International Telephone Input JS library (sponsored by Twilio) was used to make sure that the numbers were stored in the proper format regardless of the donor country.

The big advantage of using this JS library is that we can validate the numbers for all countries before submitting the form and store the donor phone number using the international format - which can be useful in the future if we decide to implement some kind of integration with 3rd party software to send SMS to donors because services like that (For example Twilio) require numbers in the international format.

The whole functionality was encapsulated in the give_get_intl_tel_input() function, this way we can reuse it in other places that require a phone input using only vanilla JS.

In a subsequent PR, we also can create a version of this phone input in our form builder library to allow the use as a React Component. Edit: The library already provides a React Component that we can use when working in the Visual Form Builder or any other UI that uses React.

Affects

The donor profile page.

Visuals

image

image

Testing Instructions

  1. Go to the donor profile page;
  2. Edit the donor details;
  3. Try to save an empty phone number, it should work;
  4. Try to save a valid phone number, it should work;
  5. Try to save an invalid phone number, it should NOT work.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva self-assigned this Mar 26, 2024
@glaubersilva glaubersilva changed the title Feature: add phone column to donors' table Feature: add phone number to donor profile Mar 26, 2024
@glaubersilva glaubersilva marked this pull request as ready for review March 27, 2024 20:34
src/Donors/Migrations/addPhoneColumn.php Outdated Show resolved Hide resolved
src/Donors/ServiceProvider.php Outdated Show resolved Hide resolved
src/Donors/ServiceProvider.php Outdated Show resolved Hide resolved
src/Donors/Migrations/addPhoneColumn.php Outdated Show resolved Hide resolved
src/Donors/Migrations/addPhoneColumn.php Outdated Show resolved Hide resolved
src/Donors/Repositories/DonorRepository.php Outdated Show resolved Hide resolved
src/Donors/Models/Donor.php Show resolved Hide resolved
@glaubersilva
Copy link
Contributor Author

@jonwaldstein This is ready for re-review.

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glaubersilva great job man ☎️ ! ready for QA 🌈

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed manual QA tests.

@glaubersilva glaubersilva merged commit 4174ebf into develop Mar 29, 2024
20 checks passed
@glaubersilva glaubersilva deleted the feature/donor-phone-number-GIVE-531 branch March 29, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants