Skip to content
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

[HOLD for payment 2024-03-29] [$250] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag #38445

Closed
mountiny opened this issue Mar 16, 2024 · 17 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 External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff

Comments

@mountiny
Copy link
Contributor

mountiny commented Mar 16, 2024

Problem

We use the isAutoApprovalEnabled flag to decide if the approval toggle should be on or off in Workflows page

isActive: policy?.isAutoApprovalEnabled ?? false,

We should however use a comparison to the policy.approvalMode as we do here to define if the auto approval is enabled. It is true when the approval mode is set to basic.

The isAutoApprovalEnabled property is not passed from the backend, it should be removed for now.

This property exists, but its used in different way and we can bring it to the app later.

Solution

Use the approvalMode property to determine the toggle state

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01573ee41af24d66fa
  • Upwork Job ID: 1769144226309750784
  • Last Price Increase: 2024-03-19
Issue OwnerCurrent Issue Owner: @slafortune
@mountiny mountiny added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff labels Mar 16, 2024
@mountiny mountiny self-assigned this Mar 16, 2024
Copy link

melvin-bot bot commented Mar 16, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01573ee41af24d66fa

Copy link

melvin-bot bot commented Mar 16, 2024

Triggered auto assignment to Contributor Plus for review of internal employee PR - @hoangzinh (Internal)

@mountiny mountiny moved this to Release 1: Spring 2024 (May) in [#whatsnext] #wave-collect Mar 16, 2024
@abzokhattab
Copy link
Contributor

Proposal

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

Clean up the isAutoApprovalEnabled flag

What is the root cause of that problem?

We use the isAutoApprovalEnabled flag to decide if the approval toggle should be on or off in the Workflows page

isActive: policy?.isAutoApprovalEnabled ?? false,

however this flag is not needed anymore since its value is not coming from the backend. We should however use a comparison to the policy.approvalMode as we do here to define if the auto approval is enabled.

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

  1. we need to remove this line, this, and this
  2. change the isAutoApprovalEnabled to approvalMode here, here, and here
  3. in WorkspaceWorkflowsPage change the pending action to policy?.pendingFields?.approvalMode instead. and change the isActive condition to:
isActive: policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.BASIC,

POC

Screen.Recording.2024-03-17.at.2.35.11.AM.mov

@trjExpensify
Copy link
Contributor

@mountiny confirming we're not looking for volunteers here and we're done?

@mountiny
Copy link
Contributor Author

We are not, @abzokhattab sorry, I marked this as internal as there might be some changes required in the backend, I will handle this one

@abzokhattab
Copy link
Contributor

No problem, @mountiny go ahead

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 18, 2024
@mountiny
Copy link
Contributor Author

PR is in review

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Mar 19, 2024
@melvin-bot melvin-bot bot changed the title [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag [$500] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag Mar 19, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

Current assignee @hoangzinh is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 19, 2024
@mountiny mountiny changed the title [$500] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag [$250] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

Upwork job price has been updated to $250

@mountiny mountiny removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 19, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 22, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag [HOLD for payment 2024-03-29] [$250] [Wave Collect] [Workflows] Clean up the isAutoApprovalEnabled flag Mar 22, 2024
Copy link

melvin-bot bot commented Mar 22, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 22, 2024
Copy link

melvin-bot bot commented Mar 22, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.55-3 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-03-29. 🎊

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

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

@mountiny mountiny added the Bug Something is broken. Auto assigns a BugZero manager. label Mar 27, 2024
Copy link

melvin-bot bot commented Mar 27, 2024

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 27, 2024
@mountiny
Copy link
Contributor Author

$250 to @hoangzinh for this this one

@mountiny
Copy link
Contributor Author

No need for the checklist here

@slafortune
Copy link
Contributor

Invite sent here @hoangzinh

@hoangzinh
Copy link
Contributor

Accepted. Thanks @slafortune

@slafortune
Copy link
Contributor

Paid

@github-project-automation github-project-automation bot moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #wave-collect Mar 29, 2024
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 External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants