-
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
Fix isIOUOwnedByCurrentUser #15339
Fix isIOUOwnedByCurrentUser #15339
Conversation
* @param {Object} iouReports | ||
* @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; |
@@ -129,7 +129,7 @@ function getOrderedReportIDs(reportIDFromRoute) { | |||
return; | |||
} | |||
|
|||
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 |
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
false
ascurrentUserLogin
is an object containing user login information and not the user email.Additionally, this line always returned true for
!report.isIOUReportOwner
sinceisIOUReportOwner
is not a property of thereport
object.cc @Julesssss @tgolen
Fixed Issues
$ #15390
Tests
Offline tests
N/A
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)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
Web
web.mov
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov