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

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

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

@ishpaul777
Copy link
Contributor

@dubielzyk-expensify can you please clarify if content should be center aligned or left aligned on mobile width?

Screenshot 2024-11-07 at 12 33 50 AM

@dannymcclain
Copy link
Contributor

@ishpaul777 Left-aligned is our standard pattern (what you're showing looks correct).

@dannymcclain
Copy link
Contributor

P.S. @jamesdeanexpensify I am surprised to see emoji being used in the copy. IS THAT FAIR GAME NOW?!

{ Rewrites all copy everywhere to use gratuitous amounts of emoji } 😁 😂

@jamesdeanexpensify
Copy link
Contributor

It felt like it fit this one! haha

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 6, 2024
@dubielzyk-expensify
Copy link
Contributor

Danny's got it right. I actually think we shouldn't have the emojis. Keen to hear what @Expensify/design thinks. Feels like it cheapens things to me. I should've mentioned this initially. If people disagree, we can move on though.

@jamesdeanexpensify
Copy link
Contributor

I'm fine removing the emojis. I don't think we've done that much elsewhere anyways. I don't know what got into me! haha

@dubielzyk-expensify
Copy link
Contributor

Hahah. Sometimes we need to push the boundaries to see what we really feel. Do the headline still work without it?

@jamesdeanexpensify
Copy link
Contributor

Maybe something like "Almost there!" ?

@dubielzyk-expensify
Copy link
Contributor

dubielzyk-expensify commented Nov 7, 2024

Hmm. What about "Not ready yet" or something. "Almost there" sounds like a last step before you finish something or that the user has control.

@jamesdeanexpensify
Copy link
Contributor

True! But I don't like the negative connotation of starting with "Not". I considered it. Maybe "Work in progress..." or something like that?

@dubielzyk-expensify
Copy link
Contributor

dubielzyk-expensify commented Nov 7, 2024

I like it. Keen to hear what @puneetlath thinks too as he's more aware of what the details are

@shawnborton
Copy link
Contributor

Hahah came here to say the same thing... I think I also prefer the non-emoji version, they kind of compete with our illustration system a bit. If we want to add some construction pizazz, we could always use something from our library but I like keeping it simple for this one.

@puneetlath
Copy link
Contributor Author

I like "Work in progress" or "Coming soon".

@jamesdeanexpensify
Copy link
Contributor

Oh I'm down with "Coming soon"!

@dubielzyk-expensify
Copy link
Contributor

Sounds good to me. Alright we're ready to proceed with the rest of the implementation @ishpaul777

puneetlath added a commit that referenced this issue Nov 11, 2024
Re-direct to Classic when creating expenses for non-migrated users #51804
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.

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 NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: Product (CRITICAL)
Development

No branches or pull requests

9 participants