Closed m-natarajan closed 1 month ago
Triggered auto assignment to @OfstadC (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Approval
option is displayed for admin when Add approvals
is toggled to off in Workflows
We show approve button when shouldHidePaymentOptions
and shouldShowApproveButton
are true
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/components/SettlementButton.tsx#L187-L188
shouldHidePaymentOptions
is true when shouldShowPayButton
is false
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/components/ReportActionItem/ReportPreview.tsx#L440
shouldShowPayButton
is false
when canIOUBePaid
is false
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/components/ReportActionItem/ReportPreview.tsx#L280
canIOUBePaid
is false
when shouldBeApproved
(or canApproveIOU
) is true
among other conditions
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/libs/actions/IOU.ts#L6441-L6444
canApproveIOU
should be false
for submit and close policies
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/libs/actions/IOU.ts#L6383-L6386
but this checks for isOnInstantSubmitPolicy
as well and this returns false
and it falls to later conditions and returns true
.
The isOnInstantSubmitPolicy
check is for submitters and should be irrelevant to checking canApproveIOU
.
isSubmitAndClose
checks for the optional approval here
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/libs/PolicyUtils.ts#L370
so that check alone should be here.
Remove the isOnInstantSubmitPolicy
check here
https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/libs/actions/IOU.ts#L6383-L6385
Looks like this is the same as https://github.com/Expensify/App/issues/39171
Going to close since this is a duplicate
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when validating https://github.com/Expensify/App/pull/45568 Version Number: 9.0.10-2 Reproducible in staging?: y Reproducible in production?: n 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: Applause internal team Slack conversation:
Action Performed:
Precondition:
Expected Result:
Since "Add approvals" is disabled, Approve button should not show up for Admin.
Actual Result:
Approve button shows up for Admin when "Add approvals" is disabled. Error shows up when trying to approve the report.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/d6c203fc-7b45-4885-a623-ea17821223ab
View all open jobs on GitHub