Skip to content

[$250] Workspace - No Approve button for policy admin after expense submit #46227

Closed

Description

@lanitochka17

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.12-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A

Issue found when executing PR #45867

Action Performed:

Preconditions: user has Control policy. Owner is an approver. Workspace is connected to QBO.

  1. Go to workspace chat
  2. Click '+' > Submit expense.
  3. Click on expense preview
  4. Click Submit

Expected Result:

There is an Approve button appears in expense report after Submit

Actual Result:

No Approve button appears in expense report

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6552949_1721931572723.Approve_hidden.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016dcbec225a5081d4
  • Upwork Job ID: 1816601615703698448
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • eh2077 | Reviewer | 103440897
Issue OwnerCurrent Issue Owner: @lschurr

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 25, 2024
  2. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    Triggered auto assignment to @lschurr (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.

  3. lanitochka17 commented on Jul 25, 2024

    @lanitochka17
    Author

    @lschurr FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 25, 2024
  5. changed the title [-]Workspace - No Approve button for policy admin after expense submit[/-] [+][$250] Workspace - No Approve button for policy admin after expense submit[/+] on Jul 25, 2024
  6. melvin-bot commented on Jul 25, 2024

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 25, 2024
  8. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

  9. NJ-2020 commented on Jul 26, 2024

    @NJ-2020
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    No Approve button for policy admin after expense submit

    What is the root cause of that problem?

    Right here:

    const shouldShowSettlementButton = (shouldShowPayButton || shouldShowApproveButton) && !allHavePendingRTERViolation && !shouldShowExportIntegrationButton;

    We'll only show the approve button if we do not have an export integration button (which also means we're not connected to any integration)

    So the shouldShowSettlementButton returns false and does not show the approve button

    {shouldShowSettlementButton && !shouldUseNarrowLayout && (

    What changes do you think we should make in order to solve the problem?

    We can delete this code !shouldShowExportIntegrationButton which will show the approve button if we also have an export integration button.

    What alternative solutions did you explore? (Optional)

  10. daledah commented on Jul 27, 2024

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    No Approve button appears in expense report

    What is the root cause of that problem?

    This is the logic for the correct states of the expense report which can be exported

    const isCorrectState = [CONST.REPORT.STATUS_NUM.APPROVED, CONST.REPORT.STATUS_NUM.CLOSED, CONST.REPORT.STATUS_NUM.REIMBURSED].some((status) => status === report.statusNum);

    As it shows, only reports that are approved/reimbursed or closed can be exported.

    However, the code for shouldShowExportIntegrationButton in

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;
    and
    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;

    Are not checking that condition.

    What changes do you think we should make in order to solve the problem?

    Update

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;
    to

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && ReportUtils.canBeExported(moneyRequestReport);
    

    Likewise for

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;

    !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && ReportUtils.canBeExported(iouReport)
    

    The !shouldShowPayButton && !shouldShowSubmitButton can potentially be removed because they should already be covered in ReportUtils.canBeExported(iouReport)

    What alternative solutions did you explore? (Optional)

    In both locations

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;
    and
    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin;

    Add !shouldShowApproveButton so if approve button will show, the export button will not show. However there could be cases that export button is shown but disabled as the report still doesn't meet the condition in
    function canBeExported(report: OnyxEntry<Report>) {
    . This could be confusing to the user so it's best to add a tooltip like The IOU report can only be exported after it's approved, reimbursed or closed to the disabled export button to clarify to the user why it's disabled.

  11. eh2077 commented on Jul 29, 2024

    @eh2077
    Contributor

    Reviewing proposals. This issue is subtle and I'll need more time to understand it.

  12. melvin-bot commented on Aug 1, 2024

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  13. 17 remaining items

  14. daledah commented on Aug 8, 2024

    @daledah
    Contributor

    @eh2077 this PR is ready for review

  15. melvin-bot commented on Sep 2, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @jasperhuangg, @lschurr, @eh2077, @daledah eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  16. jasperhuangg commented on Sep 26, 2024

    @jasperhuangg
    Contributor

    I think our automation was broken for a while. This was deployed to production a while ago without any regressions.

    @lschurr Do you mind paying out @daledah for implementing the solution to this issue and @eh2077 for reviewing proposals/PRs? I think we can safely close out this issue after that.

  17. lschurr commented on Oct 1, 2024

    @lschurr
    Contributor

    Yep! Payment summary:

  18. daledah commented on Oct 5, 2024

    @daledah
    Contributor

    Contributor: $250 @daledah - Can you link your Upwork profile here?

    @lschurr Here it is https://www.upwork.com/freelancers/~0138d999529f34d33f

  19. lschurr commented on Oct 7, 2024

    @lschurr
    Contributor
  20. daledah commented on Oct 7, 2024

    @daledah
    Contributor

    Offer accepted thx @lschurr

  21. lschurr commented on Oct 7, 2024

    @lschurr
    Contributor

    Great, all set!

  22. eh2077 commented on Oct 10, 2024

    @eh2077
    Contributor

    Requested in newdot

  23. JmillsExpensify commented on Oct 11, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions