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] Re-direct to Classic when creating expenses for non-migrated users #51804

Closed
puneetlath opened this issue Oct 31, 2024 · 45 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 NewFeature Something to build that is a new item.

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Oct 31, 2024

There are scenarios where users who have not yet had their group workspaces NewDot-enabled in NewDot. In those scenarios, things can get confusing if they try to create expenses.

To address this, let's block them from Creating, Tracking, Submitting expenses from NewDot if they are:

  • on at least one group policy
  • none of the group policies they are a member of have isPolicyExpenseChatEnabled=true

We should do this by showing a modal when they tap/click any of these options, which re-directs them back to OldDot.

Screenshot 2024-10-31 at 11 34 11 AM
Issue OwnerCurrent Issue Owner: @puneetlath
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Oct 31, 2024
@puneetlath puneetlath self-assigned this Oct 31, 2024
Copy link

melvin-bot bot commented Oct 31, 2024

Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Oct 31, 2024
Copy link

melvin-bot bot commented Oct 31, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Oct 31, 2024

Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

@puneetlath
Copy link
Contributor Author

@dubielzyk-expensify can you help with some mocks of what that re-direct to Classic modal should look like?

@dubielzyk-expensify
Copy link
Contributor

dubielzyk-expensify commented Nov 1, 2024

Yes sir. Think we need some @jamesdeanexpensify magic to make the copy more crisp (he's back on Monday I believe).

Mocks

image
image

cc @Expensify/design for vizzzibilities

@daledah
Copy link
Contributor

daledah commented Nov 1, 2024

Proposal

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

  • Re-direct to Classic when creating expenses for non-migrated users

What is the root cause of that problem?

  • It is new feature.

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

            <ConfirmModal
                prompt={'Due to how your workspace is set up, submitting and tracking expenses has been disabled for now. Please go to Expensify Classic to add an expense.'}
                isVisible={modalVisible}
                onConfirm={() => {
                    setModalVisible(false);
                    Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
                }}
                onCancel={() => setModalVisible(false)}
                title={'Your workspace is not ready for New Expensify'}
                confirmText={translate('exitSurvey.goToExpensifyClassic')}
                cancelText={translate('common.cancel')}
            />
  • Then, introduce a new variable to check whether we should redirect user to OD:
    const [modalVisible, setModalVisible] = useState(false);
    const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
    const shouldRedirectToOD = useMemo(() => {
        const groupPolicies = Object.values(policies ?? {}).filter((policy) => ReportUtils.isGroupPolicy(policy));
        if (groupPolicies.length === 0) {
            return false;
        }
        return !groupPolicies.some((groupPolicy) => groupPolicy?.isPolicyExpenseChatEnabled);
    }, [policies]);
  • Finally, update the callback function when clicking on Submit expense option:

                    interceptAnonymousUser(() => {
                        if (shouldRedirectToOD) {
                            setModalVisible(true);
                            return;
                        }
                        IOU.startMoneyRequest(
                            CONST.IOU.TYPE.SUBMIT,
                            // When starting to create an expense from the global FAB, there is not an existing report yet. A random optimistic reportID is generated and used
                            // for all of the routes in the creation flow.
                            ReportUtils.generateReportID(),
                        );
                    }),

The similar should be applied with Track expense and Send invoice options.

What alternative solutions did you explore? (Optional)

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

👋 I'll take this

@flaviadefaria
Copy link
Contributor

Based on the latest discussions, I think this bow belongs to #retain, so I am assigning it there.

@jamesdeanexpensify
Copy link
Contributor

jamesdeanexpensify commented Nov 4, 2024

@puneetlath @dubielzyk-expensify too much?

** 🚧 Under construction 🚧 **
We're fine-tuning a few more bits and pieces of New Expensify to accommodate your specific setup. In the meantime, head over to Expensify Classic.

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
@dubielzyk-expensify
Copy link
Contributor

It's quite cute. But this feature is still available right, but it's just because the workspace has a complicated setup that we don't allow it? So maybe it feels a bit underselling?

@melvin-bot melvin-bot bot removed the Overdue label Nov 4, 2024
@jamesdeanexpensify
Copy link
Contributor

Updated it slightly. Anything else specific you wanna tweak? Happy to brainstorm.

@dubielzyk-expensify
Copy link
Contributor

I like it. Keen to hear what @puneetlath thinks though

@puneetlath
Copy link
Contributor Author

Sounds great to me! FYI @ishpaul777

Copy link

melvin-bot bot commented Nov 13, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@MariaHCD
Copy link
Contributor

Looks like we have another flow in-product where we need to redirect to Classic: #52457

Would @ishpaul777 want to take that over as well? Or shall we treat it as a separate follow up?

@ishpaul777
Copy link
Contributor

Happy to take it :) can raise a Pr in 6-8 hours

1 similar comment
@ishpaul777
Copy link
Contributor

Happy to take it :) can raise a Pr in 6-8 hours

Copy link

melvin-bot bot commented Nov 13, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@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 Re-direct to Classic when creating expenses for non-migrated users [HOLD for payment 2024-11-21] Re-direct to Classic when creating expenses for non-migrated users 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:

  • @ishpaul777 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Nov 14, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@ishpaul777] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

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

melvin-bot bot commented Nov 21, 2024

Payment Summary

Upwork Job

BugZero Checklist (@puneetlath)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@puneetlath
Copy link
Contributor Author

@suneox can you complete the checklist here?

@suneox
Copy link
Contributor

suneox commented Nov 21, 2024

BugZero Checklist

  • [@suneox] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.

Regression Test Proposal

Step 1: Create a control workspace on a new account in OldDot.
Step 2: Sign in to the same account on NewDot.
Step 3: Click on the FAB -> Create/Send/Track Expense.
Step 4: Verify that a “Coming Soon” modal is displayed.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

@puneetlath, @suneox, @ishpaul777, @dubielzyk-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@puneetlath
Copy link
Contributor Author

@ishpaul777 offer here: https://www.upwork.com/nx/wm/offer/105064871
@suneox offer here: https://www.upwork.com/nx/wm/offer/105064898

Can y'all ping me here when you've accepted?

Regression test GH: https://github.com/Expensify/Expensify/issues/447666

@melvin-bot melvin-bot bot removed the Overdue label Nov 25, 2024
@ishpaul777
Copy link
Contributor

Thank you! I have accepted the offer @puneetlath

@puneetlath
Copy link
Contributor Author

@ishpaul777 has been paid.

@suneox
Copy link
Contributor

suneox commented Nov 25, 2024

I've accepted the offer. Thank you

@puneetlath
Copy link
Contributor Author

Everyone has been paid now. Thanks everyone!

@github-project-automation github-project-automation bot moved this from Product (CRITICAL) to Done in [#whatsnext] #retain Nov 26, 2024
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 Daily KSv2 NewFeature Something to build that is a new item.
Projects
Status: Done
Development

No branches or pull requests

10 participants