Rocket.Chat
Rocket.Chat copied to clipboard
fix: phone number validation using regex and conditional logic in Omni…
This pull request Fixes error of a phone number validation function for the Omni Channel Contact feature ensuring International Phone Number Standards.
- I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc
- I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat
- Lint and unit tests pass locally with my changes
Proposed changes (including videos or screenshots)
Added a new function validatePhoneFormat
for validating phone numbers in the Channel Contact feature. This function checks if the provided phone number matches a certain regex pattern and returns either true
if the phone number is valid or an error message if it's invalid.
https://github.com/RocketChat/Rocket.Chat/assets/122693801/c30ea446-0a66-46d1-a356-dcf8bf6051f5
Issue(s)
closes #31763
Steps to test or reproduce
- Enter a valid phone number in the Channel Contact feature.
- Verify that the validation passes.
- Enter an invalid phone number and verify that the validation fails with the correct error message.
Further comments
This pull request adds a necessary validation function to ensure that users enter valid phone numbers in the Channel Contact feature, improving user experience and data integrity.
⚠️ No Changeset found
Latest commit: 41718aa071fe198e3079fe7eedaf6ecaf9ffce4e
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Yes, issue is there .
Yes, issue is there .
Can you please explain in detail what is further issue?
Yes, issue is there .
Can you please explain in detail what is further issue?
No further issue I found. I found the same issue as you mentioned. Your PR is under review.
Hey @matheusbsilva137, @ggazzo, @gabriellsh! Can you look into the changes I made....