Repository navigation
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorMonthlyKSv2KSv2ReviewingHas a PR in reviewHas a PR in review
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.1.87-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @trjExpensify
Slack conversation (hyperlinked to channel name): #Migrate
Action Performed:
- Create two expenses with violations
- Go to Reports > Reports
- Bulk select the report > click X selected bulk action button
- Observe no Approve button in the bulk select menu
Expected Result:
Approve should be shown in the bulk action menu.
Actual Result:
Approve not displayed in the bulk action menu.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
2025-07-30_13-56-40.mp4
Recording.1467.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021952767190990111694
- Upwork Job ID: 1952767190990111694
- Last Price Increase: 2025-08-05
Issue Owner
Current Issue Owner: @greg-schroederMetadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorMonthlyKSv2KSv2ReviewingHas a PR in reviewHas a PR in review
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Jul 30, 2025
Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.abzokhattab commentedon Jul 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Approve button not displayed in the bulk action menu
What is the root cause of that problem?
In the violation‑handling block of getAction, we check for violations and return (VIEW or REVIEW) without ever checking if the user can approve. As a result, approval logic is never reached for reports with violations.
App/src/libs/SearchUIUtils.ts
Lines 951 to 957 in 0c84a19
What changes do you think we should make in order to solve the problem?
we should add a condition for the approve, final conditions should be:
result:
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
we should add a test case that covers the case where there are violations and the user is not able to approve in the SearchUIUtilsTest file
What alternative solutions did you explore? (Optional)
NA
lorretheboy commentedon Jul 30, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-08-06 11:17:24 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Approve button not displayed in the bulk action menu
What is the root cause of that problem?
Reports with violations were not showing the "Approve" action in bulk select menus because the canApproveIOU function used in
SearchUIUtils.tsdoesn't handle violations properly which returning VIEW/REVIEW for reports with violationsApp/src/libs/SearchUIUtils.ts
Line 1004 in 0c84a19
What changes do you think we should make in order to solve the problem?
Add reportAction property to TransactionListItemType that represents the action that can be taken at the report level
App/src/libs/SearchUIUtils.ts
Lines 761 to 763 in f582419
Add an additional check in the getAction function in SearchUIUtils.ts that allows approval for expense reports that are processing if the user has appropriate approval permissions. By using this ways, it catches all processing reports that should be approvable, not just those with violations
We need to support one more param in
getActionfunction to distinguish bulk selection or notisForBulkSelection = falseAdd here
Updated SearchContext.tsx to use reportAction instead of action when creating selectedReports from individual transactions
App/src/components/Search/SearchContext.tsx
Line 86 in 6e39f50
App/src/components/Search/SearchContext.tsx
Line 93 in 6e39f50
App/src/components/Search/SearchContext.tsx
Line 99 in 6e39f50
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update and add new test cases in
SearchUIUtilsTest.tsWhat alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
bernhardoj commentedon Jul 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Approve doesn't show in bulk action.
What is the root cause of that problem?
The approve (or pay) option shows if all the selected report action is approve.
App/src/pages/Search/SearchPage.tsx
Lines 163 to 168 in 101e0c1
But in our case, the action is Review because it has violations.
App/src/libs/SearchUIUtils.ts
Lines 951 to 956 in 101e0c1
What changes do you think we should make in order to solve the problem?
We can update
getActionto return an array of actions. For cases, that only allows 1 action, we will still return early, for exampleApp/src/libs/SearchUIUtils.ts
Lines 900 to 906 in 101e0c1
Then, we will have a local
allActionsvariable.If there is violation, we add the action to the array.
If approve (or pay/submit) is available, we push it too.
Then return the array.
Next, add the new array to the report map. We get the first item and set it as the "main"
action.App/src/libs/SearchUIUtils.ts
Lines 1159 to 1161 in 101e0c1
Next, in SearchContext, we need to map the
allActionstoo.App/src/components/Search/SearchContext.tsx
Lines 76 to 80 in 101e0c1
Last, instead of checking the main
action, we can check ifallActionsincludes the approve action (or pay or submit)App/src/pages/Search/SearchPage.tsx
Lines 163 to 168 in a86b485
we can use Set instead of Array
(We need the fix from #66993 too)
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
First, we need to update the
getActiontest because it now returns an array. Next, we can add a new case where the item can have Review and Approve actions.melvin-bot commentedon Aug 5, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021952767190990111694
[-]Approve button not displayed in the bulk action menu[/-][+][$250] Approve button not displayed in the bulk action menu[/+]28 remaining items
bernhardoj commentedon Aug 21, 2025
Oh, I see. I just rechecked my PR, and it doesn't show the Approve for expenses (not the full report).
web.mp4
melvin-bot commentedon Sep 15, 2025
This issue has not been updated in over 15 days. @greg-schroeder, @thienlnam, @bernhardoj, @dukenv0307 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
dukenv0307 commentedon Sep 22, 2025
@greg-schroeder The PR was merged so long ago. Can you please process the payment? Thanks
dukenv0307 commentedon Sep 24, 2025
Kindly bump @greg-schroeder
greg-schroeder commentedon Sep 26, 2025
processing
greg-schroeder commentedon Sep 26, 2025
Payment automation failed. Both contributors should be eligible for ND payments
greg-schroeder commentedon Sep 26, 2025
Payment summary:
C: @bernhardoj - $250 - ND manual request
C+: @dukenv0307 - $250 - ND manual request
Approved ☝️
bernhardoj commentedon Sep 27, 2025
Requested in ND.
quinthar commentedon Oct 12, 2025
Approved $250 to @dukenv0307
quinthar commentedon Oct 12, 2025
Approved $250 to @bernhardoj