Skip to content

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

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

Closed
5 of 8 tasks
IuliiaHerets opened this issue Dec 12, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected]
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
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

Copy link

melvin-bot bot commented Dec 12, 2024

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.

Copy link

melvin-bot bot commented Dec 12, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 12, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 12, 2024
Copy link
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.

@IuliiaHerets
Copy link
Author

Not repro on production

bandicam.2024-12-12.06-31-56-649.mp4

@mjasikowski
Copy link
Contributor

Looking into it

@daledah
Copy link
Contributor

daledah commented Dec 12, 2024

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.

@mjasikowski
Copy link
Contributor

mjasikowski commented Dec 12, 2024

Discussing the expected behavior on Slack

@mjasikowski
Copy link
Contributor

In the meantime I have a draft PR to replicate the behavior from report previews if we agree to follow that: https://github.com/Expensify/App/pull/54012/files

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Dec 12, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 12, 2024
@luacmartins
Copy link
Contributor

Fixed in staging

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Dec 12, 2024
@luacmartins luacmartins self-assigned this Dec 12, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Dec 13, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Dec 13, 2024
@melvin-bot melvin-bot bot changed the title Search - Submit button is not disabled in Search when "Prevent self-approvals" is enabled [HOLD for payment 2024-12-20] Search - Submit button is not disabled in Search when "Prevent self-approvals" is enabled Dec 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Dec 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 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-20. 🎊

For reference, here are some details about the assignees on this issue:

  • @allgandalf requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 13, 2024

@allgandalf @sakluger @allgandalf 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]

@allgandalf
Copy link
Contributor

allgandalf commented Dec 15, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: N/A This was a regression

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

No regression test, the original PR should cover the tests

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 20, 2024
Copy link

melvin-bot bot commented Dec 20, 2024

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

@allgandalf
Copy link
Contributor

♻️ Pending payment...

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

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

@allgandalf
Copy link
Contributor

Checklist ✅ ♻️ Pending payment...

@sakluger
Copy link
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!

@melvin-bot melvin-bot bot removed the Overdue label Dec 24, 2024
@allgandalf
Copy link
Contributor

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

@melvin-bot melvin-bot bot added the Overdue label Dec 27, 2024
@sakluger
Copy link
Contributor

All paid, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

6 participants