Fix bulk Pay/Mark as Paid disappearing for whole-report selections#94075
Draft
MelvinBot wants to merge 1 commit into
Draft
Fix bulk Pay/Mark as Paid disappearing for whole-report selections#94075MelvinBot wants to merge 1 commit into
MelvinBot wants to merge 1 commit into
Conversation
…s Paid options appear for whole-report selections Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
Contributor
Author
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
When multiple whole reports are selected in the Search/Reports view, the bulk action menu intermittently dropped both Pay and Mark as Paid, leaving only Export — even when the selected reports shared the same currency and month.
Root cause:
selectedPolicyIDswas derived only fromselectedTransactions, never fromselectedReports. When the user selects whole reports (no individual transaction rows),selectedTransactionsis empty, soselectedPolicyIDswas empty andselectedPolicyIDwasundefined.useBulkPayOptionsshort-circuits tobulkPayButtonOptions = undefinedwhenselectedPolicyIDis missing, and the menu gate… && !!bulkPayButtonOptions?.lengththen removed the entire Pay group — including its Mark as Paid submenu item. (selectedReportIDalready falls back toselectedReportIDs, butselectedPolicyIDdid not — this gap was introduced alongside the cross-workspace bulk-pay change in #87148.)The fix derives
selectedPolicyIDsfromselectedReportsas well asselectedTransactions, so whole-report selections produce a validselectedPolicyIDanduseBulkPayOptionscan build the native Pay options (and, for multi-currency selections, the Mark as Paid / Pay Elsewhere fallback) instead of returningundefined.This implements item 2 of the approved proposal — the regression that explains the dominant reported symptom (options disappearing even for same-currency/same-month selections). Proposal items 1 (offering a standalone Mark as Paid that is fully decoupled from the native Pay submenu) and 3 (degrading rather than removing the group when one selected report has
canPay === false) change bulk-pay eligibility semantics and warrant dedicated multi-workspace QA, so they are intentionally left out of this PR and called out as follow-ups for the reviewer.Fixed Issues
$ #93699
PROPOSAL: #93699 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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