Closed kbecciv closed 1 year ago
Triggered auto assignment to @kevinksullivan (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)On Split detail displaying email address instead of user name in split detail
The problem stems from the "OptionListUtils.js" file, specifically within the "getIOUConfirmationOptionsFromPayeePersonalDetail" function. The displayName variable is empty in this function, resulting in the addition of email addresses instead of user names.
To resolve this issue, we suggest making the following changes in the "getIOUConfirmationOptionsFromPayeePersonalDetail" function:
NA
Split Bill shows email address instead of user name in split detail page for payee. Aditionally, the avatar is also wrong for payee.
The participants in SplitBillDetailsPage
use the function below to fetch participants
which are then filtered to get payeePersonalDetails
and participantsExcludingPayee
. As you can see, we set text
to displayName
here but the key displayName
is not part of object that is returned.
https://github.com/Expensify/App/blob/2a1c36d5bea964ee92ebfad11f92d8a22bbb7e4c/src/libs/OptionsListUtils.js#L213-L232
These are passed to MoneyRequestConfirmationList
in SplitBillDetailsPage
-
https://github.com/Expensify/App/blob/fa5e5509d28123fe8676ef2749ad41900e0536b3/src/pages/iou/SplitBillDetailsPage.js#L84-L94
Now inside MoneyRequestConfirmationList
, we use getIOUConfirmationOptionsFromPayeePersonalDetail
for getting details of payee with amount
, in line 813 we try to set displayName
to text
but displayName
is not available as text
was set to displayName
in getParticipantsOptions
line 218. So email is used as the fallback is personalDetail.login
in line 813.
https://github.com/Expensify/App/blob/2a1c36d5bea964ee92ebfad11f92d8a22bbb7e4c/src/libs/OptionsListUtils.js#L811-L825
It is correct for other participants, because for other participants, we use getIOUConfirmationOptionsFromParticipants
which doesn't change participant
and only adds amount
-
https://github.com/Expensify/App/blob/2a1c36d5bea964ee92ebfad11f92d8a22bbb7e4c/src/libs/OptionsListUtils.js#L834-L838
In OptionRow
we show user name using fullTitle
which is passed this.props.option.text
which is wrong for payee
-
https://github.com/Expensify/App/blob/2a1c36d5bea964ee92ebfad11f92d8a22bbb7e4c/src/components/OptionRow.js#L211-L213
We should not change the personalDetail
prop in getIOUConfirmationOptionsFromPayeePersonalDetail
, instead we should follow the same approach followed in getIOUConfirmationOptionsFromParticipants
and just add the amount
in the field descriptiveText
.
To follow DRY, we can -
Change the function getIOUConfirmationOptionsFromPayeePersonalDetail
to just return personalDetail object with a new field descriptiveText
for amount
. And then, we can reuse this function for participants
. We can name this in a generic way so that it doesn't specify payee/participants.
function getIOUConfirmationOptionFromSingleParticipant(participant, amountText) {
return {
...participant,
descriptiveText: amountText,
};
}
Now, we can use this function for payee
and in getIOUConfirmationOptionsFromParticipants
we can reuse the new function above.
NA
This is a dupe of https://github.com/Expensify/App/issues/20118. There is already a PR going on to fix this
Yes, it is a duplicate issue. We can close this. It was known to us so not eligible for reporting I guess.
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:
The user name should be displayed in the split detail
Actual Result:
Instead of displaying the user name, the email address is shown in the split detail
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.27.4
Reproducible in staging?: Yes
Reproducible in production?: n/a
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
https://github.com/Expensify/App/assets/93399543/e18ac51a-ae92-4555-8543-e3ca40bc32f1
https://github.com/Expensify/App/assets/93399543/869aaaa4-b832-4b78-a7f4-eaee81472b86
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686216389868629
View all open jobs on GitHub