Fix View payment history to show only billing owner's receipts#90106
Conversation
|
@aswin-s what's your ETA on putting this into review? |
Add from:me filter to scope results to the current user and explicitly list all expense statuses including Deleted so billing owner's own receipts are not excluded. Fixes Expensify#89402
The 'me' keyword in user-based filters (from, to, assignee, exporter) was not being resolved to the current user's account ID when populating the Filters form and display chips, causing the From field to appear empty. This resolves 'me' to the current user's account ID in buildFilterFormValuesFromQuery and handles the 'me' keyword directly in getFilterDisplayValue.
5838561 to
0220235
Compare
|
@mananjadhav Please 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Tests buildFilterFormValuesFromQuery resolving 'me' to account ID for from/to filters, and getFilterDisplayValue returning 'me' for the literal keyword.
|
@trjExpensify It is ready for review. |
|
Thanks! @mananjadhav can you jump on this, please? |
|
On my list today. |
|
Bump @mananjadhav! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb Chromemweb-chrome-subscription-filter.moviOS: HybridApp(Offline) iOS: mWeb Safarimweb-safari-subscription-filter.movMacOS: Chrome / Safariweb-subscription-filter.mov |
mananjadhav
left a comment
There was a problem hiding this comment.
I was just on the PR when I got bumped. My Android emulator keeps crashing due to memory. The change is not platform specific, tested on other platforms.
yuwenmemon
left a comment
There was a problem hiding this comment.
LGTM - sorry for the delay here
|
@yuwenmemon looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/yuwenmemon in version: 9.3.76-0 🚀
|
|
No help site changes are required for this PR. This PR fixes the search query logic behind the View payment history button (adding |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.77-3 🚀
|
Explanation of Change
The
viewPurchases()function inCardSection.tsxbuilds the search query for View payment history with onlytype,status, andmerchantfilters. Two issues:fromfilter — without scoping by the current user, the search returnsExpensify, Inc.billing receipts from all visible users, not just the billing owner.Deletedstatus excluded —CONST.SEARCH.STATUS.EXPENSE.ALLis an empty string (''), which is falsy and gets silently skipped bybuildQueryStringFromFilterFormValues. The billing owner's own receipts are inDeletedstatus, so they never appear.This PR adds
from: [CONST.SEARCH.ME]to scope results to the billing owner and replaces the emptyALLstatus with an explicit array of all expense statuses includingDELETED.Additionally, the
mekeyword was not being resolved in the search filter UI — theFromfilter chip and Filters panel appeared empty becausebuildFilterFormValuesFromQuerytried to look up"me"inpersonalDetails(which has no such key). This PR also resolves"me"to the current user's account ID inbuildFilterFormValuesFromQueryand handles the keyword directly ingetFilterDisplayValueso the filter chip correctly displays the user's name.Fixed Issues
$ #89402
PROPOSAL: #89402 (comment)
Tests
from:meandmerchant:"Expensify, Inc."unreported,drafts,outstanding,approved,done,paid,deletedOffline tests
N/A — this change only modifies the search query string built before navigation. No network request is made until the search page loads, which has its own offline handling.
QA Steps
Expensify, Inc.receiptsPR 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))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.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
Mac.OS.mp4