Skip to content

[$250] Workflows option is not enabled if workspace is created from onboarding flow #56717

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.97-0
Reproducible in staging?: y
Reproducible in production?: y
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: @allgandalf
Slack conversation (hyperlinked to channel name): expensify-bug

Action Performed:

  1. Create new account
  2. Select manage my team expense > complete onboarding
  3. open the newly created workspace settings

Expected Result:

We should see the workflows option enabled like we do when we create a workspace from workspace list

Actual Result:

We don't see the workflows option enabled

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
Recording.979.mp4
Screen.Recording.2025-02-11.at.11.54.37.AM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021890532563962155124
  • Upwork Job ID: 1890532563962155124
  • Last Price Increase: 2025-02-14
Issue OwnerCurrent Issue Owner: @rojiphil

Activity

  1. added
    Bug
    Daily
    on Feb 12, 2025
  2. melvin-bot commented on Feb 12, 2025

    @melvin-bot

    Triggered auto assignment to @adelekennedy (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. m-natarajan commented on Feb 12, 2025

    @m-natarajan
    Author

    Proposal by @allgandalf

    Proposal

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

    Workflows option is not enabled if we create workspace from onboarding flow

    What is the root cause of that problem?

    We do not set the value of areWorkflowsEnabled when creating a policy prepareOnboardingOnyxData, hence we do not see the workflows option

    Note that when we create workspace from workspace list page this option is auto enabled

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

    In prepareOnboardingOnyxData add the following code

     optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${onboardingPolicyID}`,
            value: {
                areWorkflowsEnabled: true,
                pendingFields: {
                    areWorkflowsEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
                },
            },
        });
    
        successData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${onboardingPolicyID}`,
            value: {
                pendingFields: {
                    areWorkflowsEnabled: null,
                },
            },
        });
    
        failureData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${onboardingPolicyID}`,
            value: {
                areWorkflowsEnabled: getPolicy(onboardingPolicyID)?.areWorkflowsEnabled,
                pendingFields: {
                    areWorkflowsEnabled: null,
                },
            },
        });

    We can even go further and enable the delayed submission like we do currently when creating a workspace, but that can be ignored now.
    Some minor changes can be done in the pendingFields section during PR phase, we also require BE changes here to enable the toggle on the BE

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    There is not need for any tests here =, but we can always set some mock only data and create workspace then check on a UI/ unit test if the option is enabled or not , but honestly for this bug we don't need one

    What alternative solutions did you explore? (Optional)

  4. added
    External
    on Feb 14, 2025
  5. changed the title [-]Workflows option is not enabled if workspace is created from onboarding flow[/-] [+][$250] Workflows option is not enabled if workspace is created from onboarding flow[/+] on Feb 14, 2025
  6. melvin-bot commented on Feb 14, 2025

    @melvin-bot
  7. added
    Help Wanted
    on Feb 14, 2025
  8. melvin-bot commented on Feb 14, 2025

    @melvin-bot

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

  9. thelullabyy commented on Feb 15, 2025

    @thelullabyy
    Contributor

    Will be fixed by #56479

  10. allgandalf commented on Feb 24, 2025

    @allgandalf
    Contributor

    @adelekennedy can you re-open this one, the PR mentioned doesn't fix the issue i mentioned

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions