-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix isIOUOwnedByCurrentUser #15339
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
Fix isIOUOwnedByCurrentUser #15339
Conversation
| * @returns {Boolean} | ||
| */ | ||
| function isIOUOwnedByCurrentUser(report, currentUserLogin, iouReports = {}) { | ||
| function isIOUOwnedByCurrentUser(report, iouReports = {}) { |
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.
currentUserLogin is already declared in the upper scope -
Line 42 in 70f5212
| let currentUserEmail; |
| } | ||
|
|
||
| if (report.hasOutstandingIOU && !report.isIOUReportOwner) { | ||
| if (report.hasOutstandingIOU && !ReportUtils.isIOUOwnedByCurrentUser(report, iouReports)) { |
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.
isIOUReportOwner is not a property of the report object
|
Nice find, looking good so far. Ping me when it's ready for review! |
|
Oh, i thought I was assigned -- I didn't realise it was just a CC :) |
|
Nice that you found those. Refactoring all that logic was a bear. Sorry for messing it up in these spots! |
|
@s77rt we'll review this one internally since it's part of a fix for a design doc |
Julesssss
left a comment
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.
Tests as expected, though I'm starting to question the logic behind the ordering.
Verify that the chats with IOUs where you owe are sorted at the top of the LHN
Has it been discussed that reports where you are owed, should NOT be prioritized in the LHN ordering? AFAIK we wanted both red and green badges to be prioritized, to avoid losing track of money that is owed, but maybe I missed the discussion that changed this.
|
That's a good point and I questioned that as well. I think that since we are deprecating the IOU badge and moving to highlighting "to dos", this would be expected. I asked in our Manual Requests chat to clarify though. |
We still show the green badge, so I'd expect that to be pinned. We should probably take this to a more public channel |
|
Yea, for now we show the green badge and I'd also expect those to be pinned. After Manual Requests though, we're only pinning chats for admins and payers (P2P), so this would be the expected behavior. I'm fine waiting to merge this until we start with the implementation for Manual Requests. |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
✋ 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/Gonals in version: 1.2.81-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.2.81-1 🚀
|


Details
This logic always returned
falseascurrentUserLoginis an object containing user login information and not the user email.Additionally, this line always returned true for
!report.isIOUReportOwnersinceisIOUReportOwneris not a property of thereportobject.cc @Julesssss @tgolen
Fixed Issues
$ #15390
Tests
Offline tests
N/A
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
web.mov
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov