-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[PAID] [$1000] Leading whitespaces aren’t truncated while saving email/phone number in new contact method page #17770
Comments
Triggered auto assignment to @strepanier03 ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
Changes onLoginChange(login) {
+ const validate = login.trim();
this.setState({login:validate});
}
/**
* Determine whether the form is valid
*
* @returns {Boolean}
*/
validateForm() {
- const login = this.state.login.trim();
+ const login = this.state.login
const phoneLogin = LoginUtils.getPhoneNumberWithoutSpecialChars(login);
return (Permissions.canUsePasswordlessLogins(this.props.betas) || this.state.password)
&& (Str.isValidEmail(login) || Str.isValidPhone(phoneLogin));
}
What alternative solutions did you explore? (Optional)
|
ProposalPosting proposal early as per new guidelines Please re-state the problem that we are trying to solve in this issue.Leading whitespaces aren not truncated while saving email/phone number in new contact method page. What is the root cause of that problem?We can see within App/src/pages/settings/Profile/Contacts/NewContactMethodPage.js Lines 68 to 70 in 4f7cfdb
Also during App/src/pages/settings/Profile/Contacts/NewContactMethodPage.js Lines 85 to 92 in 4f7cfdb
So What changes do you think we should make in order to solve the problem?To solve this we can think to trim login while save to state at line 69 within But it is not advisable because user may enter Email Or Phone number within login field. So if user typing email then trim() during save to state will be ok, because generally blank space not comes within email so user will not try to enter blank space within email. But if user enter Phone number then user have habit to enter phone number like "123 4567 8901" i.e. with space. So if we trim value during onChange, then as soon as user type space within phone number onLoginChange() will trim space during save to state. So it will make bad user experience and user will not able to enter space within phone number. So better approach is to trim login within submitForm() {
// Trim leading and trailing space from login
const login = this.state.login.trim();
// If this login already exists, just go back.
if (lodashGet(this.props.loginList, login)) {
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS);
return;
}
User.addNewContactMethodAndNavigate(login, this.state.password);
} So this will solve the issue i.e. truncate leading/trailing white space from email or phone number, and allows to enter space within phone number. Result video attached below. What alternative solutions did you explore? (Optional)None. ResultsTruncate leading/trailing space from email.Email.movTruncate leading/trailing space from Phone and allow space in between phone number.Phone.movPhone2.mov |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Job added to Upwork: https://www.upwork.com/jobs/~01b41c774d839dccd0 |
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Triggered auto assignment to @luacmartins ( |
@PrashantMangukiya's Proposal LGTM, straight forward change! C+ Reviewed |
📣 @PrashantMangukiya You have been assigned to this job by @luacmartins! |
It won't create the current issue, we are just trying to trim out leading and trailing space. So we are good here. If you are talking about space between the phone numbers, that's an invalid phone number case we got already covered with showing an error. So we are good to go here too. But restricting user input is bad UX. |
@Santhosh-Sellavel @luacmartins Thank you. Applied to job on Upwork. I will prepare and submit PR within 3 hours asap. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.5-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-05-03. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
Speed bonus analysis: PR submitted on April 21 / PR merged on April 25 = Eligible As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Just getting back from out of office and working to catch up on this now. I'll have an update shortly. |
@ashimsharma10 - I have hired you to a bug report job in Upwork. @Santhosh-Sellavel and @PrashantMangukiya - I have hired you to the Upwork job as well. @Santhosh-Sellavel - If you can finish the BZ checklist I'll update the comment and make any necessary reg test GHs. I'll check in later today to pay what I can. |
@strepanier03 Offer accepted on Upwork. |
@PrashantMangukiya and @ashimsharma10, I have paid you both via Upwork and closed contracts, thank you both! |
@strepanier03 Received, Thank you. |
cc: @luacmartins let me know if differ on anything, thanks! |
Regression stepsFrom the PR itself looks good to me
👍 or 👎 cc: @luacmartins or @strepanier03 |
@strepanier03 Accepted offer thanks! |
REg test added and payment finalized. Going to close this now. Thank you everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Leading or trailing spaces should be removed and email.phone number should be displayed accordingly for better UI
Actual Result :
Leading spaces makes improper indentation while display.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-04-20.at.7.36.41.PM.mov
Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681998814607449
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: