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-11-21] [$250] Skip onboarding screen with company size if signupQualifier is VSB #51750

Closed
carlosmiceli opened this issue Oct 30, 2024 · 34 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 Improvement Item broken or needs improvement.

Comments

@carlosmiceli
Copy link
Contributor

carlosmiceli commented Oct 30, 2024

When signing up as a company between 1-9 employees, the user is redirected to New Expensify and is welcomed by the onboarding flow. However the first thing we ask them after they open new expensify, is how big a company they want to set up. This is redundant and makes for a bad first impression.

Let's select 1-10 employees by default for signups with the 'vsb' signnpQualifier NVP and start the onboarding flow in the accounting software section. Let's also make sure that whatever logic is triggered by selecting 1-10 also occurs (before displaying the onboarding modal) for these signups.

Select this:
Screenshot 2024-10-30 at 12 48 09 PM

Skip this screen (but keep the choice logic):
Screenshot 2024-10-30 at 1 23 29 PM

This should be the first screen they see in the modal:
Screenshot 2024-10-30 at 1 25 44 PM

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851663004588841867
  • Upwork Job ID: 1851663004588841867
  • Last Price Increase: 2024-10-30
  • Automatic offers:
    • nkdengineer | Contributor | 104676448
Issue OwnerCurrent Issue Owner: @greg-schroeder
@carlosmiceli carlosmiceli added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 30, 2024
@carlosmiceli carlosmiceli self-assigned this Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

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

@carlosmiceli carlosmiceli added the External Added to denote the issue can be worked on by a contributor label Oct 30, 2024
@melvin-bot melvin-bot bot changed the title Skip onboarding screen with company size if signupQualifier is VSB [$250] Skip onboarding screen with company size if signupQualifier is VSB Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

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

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

melvin-bot bot commented Oct 30, 2024

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

@carlosmiceli carlosmiceli added Improvement Item broken or needs improvement. Bug Something is broken. Auto assigns a BugZero manager. and removed Help Wanted Apply this label when an issue is open to proposals by contributors Bug Something is broken. Auto assigns a BugZero manager. labels Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

Current assignee @greg-schroeder is eligible for the Bug assigner, not assigning anyone new.

@Shahidullah-Muffakir
Copy link
Contributor

Proposal

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

if user selected company size in the OD, we are still showing the company size selecting modal in the onboarding flow

What is the root cause of that problem?

improvement

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

change this:
https://github.com/Expensify/App/blob/084b1047e8f090a63eb4eb99ab89d13f267bbe8b/src/libs/actions/Welcome/OnboardingFlow.ts#L58C4-L61C6
to this:

if (isVsb) {
      Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
      Welcome.setOnboardingCompanySize(onboardingCompanySize.MICRO);
     
      return `/${ONBOARDING_ACCOUNTING.route}`;
  }

@nkdengineer
Copy link
Contributor

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

This is an improvement

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

If it's vsb, we should return the onboarding accounting route and set the companySizeas 1-10 and we also need to create a new WS if the onboardingPolicyID doesn't exist

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

OPTIONAL: We can move the logic creating the WS to the accounting page if onboardingPolicyID doesn't exist.

What alternative solutions did you explore? (Optional)

@twilight2294
Copy link
Contributor

twilight2294 commented Oct 30, 2024

Edited by proposal-police: This proposal was edited at 2024-10-30 18:22:10 UTC.

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

Feature request

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

We need to update the code below here to:

    if (isVsb) {
        Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
        Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
            if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
        return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
    }

This will set the company size and also create the workspace.

Note that this change is not enough, we should also hide the back button on the accounting page if we have already selected this as the user shouldn't be able to change the employee count if she is the VSB, so here:

// we can improve this condition during PR phase as well
    const isVsbOnboarding = Array.isArray(onboardingValues) ? false : onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
    
            <HeaderWithBackButton
                shouldShowBackButton={isVsbOnboarding}

What alternative solutions did you explore? (Optional)

Note that we cannot use Welcome.setOnboardingAdminsChatReportID or Welcome.setOnboardingPolicyID because it will cause a cyclic dependency error with our CI check, so we need to use Onyx directly here:

    if (isVsb) {
        Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
        Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
            if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          
    Onyx.set(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID, adminsChatReportID ?? null);    
    Onyx.set(ONYXKEYS.ONBOARDING_POLICY_ID, policyID ?? null);
      }
        return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
    }

onboardingPolicyID will be fetched using Onyx.connect

@mzdev0
Copy link

mzdev0 commented Oct 30, 2024

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

improvement

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

we need to change the code here:

