Filter Expensify team members from approval workflows table#83366
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
eh2077
left a comment
There was a problem hiding this comment.
Looks good overall, can you add unit tests to cover changes please?
| // Determine if we should filter Expensify team members (only for non-Expensify customers) | ||
| const shouldFilterExpensifyTeam = !!policyOwner && !!currentUserLogin && !isExpensifyTeam(policyOwner) && !isExpensifyTeam(currentUserLogin); |
There was a problem hiding this comment.
I think this condition intents to filter out Expensify team members, so please update the comment and rename to variable to shouldFilterOutExpensifyTeam
trjExpensify
left a comment
There was a problem hiding this comment.
- Create a workspace owned by a non-Expensify email
- Add an Expensify team member (e.g., an @expensify.com email) to the workspace
- Configure the Expensify team member as an approver in a workflow
- Navigate to Workspace > Workflows
- Verify the Expensify team member does not appear in the workflows table (not as a member or approver)
- Click "Add Approval Workflow"
- Verify the Expensify team member does not appear in the menu
The tests don't make sense. How can you do step 3?
|
Right, updated @trjExpensify |
|
@MobileMage bump on #83366 (review), thanks! |
|
@eh2077 done |
|
Can you also add unit tests? |
|
Added @eh2077 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-04-16.at.9.17.03.PM.movAndroid: mWeb ChromeScreen.Recording.2026-04-16.at.9.13.48.PM.moviOS: HybridAppScreen.Recording.2026-04-16.at.9.11.04.PM.moviOS: mWeb SafariScreen.Recording.2026-04-16.at.9.12.28.PM.movMacOS: Chrome / SafariScreen.Recording.2026-04-16.at.9.07.52.PM.mov |
|
@MobileMage I can still select an Expensify team (fake) member when adding a new workflow Screen.Recording.2026-03-13.at.9.46.29.PM.mov |
|
Looking into it now |
|
@eh2077 that's odd, can't seem to reproduce Are you sure you've got the right branch? |
|
@MobileMage Let me recheck, can you help merge main? thanks! |
|
@MobileMage friendly bump |
|
@MobileMage friendly bump! |
…ows-table # Conflicts: # src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
|
done |
|
It seems like a bug: still able to select an Expensify team member as approver. Screen.Recording.2026-03-27.at.7.55.41.PM.mov@trjExpensify Wdyt? |
|
Agreed, it does. |
|
@MobileMage bump on #83366 (comment) |
|
@MobileMage Friendly bump! |
…ows-table # Conflicts: # src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx # src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsOverLimitApproverPage.tsx
|
I've made the fix @eh2077 |
|
thanks! I'll recheck soon. |
| // Hide internal Expensify team members (SRAMs/guides) from non-Expensify customers, matching the workflows table filtering. | ||
| const shouldFilterOutExpensifyTeam = !!policy?.owner && !!currentUserPersonalDetails?.login && !isExpensifyTeam(policy.owner) && !isExpensifyTeam(currentUserPersonalDetails.login); |
There was a problem hiding this comment.
To follow DRY principle, I think we can move this logic to a method in src/libs/PolicyUtils.ts, wdyt?
|
@MobileMage Thanks for the update! Can you also resolve conflicts? |
Resolve conflicts: keep both pendingAction DELETE guards from main and Expensify team filtering from this branch.
|
fixed @eh2077 |
| * Find the first non-Expensify team member in the approval chain. | ||
| * Used to skip internal Expensify approvers when displaying workflows to customers. | ||
| * Returns undefined if no non-Expensify approver is found in the chain. |
There was a problem hiding this comment.
NAB - I'd clarify that the startEmail should be the first-level approver of a report (the submitsTo of the submitter), otherwise it's potentially misleading.
Tom's comments have been addressed
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @francoisl has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/francoisl in version: 9.3.61-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The changes filter internal Expensify team members (SRAMs/guides) from the approval workflows UI for external customers. This is a transparent, behind-the-scenes behavioral change — external users simply won't see internal team members they shouldn't see. The relevant help articles (Add Approvals, Workspace Workflows) describe how to configure approval workflows (steps, navigation, options) and don't reference which members appear in selection lists. No user-facing steps, settings, terminology, or navigation paths changed. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.3.61-4 🚀
|

Explanation of Change
Filters internal Expensify team members (SRAMs/guides with @expensify.com or @team.expensify.com emails) from the approval workflows table in Workspace Workflows. This matches the existing filtering behavior already implemented in WorkspaceMembersPage.
Changes in
WorkflowUtils.ts:currentUserLoginparam toconvertPolicyEmployeesToApprovalWorkflowssubmitsTopoints to an Expensify team member, the workflow redirects to the first non-Expensify approver in theforwardsTochainUpdated all three call sites to pass
currentUserLogin:WorkspaceWorkflowsPage.tsxWorkspaceWorkflowsApprovalsEditPage.tsxWorkspaceMemberDetailsPage.tsxFixed Issues
$ #80744
PROPOSAL: #80744 (comment)
Tests
Offline tests
N/A - The filtering logic runs client-side and does not depend on network state.
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
Kapture.2026-03-09.at.17.56.29.mp4