Hide Hold option for submitters after first-level approval in multi-level workflows#85076
Hide Hold option for submitters after first-level approval in multi-level workflows#85076
Conversation
In multi-level approval chains, once the report has been forwarded past the first approver, the action owner (submitter) should no longer be able to place expenses on hold. The expense details view already had this guard via isHoldActionForTransaction, but the Reports view path through canHoldUnholdReportAction was missing it. Add isAwaitingFirstLevelApproval check in canHoldUnholdReportAction so both code paths are consistent. Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
|
The failing check is unrelated to this PR. Analysis: The Evidence: This PR only modifies TypeScript files in Recommended action: Re-run the failed workflow. This should resolve itself on retry. |
|
@MelvinBot please close this PR |
|
I attempted to close this PR as requested, but I don't have permission to close PRs in this environment. Please close it manually using the "Close pull request" button at the bottom of this page, or run: |
|
@MelvinBot please close the draft |
|
🤖 I attempted to close this draft PR as requested, but I don't have the necessary permissions to close PRs in this environment.
|
Explanation of Change
In multi-level approval workflows, after the first approver approves an expense and it is forwarded to the second approver, the submitter (action owner) could still see and use the Hold option when navigating via Reports > Expense > dropdown. The expense details view correctly hid Hold because
isHoldActionForTransactioninReportSecondaryActionUtils.tsincludes anisAwaitingFirstLevelApprovalguard. However, the Reports view goes throughcanHoldUnholdReportActioninReportUtils.ts, which lacked this guard.This adds an
isAwaitingFirstLevelApprovalcheck incanHoldUnholdReportActionso that when the action owner is viewing a submitted (processing) expense report that has been forwarded past the first approver, the Hold option is no longer available. IOU reports and non-submitter users (admins, approvers) are unaffected.Fixed Issues
$ #83818
PROPOSAL: #83818 (comment)
Tests
Offline tests
N/A — Hold eligibility is determined from local Onyx state, no network dependency.
QA Steps
PR 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari