added the logic for TO field calculation if the report contains more than one to and from expenses, and if someone pays directly to the user#74690
Conversation
…than one to/from expenses, and if someone pays directly to the user
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
src/libs/SearchUIUtils.ts
Outdated
| const moneyRequestReportActionID = transactionItem.moneyRequestReportActionID; | ||
| if (moneyRequestReportActionID) { | ||
| const reportActions = data[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionItem.reportID}`]; | ||
| const reportAction = reportActions[moneyRequestReportActionID]; |
There was a problem hiding this comment.
NAB. Can we pass reportAction directly instead of data? (it's available already). This would avoid use of moneyRequestReportActionID which is going to be removed
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2025-11-11.at.01.34.11.mp4Screen.Recording.2025-11-11.at.01.30.36.mp4Screen.Recording.2025-11-11.at.02.10.02.mp4 |
|
Not a product change, removing myself and unsubscribing |
luacmartins
left a comment
There was a problem hiding this comment.
Left a few minor comments
src/libs/SearchUIUtils.ts
Outdated
| * Calculates the "to" field value for a given transaction item based on the associated report and search data. | ||
| */ | ||
| function getToFieldValueForTransaction( | ||
| transactionItem: SearchTransaction, |
There was a problem hiding this comment.
We're deprecating SearchTransaction, can we use src/types/onyx/Transaction` instead?
src/libs/SearchUIUtils.ts
Outdated
| report: OnyxTypes.Report, | ||
| personalDetailsList: OnyxTypes.PersonalDetailsList, | ||
| reportAction: OnyxTypes.ReportAction | undefined, | ||
| ): SearchPersonalDetails { |
There was a problem hiding this comment.
Same here, we're deprecating SearchPersonalDetails, can we use OnyxTypes.PersonalDetailsList please
src/libs/SearchUIUtils.ts
Outdated
| } | ||
| } | ||
|
|
||
| const isIOUReport = report?.type === CONST.REPORT.TYPE.IOU; |
There was a problem hiding this comment.
We can move this variable delcaration inside the if conditional, since it's only used there
There was a problem hiding this comment.
done resolved all the comments. 👍
The updated logic still LGTM — the only remaining issue is the typecheck failure, and then we can go ahead with this one. |
|
The TS error is currently on latest main and all the PR's are facing this issue. Once the issue is resolved, i will merge the latest main changes. Thanks for the review @suneox |
|
The TS error got fixed in latest main. updated the branch with latest main. @suneox |
|
✋ 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/luacmartins in version: 9.2.55-3 🚀
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.2.57-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.57-4 🚀
|





Explanation of Change
Fixed Issues
$#73958
PROPOSAL:
Tests
Prerequistes:
User A and current user(User B)
Case 1:
Case 2:
In General verify that To field is showing correct User for all the transactions.
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
tofielddemo.mp4
MacOS: Desktop