diff --git a/src/languages/en.ts b/src/languages/en.ts index 0b2a0d67e464..574e6be196f9 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -742,7 +742,7 @@ const translations = { listOfChats: 'List of chats', saveTheWorld: 'Save the world', tooltip: 'Get started here!', - redirectToOldDotModal: { + redirectToExpensifyClassicModal: { title: 'Coming soon', description: "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.", }, diff --git a/src/languages/es.ts b/src/languages/es.ts index 4f5aaabd6efc..b0a8f910b6cb 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -736,7 +736,7 @@ const translations = { listOfChats: 'lista de chats', saveTheWorld: 'Salvar el mundo', tooltip: '¡Comienza aquí!', - redirectToOldDotModal: { + redirectToExpensifyClassicModal: { title: 'Próximamente', description: 'Estamos ajustando algunos detalles de New Expensify para adaptarla a tu configuración específica. Mientras tanto, dirígete a Expensify Classic.', }, diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index 8fc55928e230..03378e5e46f7 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -185,8 +185,12 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl const [hasSeenTour = false] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { selector: hasSeenTourSelector, }); - - const shouldRedirectToOD = useMemo(() => { + /** + * There are scenarios where users who have not yet had their group workspace-chats in NewDot (isPolicyExpenseChatEnabled). In those scenarios, things can get confusing if they try to submit/track expenses. To address this, we block them from Creating, Tracking, Submitting expenses from NewDot if they are: + * 1. on at least one group policy + * 2. none of the group policies they are a member of have isPolicyExpenseChatEnabled=true + */ + const shouldRedirectToExpensifyClassic = useMemo(() => { const groupPolicies = Object.values(allPolicies ?? {}).filter((policy) => ReportUtils.isGroupPolicy(policy?.type ?? '')); if (groupPolicies.length === 0) { return false; @@ -368,10 +372,10 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl { icon: getIconForAction(CONST.IOU.TYPE.CREATE), text: translate('iou.createExpense'), - shouldCallAfterModalHide: shouldRedirectToOD, + shouldCallAfterModalHide: shouldRedirectToExpensifyClassic, onSelected: () => interceptAnonymousUser(() => { - if (shouldRedirectToOD) { + if (shouldRedirectToExpensifyClassic) { setModalVisible(true); return; } @@ -392,9 +396,9 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl { icon: getIconForAction(CONST.IOU.TYPE.TRACK), text: translate('iou.trackExpense'), - shouldCallAfterModalHide: shouldRedirectToOD, + shouldCallAfterModalHide: shouldRedirectToExpensifyClassic, onSelected: () => { - if (shouldRedirectToOD) { + if (shouldRedirectToExpensifyClassic) { setModalVisible(true); return; } @@ -419,10 +423,10 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl { icon: getIconForAction(CONST.IOU.TYPE.REQUEST), text: translate('iou.submitExpense'), - shouldCallAfterModalHide: shouldRedirectToOD, + shouldCallAfterModalHide: shouldRedirectToExpensifyClassic, onSelected: () => interceptAnonymousUser(() => { - if (shouldRedirectToOD) { + if (shouldRedirectToExpensifyClassic) { setModalVisible(true); return; } @@ -436,7 +440,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl }), }, ]; - }, [canUseCombinedTrackSubmit, translate, selfDMReportID, hasSeenTrackTraining, isOffline, shouldRedirectToOD]); + }, [canUseCombinedTrackSubmit, translate, selfDMReportID, hasSeenTrackTraining, isOffline, shouldRedirectToExpensifyClassic]); const quickActionMenuItems = useMemo(() => { // Define common properties in baseQuickAction @@ -529,10 +533,10 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl { icon: Expensicons.InvoiceGeneric, text: translate('workspace.invoices.sendInvoice'), - shouldCallAfterModalHide: shouldRedirectToOD, + shouldCallAfterModalHide: shouldRedirectToExpensifyClassic, onSelected: () => interceptAnonymousUser(() => { - if (shouldRedirectToOD) { + if (shouldRedirectToExpensifyClassic) { setModalVisible(true); return; } @@ -591,14 +595,14 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl anchorRef={fabRef} /> { setModalVisible(false); Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX); }} onCancel={() => setModalVisible(false)} - title={translate('sidebarScreen.redirectToOldDotModal.title')} + title={translate('sidebarScreen.redirectToExpensifyClassicModal.title')} confirmText={translate('exitSurvey.goToExpensifyClassic')} cancelText={translate('common.cancel')} />