You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-07-14] [$1000] Web - Phone number is shown twice in the preview tooltip. #21197
When user sign up with with there phone number we save the displayName same as the phone number and login id append with SMS domain "+phoneNumber@expensify.sms"
For the phone number case our condition failed to check login and displayName is same and we display same number twice
What changes do you think we should make in order to solve the problem?
While signup time, we have a method formatPhoneNumber in 'src/libs/LocalePhoneNumber.js' which is used to convert phone number to displayName
We can use the same method to check if login phone number is the same as the current displayName as (Why current? Because the user can update their displayName in the future)
if this return true if do not show the second text otherwise show
snippets:
constformatLoginIdAsDisplayName=(login)=>{if(!login){returnnull;}// If login type is not phone number return same loginif(!Str.isSMSLogin(login)){returnlogin;}// Remove SMS domain and format phone number as DisplayNamereturnLocalePhoneNumber.formatPhoneNumber(Str.removeSMSDomain(login))}//Now call this like{String(userDetails.login||'').trim()&&!_.isEqual(formatLoginIdAsDisplayName(userDetails.login),userDetails.displayName)? Str.removeSMSDomain(userDetails.login) : ''}
Resultdisplay-name.mp4
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
Phone number is shown twice in tooltip on user with no name.
What is the root cause of that problem?
In the UserDetailsTooltip component, we are currently checking whether userDetails.login is equal to userDetails.displayName in order to determine if the user has a display name or not. This approach works correctly for accounts that use email as the login method. However, for phone number accounts, the userDetails.displayName string differs from the userDetails.login string.
changed the title [-]Web - Phone number is shown twice in the preview tooltip.[/-][+][$1000] Web - Phone number is shown twice in the preview tooltip.[/+]on Jun 22, 2023
Sorry, there are so many "fun" URLs in Upwork. I've sent the offer now! Once that's accepted, I'll pay that, then will leave this open to make sure that Santhosh gets paid via New Dot
Activity
melvin-bot commentedon Jun 21, 2023
Triggered auto assignment to @conorpendergrast (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)manjesh-yadav commentedon Jun 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - Phone number is shown twice in the preview tooltip
What is the root cause of that problem?
We display two texts in the tooltip
displayNameandloginApp/src/components/UserDetailsTooltip/index.js
Lines 26 to 32 in 0b7455f
if
loginanddisplayNameis the same we do not display the second textwe check this by this line of code
displayNamesame as the phone number and login id append with SMS domain"+phoneNumber@expensify.sms"loginanddisplayNameis same and we display same number twiceWhat changes do you think we should make in order to solve the problem?
While signup time, we have a method
formatPhoneNumberin 'src/libs/LocalePhoneNumber.js' which is used to convert phone number todisplayNameWe can use the same method to check if
loginphone number is the same as the currentdisplayNameas (Why current? Because the user can update theirdisplayNamein the future)if this return true if do not show the second text otherwise show
snippets:
Result
display-name.mp4
What alternative solutions did you explore? (Optional)
If we do not want to show phone number in tooltip
from:
to like this:
Tushu17 commentedon Jun 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Phone number is shown twice in tooltip on user with no name.
What is the root cause of that problem?
In the
UserDetailsTooltipcomponent, we are currently checking whetheruserDetails.loginis equal touserDetails.displayNamein order to determine if the user has a display name or not. This approach works correctly for accounts that use email as the login method. However, for phone number accounts, theuserDetails.displayNamestring differs from theuserDetails.loginstring.App/src/components/UserDetailsTooltip/index.js
Line 31 in 0b7455f
What changes do you think we should make in order to solve the problem?
We can check if user has a empty
userDetails.firstNameanduserDetails.lastNameinstead of checkinguserDetails.displayName{String(userDetails.login).trim() && _.isEmpty(userDetails.firstName) && _.isEmpty(userDetails.lastName) ? '' : Str.removeSMSDomain(userDetails.login)}What alternative solutions did you explore? (Optional)
Na
conorpendergrast commentedon Jun 22, 2023
Reproduced on OSX desktop app too. Thanks!
[-]Web - Phone number is shown twice in the preview tooltip.[/-][+][$1000] Web - Phone number is shown twice in the preview tooltip.[/+]melvin-bot commentedon Jun 22, 2023
Job added to Upwork: https://www.upwork.com/jobs/~011baa54223aee0feb
melvin-bot commentedon Jun 22, 2023
Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 22, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (
External)40 remaining items
Santhosh-Sellavel commentedon Jul 14, 2023
Requested payment on ND
conorpendergrast commentedon Jul 17, 2023
Contract sent to @manjesh-yadav, waiting for @Tushu17 to apply to the job.
conorpendergrast commentedon Jul 17, 2023
QA test request here: https://github.com/Expensify/Expensify/issues/300411
conorpendergrast commentedon Jul 17, 2023
Paid @manjesh-yadav!
Tushu17 commentedon Jul 17, 2023
@conorpendergrast I'm not able to access the job posting, Ig you haven't shared the correct link. Can you just send me an invitation to my Upwork ID? https://www.upwork.com/freelancers/~01d43dd6772957dbb0
Santhosh-Sellavel commentedon Jul 17, 2023
@Tushu17 here is the link provided earlier it works for me
https://www.upwork.com/jobs/~011baa54223aee0feb
Tushu17 commentedon Jul 17, 2023
Thank you, @Santhosh-Sellavel. @conorpendergrast I've applied for the job.
conorpendergrast commentedon Jul 17, 2023
Sorry, there are so many "fun" URLs in Upwork. I've sent the offer now! Once that's accepted, I'll pay that, then will leave this open to make sure that Santhosh gets paid via New Dot
Tushu17 commentedon Jul 17, 2023
@conorpendergrast I've accepted the offer. Thank you.
conorpendergrast commentedon Jul 18, 2023
Paid! Keeping this open until Santhosh gets paid via New Dot
anmurali commentedon Jul 18, 2023
Approved $1500 (with bonus) for Santhosh on ND
conorpendergrast commentedon Jul 18, 2023
Nice, thanks. All done