Skip to content

[HOLD for payment 2024-12-20] Search - Submit button is not disabled in Search when "Prevent self-approvals" is enabled #53989

Closed

Description

@IuliiaHerets

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.75-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+kh1311020@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Search

Action Performed:

Precondition:

  • Delayed submission is enabled.
  • Admin is the approver.
  • "Prevent self-approvals" is enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense.
  4. Note that Submit button is disabled.
  5. Go to Search.
  6. Click Submit button on the same expense in Step 3.

Expected Result:

Submit button should also be disabled in Search when "Prevent self-approvals" is enabled.

Actual Result:

Submit button is not disabled in Search when "Prevent self-approvals" is enabled.
User can still submit expenses in Search.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6691772_1733977172282.20241212_121613.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @sakluger

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 12, 2024
  2. melvin-bot commented on Dec 12, 2024

    @melvin-bot

    Triggered auto assignment to @mjasikowski (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Dec 12, 2024

    @melvin-bot

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

  4. melvin-bot commented on Dec 12, 2024

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Dec 12, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. IuliiaHerets commented on Dec 12, 2024

    @IuliiaHerets
    Author

    Not repro on production

    bandicam.2024-12-12.06-31-56-649.mp4
  7. mjasikowski commented on Dec 12, 2024

    @mjasikowski
    Contributor

    Looking into it

  8. daledah commented on Dec 12, 2024

    @daledah
    Contributor

    Proposal

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

    Submit button is not disabled in Search when "Prevent self-approvals" is enabled.
    User can still submit expenses in Search.

    What is the root cause of that problem?

    We only disabled the button while offline

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

    1. Add new props isDisabledButton to ActionCell component
       isDisabled={isOffline || isDisabledButton}
    
    1. Change the background color while the button is disabled in getButtonInnerStyles function

    const getButtonInnerStyles = useCallback(
    (shouldUseSuccessStyle: boolean) => {
    if (!isSelected) {
    return {};
    }
    return shouldUseSuccessStyle ? styles.buttonSuccessHovered : styles.buttonDefaultHovered;
    },
    [isSelected, styles],

    1. Calculate isDisabledButton from TransactionListItemRow and pass it to ExpenseItemHeaderNarrow -> ActionCell
        const report = ReportUtils.getReport(item.reportID);
        const isDisabledButton = !ReportUtils.isAllowedToSubmitDraftExpenseReport(report);
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

    Like we did in MoneyReportHeader here, we can add new props shouldShowButton and add new variable shouldShowSubmitButton in TransactionListItemRow

    const shouldShowSubmitButton =
    !!moneyRequestReport &&
    isDraft &&
    reimbursableSpend !== 0 &&
    !hasAllPendingRTERViolations &&
    !shouldShowBrokenConnectionViolation &&
    (moneyRequestReport?.ownerAccountID === currentUserAccountID || isAdmin || moneyRequestReport?.managerID === currentUserAccountID);

    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.

  9. 20 remaining items

  10. melvin-bot commented on Dec 20, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@sakluger)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  11. allgandalf commented on Dec 23, 2024

    @allgandalf
    Contributor

    ♻️ Pending payment...

  12. melvin-bot commented on Dec 23, 2024

    @melvin-bot

    @mjasikowski, @sakluger, @luacmartins, @allgandalf Whoops! This issue is 2 days overdue. Let's get this updated quick!

  13. allgandalf commented on Dec 24, 2024

    @allgandalf
    Contributor

    Checklist ✅ ♻️ Pending payment...

  14. sakluger commented on Dec 24, 2024

    @sakluger
    Contributor

    Sorry @allgandalf for the delay, I was OOO the past few days due to holiday travel.

    Here's the Upwork contract: https://www.upwork.com/nx/wm/offer/105455673. Please let me know once you've accepted the contract and I will complete payment. Thanks!

  15. allgandalf commented on Dec 25, 2024

    @allgandalf
    Contributor

    Accepted, thank you so much 😄 and happy holidays 🎁 🎄

  16. sakluger commented on Dec 27, 2024

    @sakluger
    Contributor

    All paid, thanks again!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions