Skip to content

removing special character in Iraq phone rule #48

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

camilavcoutinho
Copy link
Contributor

Removing + special character in Iraq phone rule, requested by Amal.

@camilavcoutinho camilavcoutinho requested a review from a team as a code owner March 3, 2022 19:53
Copy link
Contributor

@lucasecdb lucasecdb left a comment

Choose a reason for hiding this comment

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

isn't this the international phone number pattern? why are we removing it?

@camilavcoutinho
Copy link
Contributor Author

isn't this the international phone number pattern? why are we removing it?

It was requested by Amal (Tier 1 client).

@lucasecdb
Copy link
Contributor

lucasecdb commented Mar 3, 2022

but by removing this character we won't be able to recognize a number such as +9641234567890 as a number from Iraq, which deviates from the pattern of the entire library. What is the underlying issue here that we are trying to solve?

@camilavcoutinho
Copy link
Contributor Author

but by removing this character we won't be able to recognize a number such as +9641234567890 as a number from Iraq, which deviates from the pattern of the entire library. What is the underlying issue here that we are trying to solve?

They don't want any special characters. Only numbers should be entered. If alphabets or any special characters or spaces are entered user should see a message saying 'Enter valid phone number'.

@lucasecdb
Copy link
Contributor

They don't want any special characters. Only numbers should be entered

this isn't a problem in this library. I've investigated a bit with @sheilagomes last week, and we found out that vcs.checkout-ui is the one responsible for removing the special characters before passing the string to be validated here. It is a problem that should be fixed in checkout-ui's code.

I don't like the idea of deviating from the standard used in the rest of this library just because one client asked for it. And it won't solve the problem either. They should open a ticket to checkout so we can fix the root cause, instead of treating the symptoms

@camilavcoutinho
Copy link
Contributor Author

They don't want any special characters. Only numbers should be entered

this isn't a problem in this library. I've investigated a bit with @sheilagomes last week, and we found out that vcs.checkout-ui is the one responsible for removing the special characters before passing the string to be validated here. It is a problem that should be fixed in checkout-ui's code.

I don't like the idea of deviating from the standard used in the rest of this library just because one client asked for it. And it won't solve the problem either. They should open a ticket to checkout so we can fix the root cause, instead of treating the symptoms

I see! @lrodriguess, could you talk to them and explain the issue, please?

@lrodriguess
Copy link

Hey @lucasecdb and @camilavcoutinho
I didn't get what you are saying about the vs.checkout-ui being the one responsible to sanitize this before the value gets to the library. You mean to locally do the changes requested by the customer and leave the library according to the standard, is that it?

When Camila says that the customer requested, it means they are the Iraqi experts and request it as this being a standard in Iraq, that no one enters their phone number with + sign in the beginning. They have hired an e-commerce focused translator and she is together with our translator, helping us on a lot of fronts in the project to get VTEX ready for the middle east market.

@lucasecdb
Copy link
Contributor

You mean to locally do the changes requested by the customer and leave the library according to the standard, is that it?

what do you mean with "locally do the changes"? I don't understand

Iraqi experts requested it as this being a standard in Iraq, that no one enters their phone number with + sign in the beginning

I understand, but what I want to say is that this library is focused on maintaining a compliance with the E.123 international phone number format, and that I don't think we should deviate from the standard used in all of the other country rules just because a customer asked for it. It is a standard for a reason.

Also, these changes won't fix anything because checkout-ui is the one removing these special characters before passing the number to be validated by the regex in this library. They should open a ticket to the product team and have it prioritized in the bi-weekly meeting for us to investigate

@lrodriguess
Copy link

I disagree with this on one point.
This IRQ-spec.coffee is supposed to be about the Iraqui standards, not international standards.
If this was international then 1 single configuration should be in place for all countries and not so many specific ones.

I understand this is a rule to follow in order to build country-specific constraints but in Iraq, no one understands the + sign, basically because they are not used to the Cyrillic alphabet.
This will happen again in japan, china, thayland and most Asian countries.

@dvm1984
Copy link

dvm1984 commented Mar 8, 2022

It makes sense for us to take a regional approach to this @lucasecdb - meaning that for this particular country the predominant rule that must apply is phone number without the "+" sign. While it may difficult for us to understand how an international phone number can begin without a "+" sign, it's just as difficult for that region to understand why it does. Regionalization means offering a native user experience globally, it does not mean we force our view as the correct one. In this case, I agree the user's feedback and set the phone number format for Iraq as numbers only without special characters.

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.

5 participants