-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent self approvals #55740
Prevent self approvals #55740
Conversation
Spanish translation review requested here. |
🚧 @lakchote has triggered a test build. You can view the workflow run here. |
@dannymcclain @alitoshmatov One of you needs to 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] |
This comment has been minimized.
This comment has been minimized.
@trjExpensify @JmillsExpensify @dannymcclain you can test it out here 👆 |
Do we need to add a test to the QA steps to cover the existing submitted report case? I take it we want to handle this like any other approval workflow change after a report has already been submitted? Existing submitted report
|
@lakchote Can you resolve the conflicts |
The changes look good. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativepsa-android.movAndroid: mWeb Chromepsa-mweb.mp4iOS: Nativepsa-ios.mp4iOS: mWeb Safaripsa-safari.mp4MacOS: Chrome / Safaripsa-web.movMacOS: Desktoppsa-desktop.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@MarioExpensify 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] |
Nice!! I'll review this later today / early tomorrow. Thank you 😄 |
@MarioExpensify if you could review this today that'd be great! |
@lakchote Yep, I'm on it right now. Can you please merge main? It seems there are conflicts 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, let's get the conflict solved so we can merge! Thank you
The conflicts are going to be fun to handle. I'll report back when you can merge 😅 |
@MarioExpensify ready for review again! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Explanation of Change
Implement the "Prevent Self-Approvals" mechanism in NewDot.
Video test
Screen.Recording.2025-01-27.at.09.53.31.mov
Fixed Issues
$ #53799
Tests
Prerequisites:
1. Basic Flow (No self approvers)
Expected result:
The toggle should turn on without any modal or warnings (because no one is self-approving in this scenario).
2. Verify Modal Trigger When a Member is Their Own Approver
Expected result: a modal appears because User B is self-approving.
This modal says “Any members currently approving their own expenses will be removed and replaced with the default approver for this workspace ({defaultWorkspaceOwnerEmail}).".
{defaultWorkspaceOwnerEmail}
should be replaced by the default workspace approver/owner.6. Confirm the modal, the toggle should be ON.
7. Go to Workflows.
Expected results:
The workflow where user B was self approving should have been removed.
The workflow that remains should be the default one where all workspace members submits to the workspace approver.
3. Workspace with several members become a workspace with only one member
Prerequisite: having a workspace with
Prevent self approvals
enabledPrevent self approvals
got disabledPrevent self approvals
got disabled4. Check we can't enable the feature if there's only one user (the workspace owner)
5. Check Spanish Translations
“Any members currently approving their own expenses will be removed and replaced with the default approver for this workspace ({defaultWorkspaceOwnerEmail})."
Offline tests
Settings > Troubleshoot > Force offline
QA Steps
Same as in tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-01-27.at.09.53.31.mov
MacOS: Desktop