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

Prevent Self-Approval: Fix Unexpected Behavior for Historical Workspaces and Update Existing Approvers #53799

Open
marcaaron opened this issue Dec 9, 2024 · 21 comments
Assignees
Labels
Design Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2

Comments

@marcaaron
Copy link
Contributor

cc @JmillsExpensify coming from our DM

While we have the ability to set "Prevent self approval" on a workspace. There are some ways in which this feature works unexpectedly in NewDot. Specifically, the following scenario is possible and should not be:

Historical workspace behavior

Problem

  • User has historical workspaces with themselves already set as the approver.
  • Self approval is then enabled.
  • What should we do after that? They should not be able to approve their own expenses, but we need some way to "fix" the reports currently submitted to themselves.

Solution

  • Create a modal that warns the user that any users who are currently approving their own reports will be removed as the manager.
  • Set the approver back to the "default approver" as shown here:

image

@marcaaron marcaaron added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Design labels Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

Triggered auto assignment to @dannymcclain (Design), see these Stack Overflow questions for more details.

Copy link

melvin-bot bot commented Dec 9, 2024

Triggered auto assignment to @VictoriaExpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Dec 9, 2024
@marcaaron
Copy link
Contributor Author

Specifically we need design help on:

Create a modal that warns the user that any users who are currently approving their own reports will be removed as the manager.

@marcaaron marcaaron added the Hot Pick Ready for an engineer to pick up and run with label Dec 9, 2024
@dannymcclain
Copy link
Contributor

@marcaaron when will this modal show?

@flaviadefaria flaviadefaria moved this to First Cohort - MEDIUM or LOW in [#whatsnext] #migrate Dec 10, 2024
@marcaaron
Copy link
Contributor Author

QA steps would be something like:

  1. As User A enable Rules on a workspace
  2. Invite User B
  3. In Workflows create a rule for User B that has them set as their own approver
    Screenshot 2024-12-11 at 12 34 40 PM
  4. In Rules select the Prevent Self Approvals option
    Screenshot 2024-12-11 at 12 34 54 PM
  5. Modal is triggered since now User B can't be their own approver. We will be setting their approver to the default approver if the modal is "confirmed".

@dannymcclain
Copy link
Contributor

Perfect! Thank you.

@dannymcclain

This comment was marked as outdated.

@shawnborton
Copy link
Contributor

Yeah, I tend to agree - just a simple, matter-of-fact dialog seems appropriate.

@dannymcclain
Copy link
Contributor

And actually, I just realized I did this one wrong. I think it should actually be like this:
image

Where we give you the warning and the choice. @shawnborton @dubielzyk-expensify, the question is, should this button be danger?

@shawnborton
Copy link
Contributor

Hmm I could go either way honestly. What do you think? It doesn't feel quite serious enough to warrant a danger button but I can see why the logic would check out to do so if that's what we decide.

@dannymcclain
Copy link
Contributor

Yeah I feel the same way. Let's make @dubielzyk-expensify weigh in! :gavel:

@dubielzyk-expensify
Copy link
Contributor

Yeah, I'm with ya. Don't feel strongly. Danger button seems perhaps a bit too harsh for what it is. cc @jamesdeanexpensify for copy!?

@dannymcclain
Copy link
Contributor

I think we can go with the green button for this one—even if some workflows are reset to the default approver, no information or anything is actually being destroyed. Nothing is going to stop working. So I agree with Jon the the danger button feels too harsh.

@jamesdeanexpensify
Copy link
Contributor

Slight tweaks!

Prevent self-approvals?
Any members currently approving their own expenses will be replaced with the default approver for this workspace (email/phone).

@dannymcclain
Copy link
Contributor

Update mocks based on new copy from James!

image

@dubielzyk-expensify
Copy link
Contributor

dubielzyk-expensify commented Dec 16, 2024

Looking good, McClain!

@trjExpensify
Copy link
Contributor

👋 I think I have a few questions about this. But maybe to start, it would be helpful if someone could list out the numbered steps of the proposed solution in full? Are the QA steps here the extent of the proposal, or is there more to it?

Thanks!

@JmillsExpensify
Copy link

Also I have a question: How are we handling the case where someone enables this feature, they submit reports, and they are the default approver for the workspace? I would imagine we need to create a special approval workflow for that case, right? Asking because I ran across this case in a #migrate thread.

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
@dannymcclain
Copy link
Contributor

Any update on this one? Do we have clear next steps to move this along?

@melvin-bot melvin-bot bot removed the Overdue label Jan 6, 2025
@JmillsExpensify
Copy link

Btw, we need to find someone to pick this now that Marc is on leave.

@JmillsExpensify
Copy link

Still need to find a volunteer. This is being highlighted as a hot pick in the weekly update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: First Cohort - MEDIUM or LOW
Development

No branches or pull requests

8 participants