-
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
[Advanced approvals] Add optimistic steps for advanced approvals #44940
Conversation
Co-authored-by: Alex Beaman <dabeamanator@gmail.com>
Co-authored-by: Alex Beaman <dabeamanator@gmail.com>
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.
Getting squeaky clean!!!
const approvalChain: string[] = []; | ||
|
||
// If the policy is not on advanced approval mode, we should not use the approval chain even if it exists. | ||
if (!PolicyUtils.isControlOnAdvancedApprovalMode(policy)) { |
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.
NAB - Maybe in a follow-up we can change this to only checking if the policy is not on advanced approval mode - it shouldn't matter if it's control or not (currently advanced approval is only available in control, but this "technically" could change at some point, and we'd have to update this)
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.
ohhh shoot i used an existing function. i should have asked
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.
will fix in a follow up
|
||
// If the policy is not on advanced approval mode, we should not use the approval chain even if it exists. | ||
if (!PolicyUtils.isControlOnAdvancedApprovalMode(policy)) { | ||
return approvalChain; |
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.
NAB - Eventually we should change this to return the policy's default approver in this case. But not needed at this exact moment probably since we only call this function for advanced approval policies i believe
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 here some cleanup would be fine. i didn't want the function to be used by non advanced policy otherwise we'll have to test every flow
Testing the scenarios again. I'll try my best to test atleast a couple of scenarios on mobile, but all on Web. |
quick bump @mananjadhav 🙏 |
@Beamanator good to merge. Code tests well for non-advancced approval modes too Submit and approve -Screen.Recording.2024-08-09.at.07.25.43.movSubmit and closeScreen.Recording.2024-08-09.at.07.27.56.mov |
@rushatgabhane in both of your videos, why does it look like you had to press "Submit" Twice? 😅 Am I looking at it wrong? |
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.
Approving through @mananjadhav is still testing - there's a few NABs that would be great to work through in a follow-up too
Merging so we can get this in before the next deploy (which may happen soon today) |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Okay so I just finished all for Web. I had all sorts of issues unrelated to the PR. I was unable to login, then saw the RBR on submit requests, amount showing twice in the money view, and the background overlapping with the amount rows, etc. Then cleared the cache for all sessions and it worked fine. I still saw two crashes which happen when I go offline to online, which again seems unrelated to the PR. Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safaritest-flow-1-employee-manager-miniboss_XG5X98fd.mp4test-flow-2-employee-manager-bossowner_NCvwYDK5.mp4test-flow-3-manager-miniboss_xef26Oa3.mp4test-flow-4-manager-miniboss-amt-more-than-100_LdWyXEby.mp4test-flow-5-and-6-miniboss-owner.mp4test-9-submit-and-approve_GzuYbsXQ.mp4MacOS: Desktop |
One more thing
I can still see "Waiting for xyz@gmail.com to approve expense(s)." instead of "Waiting for you..." |
not a bug explained here - #44940 (comment) |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: DesktopVideos being uploaded in this comment. |
Can someone please look at this Deploy Blocker and confirm whether it is related to these changes or not? Thanks! |
FYI I believe this was deployed to prod yesterday, from this checklist - #47219 |
Details
Fixed Issues
$ #43567
PROPOSAL:
Tests
Pre-requisites
Test 1 - Submit as Employee1 below $100
Submit as employee1
Approve as manager
Approve as mini boss
Test 2 - Submit as Employee1 above $100
Submit as employee1
Approve as manager
Approve as boss owner
Test 3 - Submit as manager - Under $100
Submit as Manager
Approve as mini owner
Test 4 - Submit as manager - OVER $100
Submit as Manager
Approve as mini owner
Test 5 - Submit as mini owner - Under $100
Submit as mini owner
Approve as boss owner
Test 6 - Submit as mini owner - Over $100
Submit as mini owner
Approve as boss owner
Test 7 -
Test the scenario -
Do a regression test for other scenarios. Turn of Advanced Approval and do regression tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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.2024-08-09.at.07.33.46.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-08-09.at.07.17.43.mov
iOS: mWeb Safari
More than approval limit
Screen.Recording.2024-08-09.at.07.22.08.mov
MacOS: Chrome / Safari
MacOS: Desktop