hide Pay X reports in Todo Task when there is no bank account connected#82743
hide Pay X reports in Todo Task when there is no bank account connected#82743mukhrr wants to merge 7 commits intoExpensify:mainfrom
Conversation
…ss checks to todos config
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.
|
|
@dominictb Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
test |
PR Review: hide Pay X reports in Todo Task when there is no bank account connectedSummaryThis PR adds VBBA (Verified Business Bank Account) gating to hide "Pay X" reports in the Todo task list when there is no connected bank account. It modifies two source files and adds comprehensive tests. Key Findings1. Broad side-effect from isPolicyPayer change (src/libs/PolicyUtils.ts:432-434)The isPolicyPayer function is a shared utility also called in SearchUIUtils.ts:875 to determine isEligibleForPaySuggestion. Adding return false when no VBBA exists means the Pay search suggestion will also be hidden for users without a VBBA -- not just the Todo items. This may be intended, but the PR description only mentions Todo tasks. Please confirm this broader behavioral change is desired. 2. Inconsistent VBBA gating logic between the two files
This means the Todo code in todos.ts adds a sharees-based fallback that isPolicyPayer does not have. If isPrimaryPayAction (called on line 67 of todos.ts) internally uses isPolicyPayer, the VBBA check in isPolicyPayer may already filter out reports before they even reach the sharees check in todos.ts. Please verify that the sharees fallback in todos.ts is actually reachable. 3. Duplicated VBBA check logicThe expression
Consider extracting a shared helper like hasVerifiedBusinessBankAccount(policy) in PolicyUtils.ts and reusing it. 4. Tests are thoroughThe new tests in OnyxDerivedTest.tsx cover:
RecommendationThe main concern is item #2 -- the inconsistency between isPolicyPayer (no sharees fallback) and todos.ts (has sharees fallback). If isPrimaryPayAction depends on isPolicyPayer, the sharees path in todos.ts may be dead code. This needs verification before merging. |
|
@eh2077 will review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73280b34fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Just to make sure I'm following, additional admins beyond the workspace payer will still be able to pay reports, as long as they have access to the workspace bank account, correct? Because we intentionally added support for that case in #78794 |
|
Yes, here we try to hide report for those who has neither bank account nor access to workspace bank account. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
@dominictb Can you assign me as reviewer, so it'll be on my k2 table? thanks 🙇 |
|
@mukhrr I think we can close this, thanks! |
Explanation of Change
Fixed Issues
$ #82207
PROPOSAL: #82207 (comment)
Tests
Verify you don't see Any report in Reports/To Do and Home tasks
Offline tests
QA Steps
The same as tests
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_native.mp4
Android: mWeb Chrome
android_mWeb.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web.mp4