[CP Staging][Better Expense Report View] Fix Send Money flow issue caused by excluding pay from one transaction thread logic#63648
Conversation
|
Testing now.. |
| const {type, chatType, parentReportID, parentReportActionID} = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`] ?? {}; | ||
|
|
||
| // ...and can only be triggered on DM chats | ||
| const isDM = type === CONST.REPORT.TYPE.CHAT && !chatType && !(parentReportID && parentReportActionID); |
There was a problem hiding this comment.
is there no helper method for this?
There was a problem hiding this comment.
There is a simple helper isDM that does exactly this in ReportUtils but can't be imported due to circular import. Thought it would be better to just use the code directly instead of changing the structure of these files because it is rather simple check.
| // ...which is 'pay'... | ||
| const isFirstActionPay = getOriginalMessage(iouActions.at(0))?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY; | ||
|
|
||
| const {type, chatType, parentReportID, parentReportActionID} = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`] ?? {}; |
There was a problem hiding this comment.
Please pass these props directly or pass the report object itself, this is not a pure function
| return; | ||
| } | ||
|
|
||
| const sendMoneyFlowID = getSendMoneyFlowOneTransactionThreadID(reportActions, report?.chatReportID); |
There was a problem hiding this comment.
even here se should pass the full report
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp01_Android_Native.mp4Android: mWeb Chrome02_Android_Chrome.mp4iOS: HybridApp03_iOS_Native.mp4iOS: mWeb Safari04_iOS_Safari.mp4MacOS: Chrome / Safari05_MacOS_Chrome.mp4MacOS: Desktop06_MacOS_Desktop.mp4 |
|
For some context, discussion here: https://swmansion.slack.com/archives/C01GTK53T8Q/p1749216539285459?thread_ts=1749184956.665079&cid=C01GTK53T8Q |
We're making a followup PR to handle impure function
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…-money-flow [Better Expense Report View] Fix Send Money flow issue caused by excluding pay from one transaction thread logic (cherry picked from commit 0e2b131) (cherry-picked to staging by mountiny)
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.60-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.62-0 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.62-0 🚀
|
…3648-code-to-new-onyx-rule Adjust #63648 PR code to new pure Onyx functions rule
Explanation of Change
In #63546 I stated that:
This is true for every report except the Send Money flow, as in such a report,
payis the only IOU action and it is used to obtain expense information. This PR fixes an issue caused by the linked PR by checking whether the report is in the specified flow; if so, the action is counted as a transaction.Fixed Issues
$ #63619
PROPOSAL: N/A
Tests
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Web.mov
MacOS: Desktop