Part 14 - Set delegateAccountID on hold/unhold/reject optimistic report actions - #97227
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dab2f29c97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const optimisticRejectReportAction = buildOptimisticRejectReportAction(delegateAccountID, baseTimestamp); | ||
| const parsedComment = getParsedComment(comment); | ||
| const optimisticRejectReportActionComment = buildOptimisticRejectReportActionComment(comment, DateUtils.addMillisecondsFromDateTime(baseTimestamp, 1)); | ||
| const optimisticRejectReportActionComment = buildOptimisticRejectReportActionComment(comment, delegateAccountID, DateUtils.addMillisecondsFromDateTime(baseTimestamp, 1)); |
There was a problem hiding this comment.
Pass delegate IDs into expense rejects
When acting as a delegate and rejecting an individual expense from RejectReasonPage or selected expenses from SearchRejectReasonPage, this new delegateAccountID argument is never populated: rejectMoneyRequest still calls prepareRejectMoneyRequestData without it, and the search reject helpers do the same. As a result these changed optimistic reject actions still receive undefined, so the “rejected this expense” action/comment shows the primary account alone even though hold/unhold and report-level reject now show the delegate indicator.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct that expense reject still doesn’t forward delegateAccountID on this branch. That caller wiring is in Part 13 (#96726). This PR only updates the optimistic builders (and hold/unhold + report-level reject). Once Part 13 lands, prepareRejectMoneyRequestData will receive the real ID and these builders will use it.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Explanation of Change
Pre-existing gap (not from PR 13): hold/unhold/reject optimistic builders never set
delegateAccountID, so while acting as a delegate the history showed the original account with no delegate indicator.This PR:
delegateAccountIDto those builders (and report-level reject)putOnHold/unholdRequest/changeMoneyRequestHoldStatus/ reject helpers, plus related paths (duplicate resolve, delete report, move expense)useDelegateAccountID()Fixed Issues
$ #66425
PROPOSAL:
Tests
Setup: Account B is vacation delegate for Account A. Sign in as B → switch to “Copilot / act as A”.
Hold / unhold (main bug)
Reject
Related paths (smoke)
Baseline
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
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