-
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
[$1000] Email address is being displayed on the IOU preview instead of the last name #14228
Comments
Triggered auto assignment to @MitchExpensify ( |
Not a bug because the profile is incomplete so its reasonable to display the email of the user instead of surname - Discussion here https://expensify.slack.com/archives/C049HHMV9SM/p1673487138834609?thread_ts=1673426920.016829&cid=C049HHMV9SM |
We're actually going to fix this in favor of the consistent pattern that exists today. Namely, showing the last name regardless of not having a first name saved |
Job added to Upwork: https://www.upwork.com/jobs/~01e0d43c6a348fa48c |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @robertjchen ( |
ProposalWe can add another or condition to get the last name in case the first name is empty. diff --git a/src/components/ReportActionItem/IOUPreview.js b/src/components/ReportActionItem/IOUPreview.js
index 1c997119d..cb3115602 100644
--- a/src/components/ReportActionItem/IOUPreview.js
+++ b/src/components/ReportActionItem/IOUPreview.js
@@ -119,8 +119,11 @@ const IOUPreview = (props) => {
const isCurrentUserManager = managerEmail === sessionEmail;
const managerName = lodashGet(props.personalDetails, [managerEmail, 'firstName'], '')
+ || lodashGet(props.personalDetails, [ownerEmail, 'lastName'], '')
|| Str.removeSMSDomain(managerEmail);
- const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '') || Str.removeSMSDomain(ownerEmail);
+ const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '')
+ || lodashGet(props.personalDetails, [ownerEmail, 'lastName'], '')
+ || Str.removeSMSDomain(ownerEmail);
const managerAvatar = lodashGet(props.personalDetails, [managerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(managerEmail);
const ownerAvatar = lodashGet(props.personalDetails, [ownerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(ownerEmail);
const cachedTotal = props.iouReport.total && props.iouReport.currency |
Proposal We just need to change diff --git a/src/components/ReportActionItem/IOUPreview.js b/src/components/ReportActionItem/IOUPreview.js
index 1c997119d..d1ea9faad 100644
--- a/src/components/ReportActionItem/IOUPreview.js
+++ b/src/components/ReportActionItem/IOUPreview.js
@@ -118,9 +118,9 @@ const IOUPreview = (props) => {
// Pay button should only be visible to the manager of the report.
const isCurrentUserManager = managerEmail === sessionEmail;
- const managerName = lodashGet(props.personalDetails, [managerEmail, 'firstName'], '')
+ const managerName = lodashGet(props.personalDetails, [managerEmail, 'displayName'], '')
|| Str.removeSMSDomain(managerEmail);
- const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '') || Str.removeSMSDomain(ownerEmail);
+ const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'displayName'], '') || Str.removeSMSDomain(ownerEmail);
const managerAvatar = lodashGet(props.personalDetails, [managerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(managerEmail);
const ownerAvatar = lodashGet(props.personalDetails, [ownerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(ownerEmail);
const cachedTotal = props.iouReport.total && props.iouReport.currency |
ProposalDisplay name is enough it will also handle email/phone App/src/components/ReportActionItem/IOUPreview.js Lines 121 to 123 in 9a7b027
Make the suggested changes - - const managerName = lodashGet(props.personalDetails, [managerEmail, 'firstName'], '')
- || Str.removeSMSDomain(managerEmail);
+ const managerName = lodashGet(props.personalDetails, [managerEmail, 'displayName'], '')
- const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '') || Str.removeSMSDomain(ownerEmail);
+ const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'displayName'], '') |
Using display name will show both first name and last name, but I think we only want to show either the first or the last name (or email if both empty). |
@bernhardoj I think so. But IOU Quote must also be updated accordingly. I am not sure if it is possible to change IOUQuote message from front end. |
Yeah, I think the IOU quote message is composed on the backend. Here is the params example when we send money through
Anyway, I have an updated proposal which I will post on the next comment. |
Updated ProposalWe can simplify the condition with just diff --git a/src/components/ReportActionItem/IOUPreview.js b/src/components/ReportActionItem/IOUPreview.js
index 1c997119d..b90d9ce42 100644
--- a/src/components/ReportActionItem/IOUPreview.js
+++ b/src/components/ReportActionItem/IOUPreview.js
@@ -119,8 +119,9 @@ const IOUPreview = (props) => {
const isCurrentUserManager = managerEmail === sessionEmail;
const managerName = lodashGet(props.personalDetails, [managerEmail, 'firstName'], '')
- || Str.removeSMSDomain(managerEmail);
- const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '') || Str.removeSMSDomain(ownerEmail);
+ || lodashGet(props.personalDetails, [managerEmail, 'displayName'], '');
+ const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '')
+ || lodashGet(props.personalDetails, [ownerEmail, 'displayName'], '');
const managerAvatar = lodashGet(props.personalDetails, [managerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(managerEmail);
const ownerAvatar = lodashGet(props.personalDetails, [ownerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(ownerEmail);
const cachedTotal = props.iouReport.total && props.iouReport.currency If first name is empty, then display name will only contains either last name or email. Or, we can use an existing function to get the name which basically do the same as above. diff --git a/src/components/ReportActionItem/IOUPreview.js b/src/components/ReportActionItem/IOUPreview.js
index 1c997119d..7f9844de7 100644
--- a/src/components/ReportActionItem/IOUPreview.js
+++ b/src/components/ReportActionItem/IOUPreview.js
@@ -118,9 +118,8 @@ const IOUPreview = (props) => {
// Pay button should only be visible to the manager of the report.
const isCurrentUserManager = managerEmail === sessionEmail;
- const managerName = lodashGet(props.personalDetails, [managerEmail, 'firstName'], '')
- || Str.removeSMSDomain(managerEmail);
- const ownerName = lodashGet(props.personalDetails, [ownerEmail, 'firstName'], '') || Str.removeSMSDomain(ownerEmail);
+ const managerName = ReportUtils.getDisplayNameForParticipant(managerEmail, true)
+ const ownerName = ReportUtils.getDisplayNameForParticipant(ownerEmail, true)
const managerAvatar = lodashGet(props.personalDetails, [managerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(managerEmail);
const ownerAvatar = lodashGet(props.personalDetails, [ownerEmail, 'avatar']) || ReportUtils.getDefaultAvatar(ownerEmail);
const cachedTotal = props.iouReport.total && props.iouReport.currency |
@robertjchen We might need to handle it backend (at least partially) since change in IOUQuote message might not be possible at the front. |
@sobitneupane Got it! That makes sense, I can look into the backend changes- appreciate the discussion here. @bernhardoj 's updated proposal looks good to me 👍 |
Yes, for the frontend change we can go with @bernhardoj's proposal of using existing |
Should I open the PR now? |
Yes @bernhardoj |
Okay. I thought I need to wait for the assignment first 😅. PR is ready. |
📣 @bernhardoj You have been assigned to this job by @MitchExpensify! |
Looks like the change went out to prod last week, going to remove the |
It seems like we may be past the 7-day regression period as I don't see the checklist? cc: @MitchExpensify for clarification on next steps 🙏 |
All paid out! Thanks 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:
Last name is displayed on the IOU preview like it is displayed everywhere else
Actual Result:
Email address is being displayed instead of the last name on IOU preview
In LHN it appears with Last name
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.52-4
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:
last.name.mov
Recording.1264.mp4
Expensify/Expensify Issue URL:
Issue reported by: @adeel0202
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1673426920016829
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: