Fix approval workflow member selection to include all workspace members#82841
Fix approval workflow member selection to include all workspace members#82841
Conversation
Available members were incorrectly limited to only the default workflow in ADVANCED mode, excluding members in custom workflows (e.g., Alex/Hannah who submit to Carolyn). Now includes all workspace members from employeeList. Fixes Expensify/Expensify#598876 Co-authored-by: Cursor <cursoragent@cursor.com>
|
@ikevin127 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] |
|
Addressed by extracting |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@codex review |
|
@ikevin127 can you please review & test? 🙏 |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-02-18.at.16.33.40.mov |
|
@Beamanator 🟢 Completed PR Reviewer Checklist, everything looks good except for the 2 comments - let me know what you think then I can approve based on feedback 🙌 |
…alWorkflowCreation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the review @ikevin127 ! Back to you! |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM - Thanks for the changes!
|
🎯 @ikevin127, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #83003. |
dangrous
left a comment
There was a problem hiding this comment.
Seems fine except - did we mean to push changes to Mobile-Expensify? I haven't seen that on a PR before.
|
Oh yeah okay it's conflicts now, let's update that |
dangrous
left a comment
There was a problem hiding this comment.
Fix Mobile Expensify issues
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hah good call @dangrous - it's pretty common in some PRs but not these 😬 I saw it when I was fixing other conflicts, not sure what happened! But we're good here now! |
…alWorkflowCreation
|
hopefully pulling main will fix the remote rock build 🤷 |
dangrous
left a comment
There was a problem hiding this comment.
Fix Mobile Expensify issues
|
lol why did that duplicate my comment from before as my approval |
|
🚧 @dangrous 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.3.25-0 🚀
|
Explanation of Change
The "Expenses from" page for approval workflows was not showing all workspace members. In ADVANCED approval mode,
availableMemberswas derived only from the first (default) workflow, so members in custom workflows (e.g., Alex/Hannah who submit to Carolyn) were excluded from the selection list.This change updates
convertPolicyEmployeesToApprovalWorkflowsto buildavailableMembersfrom all workspace members inemployeeList, ensuring every member can be assigned to a workflow when configuring "Expenses from."EmployeeList where my expensifail has a nonexistent submitsTo:
EmployeeList where submitsTo is fine:
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/598876
PROPOSAL: N/A (direct fix)
Tests
npm test -- tests/unit/WorkflowUtilsTest.ts— all tests pass including tests for availableMembers (custom workflows and orphaned submitsTo)policyIDandtargetEmailwith your policy ID and a member email fromObject.keys(policy?.employeeList || {}):Then go to Add approval workflow → Expenses from and verify the member appears (with the fix). Refresh to restore data.
Offline tests
N/A — member list is derived from cached policy data.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.mdwere 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
