-
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
[$250] "Approve" button appears even if the report has a violation on it #50479
Comments
Triggered auto assignment to @adelekennedy ( |
Edited by proposal-police: This proposal was edited at 2024-10-08 20:05:37 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The "Approve" button appears even when the report has a violation. What is the root cause of that problem?The Lines 6905 to 6926 in fd32223
What changes do you think we should make in order to solve the problem?We should update the return statement to add a condition to check that there are no violations: return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !isArchivedReport && !hasReportViolations(iouReport?.reportID) the same change can be done in other iou actions if needed. What alternative solutions did you explore? (Optional)optionally we can use const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); Or, it can be declared as a global variable within the file, with the value fetched using |
Edited by proposal-police: This proposal was edited at 2024-10-08 20:21:18 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue."Approve" button appears even if the report has a violation on it What is the root cause of that problem?We do not check for Violations to display or disable approve button. App/src/components/ReportActionItem/ReportPreview.tsx Lines 334 to 336 in c1fa2fd
App/src/components/MoneyReportHeader.tsx Lines 126 to 128 in f30b745
What changes do you think we should make in order to solve the problem?Add violation check for approve button same as submit button here.
Append && !showRTERViolationMessage here(based of if we want to hide or disable the button)App/src/components/ReportActionItem/ReportPreview.tsx Lines 334 to 336 in c1fa2fd
And Append && !hasAllPendingRTERViolations here(based of if we want to hide or disable the button)App/src/components/MoneyReportHeader.tsx Lines 126 to 128 in f30b745
Note by using this check we would only stop approval if violationType==='RTER' same as submit button ,
What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Updated proposal |
Job added to Upwork: https://www.upwork.com/jobs/~021845657010504568512 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
Thank you for your proposals, everyone. I think @abzokhattab's proposal looks good to me. Both proposals pointed out root cause exactly, but @abzokhattab's solution (alternative) avoids repeat condition check violations (DRY) Link to proposal #50479 (comment) 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@hoangzinh I agree we could make changes to |
It's a good call. I will let @Gonals decide on it but in my opinion, because we haven't had an issue with the "submit" button so I think it's fine with the current violation checking for that button 👀 (I'm unsure besides RTERViolation, do we have any violations that can occur before a requester submit an expense) |
Agreed 👍 |
📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
One more point I missed to inform - the date violation shown in video does not fall under RTERViolations. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-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-12-05. 🎊 For reference, here are some details about the assignees on this issue:
|
@hoangzinh @adelekennedy @hoangzinh The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.68-7 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-12-07. 🎊 For reference, here are some details about the assignees on this issue:
|
@hoangzinh @adelekennedy @hoangzinh The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
@hoangzinh, @Gonals, @abzokhattab, @adelekennedy Huh... This is 4 days overdue. Who can take care of this? |
I think we want to close here - but payment is still due |
Agree @adelekennedy |
Upwork payments made - 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: 9.0.46-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @coleaeason
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1728406913463479
Action Performed:
Expected Result:
Should not see a "approve" button since receipt has a violation
Actual Result:
"Approve" button with GBR appears
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @adelekennedyThe text was updated successfully, but these errors were encountered: