Skip to content

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

Closed

Description

@m-natarajan

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.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

Activity

  1. added
    Daily
    Bug
    on Nov 2, 2024
  2. melvin-bot commented on Nov 2, 2024

    @melvin-bot

    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.

  3. added
    External
    on Nov 4, 2024
  4. changed the title [-]Error message displayed as policy instead of workspace[/-] [+][$250] Error message displayed as policy instead of workspace[/+] on Nov 4, 2024
  5. melvin-bot commented on Nov 4, 2024

    @melvin-bot
  6. added
    Help Wanted
    on Nov 4, 2024
  7. melvin-bot commented on Nov 4, 2024

    @melvin-bot

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

  8. ikevin127 commented on Nov 5, 2024

    @ikevin127
    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
  9. 3 remaining items

  10. bondydaa commented on Nov 5, 2024

    @bondydaa
    Contributor
  11. added
    Reviewing
    on Nov 5, 2024
  12. moved this to Bugs and Follow Up Issues in #expensify-bugson Nov 11, 2024
  13. melvin-bot commented on Nov 13, 2024

    @melvin-bot

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

  14. melvin-bot commented on Nov 15, 2024

    @melvin-bot

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

  15. removed
    Reviewing
    on Nov 15, 2024
  16. garrettmknight commented on Nov 15, 2024

    @garrettmknight
    Contributor

    Will test on Monday.

  17. melvin-bot commented on Nov 16, 2024

    @melvin-bot

    @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!

  18. melvin-bot commented on Nov 16, 2024

    @melvin-bot

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

  19. garrettmknight commented on Nov 18, 2024

    @garrettmknight
    Contributor

    Fixed - no payments here.

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions