-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow split bill for hidden user #32166
Conversation
@@ -77,7 +77,6 @@ function MoneyRequestConfirmPage(props) { | |||
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false); | |||
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails); | |||
}) | |||
.filter((participant) => !!participant.login || !!participant.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the _.chain
and _.value
. We only need _.map
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt I updated.
Bug: On Native the participant name is not visible Screen.Recording.2023-11-29.at.3.09.33.PM.mov |
@s77rt Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM!
src/libs/OptionsListUtils.js
Outdated
@@ -1453,6 +1453,7 @@ function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amount | |||
function getIOUConfirmationOptionsFromParticipants(participants, amountText) { | |||
return _.map(participants, (participant) => ({ | |||
...participant, | |||
text: participant.text || Localize.translateLocal('common.hidden'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this seems to be only needed for Native?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt Because in native DisplayNames
component render the text which is fullTitle
here. On other platforms, we use displayNamesWithTooltips
props which already set Hidden
for displayName
field in getDisplayNameForParticipant
function
App/src/components/OptionRow.js
Line 115 in a0b2197
const fullTitle = props.isMultilineSupported ? text.trimStart() : text; |
App/src/components/OptionRow.js
Line 221 in a0b2197
<DisplayNames |
{fullTitle} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. But the suggested solution does not fix the bug. I think the DisplayNames
component on itself is inconsistent as the shouldUseFullTitle
prop is only available on non-native.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any suggestions? I think we only have the bug for the participant case so we can fix this in getIOUConfirmationOptionsFromParticipants
function.
What do you think about add Hidden
as default value here.
App/src/components/OptionRow.js
Line 114 in a0b2197
const text = lodashGet(props.option, 'text', ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the Hidden
as a default in DisplayNames instead? I think that would make more sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we will add Hidden
as default in native DisplayNames
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems safer as OptionRow is a generic component where Hidden
may not be wanted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt Updated.
return ( | ||
<Text | ||
accessibilityLabel={accessibilityLabel} | ||
style={textStyles} | ||
numberOfLines={numberOfLines} | ||
> | ||
{fullTitle} | ||
{fullTitle || translate('common.hidden')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency please add the same to index.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt Updated.
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chromemweb-chrome.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@dukenv0307 we have conflicts |
@luacmartins Updated. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.7-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.7-4 🚀
|
Details
Since
displayName
doesn't return for new user who doesn't change default display name, we change the condition in confirm page to allow split bill with new user.Fixed Issues
$ #31792
PROPOSAL: #31792 (comment)
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2023-11-29.at.15.34.56.mov
Android: mWeb Chrome
Screen.Recording.2023-11-29.at.15.31.00.mov
iOS: Native
Screen.Recording.2023-11-29.at.15.37.40.mov
iOS: mWeb Safari
Screen.Recording.2023-11-29.at.15.28.03.mov
MacOS: Chrome / Safari
Screen.Recording.2023-11-29.at.15.26.11.mov
MacOS: Desktop
Screen.Recording.2023-11-29.at.15.43.52.mov