-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix split bill display / selection with new users #21113
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
Conversation
|
@narefyev91 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
|
src/libs/OptionsListUtils.js
Outdated
| keyForList: details.login, | ||
| login: details.login, | ||
| keyForList: details.login || details.displayName || String(details.accountID), | ||
| login: details.login || details.displayName, |
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.
Hmm, why we fallback to displayName in login? This is confusing
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.
The user's login is not always going to be available in details - so we either need to default to displayName here orrr store displayName in each option and default to it when we render these options, 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.
What would go wrong if we keep the login field empty/undefined? (instead of falling back to displayName)
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.
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, can we instead set a displayName field and use it in the iou pages
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.
Relaying on accountID instead of login seems to do it.
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(
(this.props.option.participantsList || this.props.option.accountID ? [this.props.option] : []).slice(0, 10),
isMultipleParticipant,
);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.
Ooh that seems like a better fix - though I'm still surprised isMoneyRequestReport: true, on options for MoneyRequest pages... Maybe that's a follow-up question
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.
I will be back in 45min or so, the above fix should be the correct fix, feel free to merge if this is critical
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.
isMoneyRequestReport is unrelated. this is true when the report is iou report or expense report, this has nothing to do with iou, it's used for other optionrow usage (not totally sure, but that's what I think)
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.
asking in slack for someone to test on all platforms for you
| @@ -216,18 +216,19 @@ function isPersonalDetailsReady(personalDetails) { | |||
| function getParticipantsOptions(report, personalDetails) { | |||
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.
I'm curious why we're not returning isMoneyRequestReport: true here, but that's for another day
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.
Asked here, but it's been a few months so idk if there's a good answer, just checking
Reviewer Checklist
Screenshots/VideosWeb8mb.video-9GW-lIjZ8WDH.mp4Mobile Web - Chromeandroid-web.movMobile Web - Safariios-web.movDesktop8mb.video-hjk-MSNRJKZc.mp4iOS8mb.video-oze-cRTyiYcm.mp4Android8mb.video-OGn-DuSLl0FR.mp4 |
|
Something still broken Kooha-2023-06-20-15-59-43.mp4 |
|
@narefyev91 You need to test against staging server (toggle on the staging switch) |
|
I think I found that bug. In BaseOptionList, OptionRow isSelected prop is based once again on login, let's change that to accountID.
|
|
@s77rt interesting, I can't reproduce that even on staging at the moment 🤔 But I do think what you're looking at is another thing that should be fixed at some point so I might as well do it in this PR 😅 |
|
@s77rt can you please re-test with the updated change? |
|
Much better! |
Fix split bill display / selection with new users (cherry picked from commit 574c73e)
…-21113 🍒 Cherry pick PR #21113 to staging 🍒
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 1.3.29-8 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
Looks like it's working well on staging 👍 Screen.Recording.2023-06-20.at.8.35.36.PM.mov |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.29-11 🚀
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.32-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.32-5 🚀
|

Details
Fixed Issues
$ #21075
Tests
Offline tests
Verify the above still works offline - all the correct personal details are shown everywhere
QA Steps
Same as above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android