-
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
[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 |
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.
Looks good (untested) but I have a few NABs just because i like to hear myself talk type
src/libs/actions/IOU.js
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
src/libs/actions/IOU.js
Outdated
@@ -625,6 +625,7 @@ function buildOnyxDataForMoneyRequest( | |||
* @param {Object} [policy] | |||
* @param {Object} [policyTags] | |||
* @param {Object} [policyCategories] | |||
* @param {Number} [moneyRequestReportID] |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
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.
Looks good and tests well!
There are some conflicts
@eVoloshchak 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.
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 |
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.
Works well
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.
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! |
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.
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.iouReportID
key.This PR fixes it and we pass the correct money request report in the params to the
CreateIOUTransaction
command 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 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(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
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