Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

fix: phone number validation using regex and conditional logic in Omni…

Open manascb1344 opened this issue 1 year ago • 1 comments

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

  1. Enter a valid phone number in the Channel Contact feature.
  2. Verify that the validation passes.
  3. 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.

manascb1344 avatar Feb 15 '24 12:02 manascb1344

⚠️ 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

changeset-bot[bot] avatar Feb 15 '24 12:02 changeset-bot[bot]

Yes, issue is there .

Himanshu-kiran avatar Feb 19 '24 08:02 Himanshu-kiran

Yes, issue is there .

Can you please explain in detail what is further issue?

manascb1344 avatar Feb 19 '24 10:02 manascb1344

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.

Himanshu-kiran avatar Feb 19 '24 15:02 Himanshu-kiran

Hey @matheusbsilva137, @ggazzo, @gabriellsh! Can you look into the changes I made....

manascb1344 avatar Mar 05 '24 04:03 manascb1344