-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow selfApproval when the rule feature is disabled #55386
Conversation
@mountiny In this PR, FE allows the user to self-approve if the rule feature is disabled and |
@hungvu193 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] |
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.
Thanks! I am making change in the BE https://github.com/Expensify/Web-Expensify/pull/45169 that will make sure the preventSelfApproval value is reset to false when the rules feature is turned off.
Could you please make sure to update the optimisticData
for the action that toggles the rules feature to reflect that. Can you please add unit tests for the action and for the isAllowedToApproveExpenseReport
too?
if (!policy?.areRulesEnabled) { | ||
return true; | ||
} |
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.
I have made some backend changes where this will not be needed, actually this could lead to some older reports that never enabled or disabled the feature to skip this call because the default is false
but they could have set the prevent self approval to true in OldDot
if (!policy?.areRulesEnabled) { | |
return true; | |
} | |
if (!policy?.areRulesEnabled) { | |
return true; | |
} |
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.
Oops, if we do that, doesn't that we should select TonyMK proposal?
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.
Yeah we could have, we can give TonyMK partial reward for their proposal
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.
Hey @mountiny, if there is no issue, could I raise a PR since my proposal initially addressed solving the root cause and @hungvu193 talked about this in his previous comment?
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.
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.
Ok, let me retest it 🤔
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.
Let me test in staging.
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.
@mountiny Tested in staging and it works well. cc @hungvu193 You can complete now.
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.
@mountiny Still the same, preventSelfApproval
is still true, we still need to keep this block of code
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.
@hungvu193 Did you test with the staging server? I tested and it works well.
Screen.Recording.2025-01-22.at.22.28.23.mov
Sure will give an update soon. |
@mountiny I updated the unit test. |
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.
Thank you!
if (!policy?.areRulesEnabled) { | ||
return true; | ||
} |
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.
@hungvu193 can you pleasse complete the testing and checklist? |
Sure. I'll do it today |
@hungvu193 lets please complete the checklist now, thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativentandr.movAndroid: mWeb ChromemChrome.moviOS: NativeScreen.Recording.2025-01-22.at.15.23.51.moviOS: mWeb SafarimSafari.movMacOS: Chrome / SafariChrome.movMacOS: DesktopDesktop.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.
Thank you!
@mkzie2 sorry there are conflicts |
@mountiny The fix is done. |
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.
Thanks!
✋ 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/mountiny in version: 9.0.90-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.90-6 🚀
|
Explanation of Change
Allow selfApproval when the rule feature is disabled
Fixed Issues
$ #54206
PROPOSAL: #54206 (comment)
Tests
Offline tests
Same
QA Steps
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
Screen.Recording.2025-01-17.at.13.53.06.mov
Android: mWeb Chrome
Screen.Recording.2025-01-17.at.13.48.56.mov
iOS: Native
Screen.Recording.2025-01-17.at.14.16.02.mov
iOS: mWeb Safari
Screen.Recording.2025-01-17.at.13.50.48.mov
MacOS: Chrome / Safari
Screen.Recording.2025-01-17.at.13.41.40.mov
MacOS: Desktop
Screen.Recording.2025-01-17.at.14.19.07.mov