function getOnboardingInitialPath(): string {
const state = getStateFromPath(onboardingInitialPath, linkingConfig.config);
const isVsb = onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
if (isVsb) {
Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
return `/${ROUTES.ONBOARDING_EMPLOYEES.route}`;
}

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

and then remove the employee selection from here:

<Stack.Screen
name={SCREENS.ONBOARDING.EMPLOYEES}
component={OnboardingEmployees}
/>

What alternative solutions did you explore? (Optional)

Copy link

melvin-bot bot commented Oct 30, 2024

📣 @mzdev0! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@mzdev0
Copy link

mzdev0 commented Oct 30, 2024

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01e4f874aa627a77c4

Copy link

melvin-bot bot commented Oct 30, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@D-01576
Copy link

D-01576 commented Oct 31, 2024

Proposal

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

The current onboarding flow for users with signupQualifier set to VSB includes a screen to select company size, which we want to skip.

What is the root cause of that problem?

The onboarding flow does not bypass the company size selection screen for VSB users, which creates an unnecessary step.

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

If isVsb is true, we should:

  1. Set the OnboardingPurposeSelected to Manage Team.
  2. Set the OnboardingCompanySize to Micro.
  3. Create a new Workspace if onboardingPolicyID is not set.

The updated code block from lines 58 to 61 should look like this:

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Welcome.setOnboardingCompanySize(CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
        const {adminsChatReportID, policyID} = Policy.createWorkspace(
            undefined,
            true,
            '',
            Policy.generatePolicyID(),
            CONST.ONBOARDING_CHOICES.MANAGE_TEAM
        );
        Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
        Welcome.setOnboardingPolicyID(policyID);
    }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

What alternative solutions did you explore? (Optional)

@jayeshmangwani
Copy link
Contributor

@carlosmiceli 'Help Wanted' label was removed here—I assume this was a mistake and that we want this issue fixed by an external contributor?

@jayeshmangwani
Copy link
Contributor

@D-01576 How does your proposal differ from the ones above #51750 (comment) and #51750 (comment)?

@jayeshmangwani
Copy link
Contributor

We cannot remove the page entirely, as we still need it for users who aren’t coming from OD

@mzdev0 We cannot remove the page entirely, as we still need it for users who aren’t coming from OD

@jayeshmangwani
Copy link
Contributor

@Shahidullah-Muffakir Thanks for the proposal! You’ve suggested to update the company size here, but you should have also included the workspace creation aspect as well.

@jayeshmangwani
Copy link
Contributor

Note that this change is not enough, we should also hide the back button on the accounting page if we have already selected this as the user shouldn't be able to change the employee count if she is the VSB

@twilight2294 I feel that this is a thing that can be done in the PR and would have been caught when testing, so I feel that @nkdengineer Proposal is sufficient here

@jayeshmangwani
Copy link
Contributor

We can go with @nkdengineer’s proposal here.

🎀 👀 🎀 C+ reviewed

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

melvin-bot bot commented Oct 31, 2024

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@carlosmiceli
Copy link
Contributor Author

@mallenexpensify I'd like your input here, because while @twilight2294's proposal wasn't selected, he did help us realize that the Back button should be hidden (and I brought it up to the team in Slack thanks to his suggestion here). I'm thinking that there should be either some compensation for helping us pick that up, or once I create an issue for it (waiting for confirmation that I should), maybe we can give prioritize his proposal for that issue (assuming it works)?

@carlosmiceli
Copy link
Contributor Author

Ok, scratch that Matt, we've decided not to hide the back button so there won't be any extra work/value there.

@anmurali
Copy link

anmurali commented Nov 5, 2024

@nkdengineer @carlosmiceli - I want to confirm that we're actually auto selecting 1-10 in the How many employees do you have step and going directly to the accounting step. In other words, we're still storing introSelected.companySize : "1-10" right?

@carlosmiceli
Copy link
Contributor Author

Yup! We're setting that value as well.

@greg-schroeder
Copy link
Contributor

Review is ongoing for linked PR

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 14, 2024
@melvin-bot melvin-bot bot changed the title [$250] Skip onboarding screen with company size if signupQualifier is VSB [HOLD for payment 2024-11-21] [$250] Skip onboarding screen with company size if signupQualifier is VSB Nov 14, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

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

Copy link

melvin-bot bot commented Nov 14, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.61-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-11-21. 🎊

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

Copy link

melvin-bot bot commented Nov 14, 2024

@jayeshmangwani @greg-schroeder @jayeshmangwani The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 20, 2024
@jayeshmangwani
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other: Improvement on Ongoing Onboarding Designs

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: N/A - New Feature

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Navigate to https://staging.expensify.com/.
  2. Choose Manage expenses for a small team and enter a new email or phone number.
  3. Log in with that new user.
  4. Verify that the How many employees screen is skipped on New Dot.
  5. Press the Back button and confirm that 1-10 employees is preselected.

Do we agree 👍 or 👎

@greg-schroeder
Copy link
Contributor

Payment summary:

Contributor: @nkdengineer - Upwork
C+: @jayeshmangwani - $250 - Manual request via ND


Regression test filed: https://github.com/Expensify/Expensify/issues/446445

@garrettmknight
Copy link
Contributor

$250 approved for @jayeshmangwani

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 Improvement Item broken or needs improvement.
Projects
Development

No branches or pull requests

10 participants