-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Remove the dependency on the parent report when deciding if report can be approved #47926
Remove the dependency on the parent report when deciding if report can be approved #47926
Conversation
…eport can be approved
@ 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] |
This comment has been minimized.
This comment has been minimized.
Updated to my understanding of what the text steps should be |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2024-08-28.at.5.12.38.PM.mov |
it seems like once i change approver to userB the report for Approver A becomes unaccessible RPReplay_Final1724446507.MP4 |
@ishpaul777 can you check what is the employeeList on the policy and who is the managerID on the report? |
Thats definitely odd |
@ishpaul777 I dont think these changes will work with pusher updates yet, you might have to sign out and sign back in after each change in the approval chain |
still same after sign in and out, if approver is change from user A to B, user A lost access to report and user B dont have "Approve" button |
Screen.Recording.2024-08-24.at.3.31.28.AM-1.movTotally accepting if I might be doing a step wrong somewhere 🙏 Basically the user who is approver at the time when the expense is submitted is the only one get approver button but if approver changes A to B, A lost access to report Subitter -> expense to Approver A Owner change approver to Approver A again |
So when the report is submitted and awaiting a review from Approver A, that approver should not lose access to the report when the approver is changed. This is odd, maybe there is something missing in the test steps / policy setup required to replicate the flow we hit with the contributor policy @Beamanator |
FI, i tried changing Approver role to Workspace Admin and then changing approver to other user in this case user dont lose access to report but approver button is also not working in this case Screen.Recording.2024-08-26.at.6.46.49.PM.mov |
@ishpaul777 I am not sure still sorry, this is odd. @Beamanator would you be able to help out @ishpaul777 here as you are much more fluent in this flow, I am trying to focus on workspace feeds right now to close the wave-collect |
@ishpaul777 I feel like your setup is still not exactly what @JmillsExpensify had in his policy. @JmillsExpensify might be able to help us, @ishpaul777 can you highlight how exactly does your setup look like for the policy/ settings/ approval chain |
Jumping in to try and help with the reproduction steps for this case. I think this should do it, as it's minimally how we discovered this issue:
|
Thanks @JmillsExpensify I'll try these steps.
its same as given in PR test steps:
|
@JmillsExpensify is this correct i feel user D and E submits and B and C approve?? |
@JmillsExpensify This seems true if the expense is submitted after the switch of approvers, but for expense submitted before switch, and it is still unapproved and the new Approver B of E can't see approve button, and Approver C of D can't see approve button is this expected ? |
Huh from this video: #47926 (comment)
Maybe we can pull main, create a new adhoc build, then get @garrettmknight to test this PR tomorrow to see what he gets 🙏 |
Ok here's what I'm trying:
Screen.Recording.2024-08-27.at.10.48.10.PM.mov |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Tested and confirmed that Approver A has access to the Approve button even when they've been removed from the workflow + workspace chat. |
@ishpaul777 Are you able to complete the checklist and approve the PR? Garrett confirmed that this works for our needs now internally so the pr should be good to go. Thanks! |
@cristipaval 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] |
🎯 @ishpaul777, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #48166. |
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
✋ 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/Beamanator in version: 9.0.26-1 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.26-6 🚀
|
Details
The
IOU.canApproveIOU
method relies on the parent report chat to determine if the report can be approved or not. This is a problem because approvers of expense reports might not necessarily have access to the parent report, or the parent report might not be loaded in local Onyx state, which leads to a bug whereas the approver can't see the approve button.Luckily we know all the information we need to show the button from the expense report and the policy of the report which the user should have locally.
Fixed Issues
Related to Slack thread https://expensify.slack.com/archives/C05LX9D6E07/p1724364263668779
N/A
Tests
@Beamanator can you help me with the test steps here?
isPolicyExpenseChatEnabled
istrue
submitsTo
approver AsubmitsTo
ownersubmitsTo
ownersubmitsTo
to Approver BApprove
button on the original report from aboveOffline tests
N/A
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop