-
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
[C+ Checklist Needs Completion] [$500] IOU - Approve button appears while approvals is disabled #39171
Comments
Triggered auto assignment to @greg-schroeder ( |
We think this issue might be related to the #collect project. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Approve button appears even when approvals are not required What is the root cause of that problem?In Line 4500 in 4fbd218
Lines 4523 to 4524 in 4fbd218
What changes do you think we should make in order to solve the problem?Add a check in diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts
index b67e44fcf5..c361ed3e5e 100644
--- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -4519,8 +4519,10 @@ function canApproveIOU(iouReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, cha
const isOpenExpenseReport = isPolicyExpenseChat && ReportUtils.isOpenExpenseReport(iouReport);
const isApproved = ReportUtils.isReportApproved(iouReport);
const iouSettled = ReportUtils.isSettled(iouReport?.reportID);
+ const isApprovalOptional = policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL;
+ const canDelaySubmissions = policy?.autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCY.IMMEDIATE && policy?.autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCY.INSTANT;
- return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled;
+ return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !(isApprovalOptional && canDelaySubmissions);
}
What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.The approve button is still displayed even though the add approvals option is disabled. What is the root cause of that problem?We already have a condition here to not show the approve button if the approval is disabled ( Lines 4509 to 4513 in 4fbd218
However, the auto-reporting frequency needs to be instant ( What changes do you think we should make in order to solve the problem?Change the condition to accept either
Or we can remove |
Job added to Upwork: https://www.upwork.com/jobs/~014fc34bb4b2bfbb10 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
@bernhardoj's proposal looks good to me 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@bernhardoj do you know why we initially implemented it to only be disabled when |
We should not show the approve button if approvals are disabled |
@luacmartins As mentioned here
Do we want to display the Approve button if users are in approval mode and not in "Instant Submit" reporting frequency cc @Beamanator |
Agreed (I wrote that lol)
To be clear, you're asking "if users are in approval mode Submit & Close", right? I believe in that case we wouldn't want to show the "Approve" button either Because "Submit & Close" basically means: After a submitter submits a report, what next? We close the report, we don't wait for the admin to Approve it |
That makes sense, but currently, the condition expects the instant submit is on too to hide the approve button. Lines 4599 to 4601 in ebc8de8
I think it makes sense if we remove the instant submit condition because whether it's an instant or manual submit, the report will be closed immediately, right? |
I tentatively think that definitely makes sense 😅 👍 |
Discussion continues here - @stitesExpensify @Beamanator we cool with @bernhardoj's approach to solve this one? |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
PR is ready cc: @DylanDylann |
PR is being reviewed |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.15-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-08-09. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment summary: Contributor: @bernhardoj - $500 - You can make a manual request |
Please complete the checklist @DylanDylann when you're able! |
Requested in ND. |
$500 approved for @bernhardoj |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: #35470 Regression Test Proposal Prerequisite: Admin has a collect workspace and turns off the approval and sets the Delayed submission to MANUAL (or other than INSTANT)
Do we agree 👍 or 👎 |
Filed regression test, closing |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.57-2
Reproducible in staging?: Y
Reproducible in production?: Y
Found when executing PR : #38253
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Pre-requisites:
Have a collect WS and make chat enabled on ND
Have 2 accounts (one admin, one employee)
Having `Make or track payments enabled
Toggle on delay submissions on ND (Logged in as the admin)
Toggle off Add approvals
On OD Make reimbursement direct with a VBBA
Expected Result:
"Pay with expensify" button should show up since this is the case where Delay submissions is enabled and approvals is disabled
Actual Result:
"Approve" button appears on the header
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6429854_1711614962501.Screen_Recording_20240328_112744_Chrome.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @greg-schroederThe text was updated successfully, but these errors were encountered: