Skip to content

[HOLD for payment 2024-11-21] Re-direct to Classic when creating expenses for non-migrated users #51804

Closed

Description

@puneetlath

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

Activity

  1. self-assigned this
    on Oct 31, 2024
  2. melvin-bot commented on Oct 31, 2024

    @melvin-bot

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

  3. melvin-bot commented on Oct 31, 2024

    @melvin-bot

    ⚠️ 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 ⚠️

  4. melvin-bot commented on Oct 31, 2024

    @melvin-bot

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

  5. puneetlath commented on Oct 31, 2024

    @puneetlath
    ContributorAuthor

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

  6. dubielzyk-expensify commented on Nov 1, 2024

    @dubielzyk-expensify
    Contributor

    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

  7. daledah commented on Nov 1, 2024

    @daledah
    Contributor

    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)

  8. 46 remaining items

  9. melvin-bot commented on Nov 21, 2024

    @melvin-bot

    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
  10. puneetlath commented on Nov 21, 2024

    @puneetlath
    ContributorAuthor

    @suneox can you complete the checklist here?

  11. suneox commented on Nov 21, 2024

    @suneox
    Contributor

    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 👎

  12. melvin-bot commented on Nov 25, 2024

    @melvin-bot

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

  13. puneetlath commented on Nov 25, 2024

    @puneetlath
    ContributorAuthor
  14. ishpaul777 commented on Nov 25, 2024

    @ishpaul777
    Contributor

    Thank you! I have accepted the offer @puneetlath

  15. puneetlath commented on Nov 25, 2024

    @puneetlath
    ContributorAuthor

    @ishpaul777 has been paid.

  16. suneox commented on Nov 25, 2024

    @suneox
    Contributor

    I've accepted the offer. Thank you

  17. puneetlath commented on Nov 26, 2024

    @puneetlath
    ContributorAuthor

    Everyone has been paid now. Thanks everyone!

  18. moved this from Product (CRITICAL) to Done in [#whatsnext] #retainon Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2NewFeatureSomething to build that is a new item.

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions