Show For you approval to-dos for manually forwarded admins#95633
Show For you approval to-dos for manually forwarded admins#95633ishpaul777 wants to merge 3 commits into
Conversation
Surface the approve suggested search for workspace admins even when they are not part of the approval workflow, so reports manually forwarded to them appear under Home > For you and the Spend "Needs approval" view.
Build the test policies via createRandomPolicy instead of unsafe type assertions so the file stays within the eslint no-unsafe-type-assertion seatbelt.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
@ishpaul777 I am unable to reproduce the customer's issue where Below is a test video for this. What am I missing here in the reproduction steps? Or did I misunderstand the term 95633-manual-forward-001.mp4 |
Explanation of Change
The Home > For you section is populated by
useTodoCounts, which classifies whatever reports are already in live Onyx. Those reports only get hydrated on the Home page whenuseYourSpendDatafires the corresponding suggested search, and the Approve search only fires whengetSuggestedSearchesVisibilitymarks it visible.The approve visibility gate (
isEligibleForApproveSuggestion) was purely workflow-based:A workspace admin who is manually forwarded a report (outside the approval workflow) is neither
isApprovernor asubmitsTo/forwardsTotarget, so the Approve search never fired, the report was never loaded into Onyx, and nothing showed under For you (or the Spend "Needs approval" view). Under workflow enforcement only an admin can manually forward/reassign an approver, so this exclusively affects admins.Fix: extend the gate to also surface the Approve suggestion for admins. The Approve query itself is still scoped to reports where
managerIDis the current user, so admins with nothing to approve see no tile (the For you tile is count-gated byuseTodoCounts).Fixed Issues
$ https://github.com/Expensify/Expensify/issues/657176
PROPOSAL:
Tests
Important: log out. Log in as Outsider Admin on afresh session. Go toHomefirst. Donotopen the report from chat/search before checking Home.
Offline tests
This is a client-side visibility change with no offline-specific behavior. Suggested searches are computed from already-synced policy data, so results match the online behavior once policies are cached.
QA Steps
Same as Tests above.
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