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

[$250] Error message displayed as policy instead of workspace #51930

Closed
1 of 8 tasks
m-natarajan opened this issue Nov 2, 2024 · 13 comments
Closed
1 of 8 tasks

[$250] Error message displayed as policy instead of workspace #51930

m-natarajan opened this issue Nov 2, 2024 · 13 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 2, 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.56-7
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation (hyperlinked to channel name): #expensify-bugs

Action Performed:

Prerequisite:

  • Create a group in a domain
  • Add a member to the group
  • Restrict workspace creation for the group
  1. Login as a member of a restricted group
  2. Click settings > Click +workspace

image

Expected Result:

Error message displayed regarding restriction for workspace creation

Actual Result:

Error message displayed as Your admin has restricted your group from creating new policies

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

image

Screenshot 2024-11-02 173011

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021853514819272851093
  • Upwork Job ID: 1853514819272851093
  • Last Price Increase: 2024-11-16
Issue OwnerCurrent Issue Owner: @garrettmknight
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 2, 2024
Copy link

melvin-bot bot commented Nov 2, 2024

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

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Nov 4, 2024
@melvin-bot melvin-bot bot changed the title Error message displayed as policy instead of workspace [$250] Error message displayed as policy instead of workspace Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

@ikevin127
Copy link
Contributor

Proposal

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

Error message displayed as Your admin has restricted your group from creating new policies.

What is the root cause of that problem?

Note: I was able to reproduce the issue by adding a custom domain (that I own) via OD as instructed in the documentation here -> Claim And Verify A Domain.

The error message Your admin has restricted your group from creating new policies. shown on the domain member's group side comes from the BE (see below) when the CreateWorkspace API call fails due to the Restrict expense workspace creation/removal being Enabled in OD.

Screenshot 2024-11-04 at 17 33 21

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

From what I could gather from the #expensify-bugs Slack discussion seems like the Expected result is:

Please update this error (and review all errors) to not mention "policies". Rather, they are "workspaces".

Therefore the main solution I'm going to propose here is for BE to correct the error message to something like:

Your admin has restricted your group from creating new workspaces.

What alternative solutions did you explore? (Optional)

As an alternative solution (FE based) we could perform a string match of the BE error and if matching Your admin has restricted your group from creating new policies. -> replace it with a new en / es translated error:

Your admin has restricted your group from creating new workspaces.

The code would look something like this:

Note

This is pseudocode-ish, the logic would be adjusted to use translated() and the error string constant will be added to CONST.

In WorkspaceInitialPage.tsx before return add the following logic:

    const customTranslation = 'Your admin has restricted your group from creating new workspaces.';

    const translatedErrors = Object.fromEntries(
        Object.entries(policy?.errors ?? {}).map(([key, value]) => [key, value === 'Your admin has restricted your group from creating new policies.' ? customTranslation : value]),
    );

and the UI:

Screen.Recording.2024-11-04.at.17.58.30.mov

@jjcoffee
Copy link
Contributor

jjcoffee commented Nov 5, 2024

Agree with @ikevin127 that this is a BE issue. We could fix it on the FE for a quick fix if needed, but otherwise this needs to be internal.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 5, 2024

Triggered auto assignment to @bondydaa, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@bondydaa
Copy link
Contributor

bondydaa commented Nov 5, 2024

@bondydaa bondydaa added the Reviewing Has a PR in review label Nov 5, 2024
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 11, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

@garrettmknight, @bondydaa, @jjcoffee Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Nov 15, 2024

@garrettmknight, @bondydaa, @jjcoffee Huh... This is 4 days overdue. Who can take care of this?

@garrettmknight garrettmknight removed the Reviewing Has a PR in review label Nov 15, 2024
@garrettmknight
Copy link
Contributor

Will test on Monday.

Copy link

melvin-bot bot commented Nov 16, 2024

@garrettmknight @jjcoffee this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Nov 16, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
@garrettmknight
Copy link
Contributor

Fixed - no payments here.

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Nov 18, 2024
@melvin-bot melvin-bot bot removed the Overdue label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Archived in project
Development

No branches or pull requests

5 participants