[Wave6] Enable requesting on specific report#35246
Conversation
|
@eVoloshchak @ One of you needs to 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] |
|
@eVoloshchak Do you have the Collect policy set up? Can you do a checklist on this one? For now you can confirm the params of the requestMoney call are correct, the backend part of the fix will be deployed on Monday |
Beamanator
left a comment
There was a problem hiding this comment.
Looks good (untested) but I have a few NABs just because i like to hear myself talk type
| const isNewIOUReport = !moneyRequestReportID && (!chatReport.iouReportID || ReportUtils.hasIOUWaitingOnCurrentUserBankAccount(chatReport)); | ||
| let iouReport = isNewIOUReport ? null : allReports[`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReportID > 0 ? moneyRequestReportID : chatReport.iouReportID}`]; |
There was a problem hiding this comment.
NAB - This seems a bit cleaner to me, what do you think? It could be too verbose, just thinking out loud :D
| const isNewIOUReport = !moneyRequestReportID && (!chatReport.iouReportID || ReportUtils.hasIOUWaitingOnCurrentUserBankAccount(chatReport)); | |
| let iouReport = isNewIOUReport ? null : allReports[`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReportID > 0 ? moneyRequestReportID : chatReport.iouReportID}`]; | |
| let iouReport = null; | |
| const isNewIOUReport = !moneyRequestReportID && (!chatReport.iouReportID || ReportUtils.hasIOUWaitingOnCurrentUserBankAccount(chatReport)); | |
| if (moneyRequestReportID > 0) { | |
| iouReport = allReports[`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReportID}`]; | |
| } else if (!isNewIOUReport) { | |
| iouReport = allReports[`${ONYXKEYS.COLLECTION.REPORT}${chatReport.iouReportID}`]; | |
| } |
There was a problem hiding this comment.
@mountiny I'm working on TS migration of IOU file, and after merging the latest main I have a question regarding this part of the code.
Since moneyRequestReportID can be a string, TS complains on this check
if (moneyRequestReportID > 0) {
Was there any reason why you decided to have this specific check or may I update it just to be
if (moneyRequestReportID) {
Also for type consistency, I would update moneyRequestReportID default values form 0 to empty string '' here, here and here, what do you think?
There was a problem hiding this comment.
@VickyStash Thank I think that makes sense to do now given the reportIDs are typed as string. In backend its integer so might be a bit confusing for internal devs
| * @param {Object} [policy] | ||
| * @param {Object} [policyTags] | ||
| * @param {Object} [policyCategories] | ||
| * @param {Number} [moneyRequestReportID] |
There was a problem hiding this comment.
NAB - would it be helpful to explain the purpose of this new param? I'm not exactly sure how to explain, i tried for like 5 minutes 🤣
Like how can we explain why chatReport.iouReport is useful sometimes but not always, which is why we need this param? Or is that obvious to everyone but me? :D
There was a problem hiding this comment.
Yeah I was actually thinking about the same but did not come up with anything short. I am adding something now, let me know how it sounds!
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-30.at.01.04.14.movAndroid: mWeb ChromeScreen.Recording.2024-01-30.at.01.09.24.moviOS: NativeScreen.Recording.2024-01-30.at.01.14.27.moviOS: mWeb SafariScreen.Recording.2024-01-30.at.01.11.13.movMacOS: Chrome / SafariScreen.Recording.2024-01-30.at.01.00.05.movMacOS: DesktopScreen.Recording.2024-01-30.at.01.15.43.mov |
|
@Beamanator Updated! |
|
@eVoloshchak this should be fine to test now! |
eVoloshchak
left a comment
There was a problem hiding this comment.
Looks good and tests well!
There are some conflicts
|
@eVoloshchak updated! |
Beamanator
left a comment
There was a problem hiding this comment.
Looks like lint is failing here
|
Should be fixed, that was from testing some other branch it it somehow got into the merge commit, sorry |
Beamanator
left a comment
There was a problem hiding this comment.
Looking great! Not merging just b/c of the one outstanding comment about the "Composer" comment
Co-authored-by: Alex Beaman <alexbeaman@expensify.com>
|
@Beamanator Accepted your suggestion! thanks! |
Beamanator
left a comment
There was a problem hiding this comment.
LGTM - thanks @mountiny !
|
✋ 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/Beamanator in version: 1.4.35-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.35-7 🚀
|
cc @Gonals
Details
When user requested money from within a specific report, we did not pass the specific reportID to the backend. Instead we always depended on what reportID has been saved in the
chatReport.iouReportIDkey.This PR fixes it and we pass the correct money request report in the params to the
CreateIOUTransactioncommand and as a result the transaction is added to a correct report.Fixed Issues
$ #34906
Tests
Offline tests
Same as tests
QA Steps
Same as tests
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
I have tested on web and mWeb since this change is platform agnostic
Screen.Recording.2024-01-26.at.13.50.49.mp4
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop