fix: RBR is shown after changing mode Admin payer to member#82249
fix: RBR is shown after changing mode Admin payer to member#82249NJ-2020 wants to merge 14 commits intoExpensify:mainfrom
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@bernhardoj 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] |
|
I'll add the rest of the translations soon... |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92b3acfc36
ℹ️ 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".
| const workspaceWorkflowsPageURL = `${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)}`; | ||
| const isSMSLogin = Str.isSMSLogin(memberLogin); | ||
| const phoneNumber = getPhoneNumber(details); | ||
| const isReimburser = policy?.achAccount?.reimburser === memberLogin; |
There was a problem hiding this comment.
Gate payer role lock behind reimbursement mode
This check treats anyone in policy.achAccount.reimburser as an active payer even when payments are turned off, so role editing stays disabled in member details for former payers. In the payments toggle flow, we set reimbursementChoice to REIMBURSEMENT_NO but keep/reuse the reimburser value (WorkspaceWorkflowsPage calls setWorkspaceReimbursement with policy?.achAccount?.reimburser), so this condition can become true while no payer is actually active; the lock should also require policy.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES.
Useful? React with 👍 / 👎.
| const hasAtLeastOneNonAuditorRole = selectedEmployeesRoles.some((role) => role !== CONST.POLICY.ROLE.AUDITOR); | ||
| const hasAtLeastOneNonMemberRole = selectedEmployeesRoles.some((role) => role !== CONST.POLICY.ROLE.USER); | ||
| const hasAtLeastOneNonAdminRole = selectedEmployeesRoles.some((role) => role !== CONST.POLICY.ROLE.ADMIN); | ||
| const shouldShowChangeRoleAction = policy?.achAccount?.reimburser ? !selectedEmployees.includes(policy?.achAccount?.reimburser) : true; |
There was a problem hiding this comment.
Skip bulk role-action filtering when payments are disabled
The bulk-action guard uses policy.achAccount.reimburser alone, so selecting a former reimburser still hides make-member/make-auditor even after reimbursement is disabled. Because reimbursement mode can be REIMBURSEMENT_NO while the reimburser field remains populated, this introduces a regression where role changes are blocked in workspaces without an active payer; the condition should be scoped to active reimbursement mode before suppressing role actions.
Useful? React with 👍 / 👎.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good from a product perspective
| } | ||
|
|
||
| if (hasAtLeastOneNonMemberRole) { | ||
| options.push(memberOption); |
There was a problem hiding this comment.
This causes the option to be reordered. Let's do it like this
const hasAtLeastOnePayer = policy?.achAccount?.reimburser ? selectedEmployees.includes(policy?.achAccount?.reimburser) : false;
if (hasAtLeastOneNonMemberRole && !hasAtLeastOnePayer) {
options.push(memberOption);
}
if (hasAtLeastOneNonAdminRole) {
options.push(adminOption);
}
if (hasAtLeastOneNonAuditorRole && isControlPolicy(policy) && !hasAtLeastOnePayer) {
options.push(auditorOption);
}
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.mp4Android: mWeb Chromeandroid.mweb.mp4iOS: HybridAppios.mp4iOS: mWeb Safariios.mweb.mp4MacOS: Chrome / Safariweb.mp4 |
| member: 'Member', | ||
| auditor: 'Auditor', | ||
| role: 'Role', | ||
| roleCannotBeChanged: (workflowsLinkPage: string) => `Role can't be changed because this member is a <a href="${workflowsLinkPage}">payer</a> on this workspace.`, |
| success: 'Éxito', | ||
| auditor: 'Auditor', | ||
| role: 'Role', | ||
| roleCannotBeChanged: (workflowsLinkPage: string) => `El rol no se puede cambiar porque este miembro es un <a href="${workflowsLinkPage}">pagador</a> en este espacio de trabajo.`, |
There was a problem hiding this comment.
Have you confirmed this on Slack?
Explanation of Change
member&auditor) in the dropdown menu options on bulk selectionFixed Issues
$ #80202
PROPOSAL: #80202 (comment)
Tests
Preconditions:
Admin payermember list (member detail page)"Role can't be changed because this member is a [payer] on this workspace."Admin payerremoveoption is visibleremove&make-adminoptions is visibleOffline tests
Same as Tests
QA Steps
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
Screen.Recording.2026-02-12.at.17.45.39.mov
Android: mWeb Chrome
Screen.Recording.2026-02-11.at.14.38.30.mov
iOS: Native
Screen.Recording.2026-02-12.at.14.18.05.mov
iOS: mWeb Safari
Screen.Recording.2026-02-12.at.14.26.27.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-11.at.14.14.50.mp4