Skip to content

Commit

Permalink
Merge pull request #39687 from software-mansion-labs/wave9/onboarding…
Browse files Browse the repository at this point in the history
…-flow-turn-on

[Onboarding - Stage 2] Onboarding Flow - enabled
  • Loading branch information
mountiny authored Apr 23, 2024
2 parents f619194 + 45d1bad commit 23fe2e1
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 572 deletions.
5 changes: 5 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {ValueOf} from 'type-fest';
import type CONST from './CONST';
import type * as FormTypes from './types/form';
import type * as OnyxTypes from './types/onyx';
import type Onboarding from './types/onyx/Onboarding';
import type AssertTypesEqual from './types/utils/AssertTypesEqual';
import type DeepValueOf from './types/utils/DeepValueOf';

Expand Down Expand Up @@ -114,6 +115,9 @@ const ONYXKEYS = {
/** Boolean flag only true when first set */
NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'nvp_isFirstTimeNewExpensifyUser',

/** This NVP contains information about whether the onboarding flow was completed or not */
NVP_ONBOARDING: 'nvp_onboarding',

/** Contains the user preference for the LHN priority mode */
NVP_PRIORITY_MODE: 'nvp_priorityMode',

Expand Down Expand Up @@ -565,6 +569,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.ACCOUNT]: OnyxTypes.Account;
[ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]: string;
[ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]: boolean;
[ONYXKEYS.NVP_ONBOARDING]: Onboarding | [];
[ONYXKEYS.ACTIVE_CLIENTS]: string[];
[ONYXKEYS.DEVICE_ID]: string;
[ONYXKEYS.IS_SIDEBAR_LOADED]: boolean;
Expand Down
4 changes: 0 additions & 4 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,6 @@ const ROUTES = {
NEW_TASK_TITLE: 'new/task/title',
NEW_TASK_DESCRIPTION: 'new/task/description',

ONBOARD: 'onboard',
ONBOARD_MANAGE_EXPENSES: 'onboard/manage-expenses',
ONBOARD_EXPENSIFY_CLASSIC: 'onboard/expensify-classic',

TEACHERS_UNITE: 'settings/teachersunite',
I_KNOW_A_TEACHER: 'settings/teachersunite/i-know-a-teacher',
I_AM_A_TEACHER: 'settings/teachersunite/i-am-a-teacher',
Expand Down
7 changes: 0 additions & 7 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const SCREENS = {
PARTICIPANTS: 'Participants',
MONEY_REQUEST: 'MoneyRequest',
NEW_TASK: 'NewTask',
ONBOARD_ENGAGEMENT: 'Onboard_Engagement',
TEACHERS_UNITE: 'TeachersUnite',
TASK_DETAILS: 'Task_Details',
ENABLE_PAYMENTS: 'EnablePayments',
Expand Down Expand Up @@ -306,12 +305,6 @@ const SCREENS = {
WORK: 'Onboarding_Work',
},

ONBOARD_ENGAGEMENT: {
ROOT: 'Onboard_Engagement_Root',
MANAGE_TEAMS_EXPENSES: 'Manage_Teams_Expenses',
EXPENSIFY_CLASSIC: 'Expenisfy_Classic',
},

WELCOME_VIDEO: {
ROOT: 'Welcome_Video_Root',
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnboardingWelcomeVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function OnboardingWelcomeVideo() {
<View style={shouldUseNarrowLayout ? {padding: MODAL_PADDING} : {paddingHorizontal: MODAL_PADDING}}>{getWelcomeVideo()}</View>
<View style={[shouldUseNarrowLayout ? [styles.mt5, styles.mh8] : [styles.mt5, styles.mh5]]}>
<View style={[shouldUseNarrowLayout ? [styles.gap1, styles.mb8] : [styles.mb10]]}>
<Text style={[styles.textHeadlineH1, styles.textXXLarge]}>{translate('onboarding.welcomeVideo.title')}</Text>
<Text style={[styles.textHeadlineH1]}>{translate('onboarding.welcomeVideo.title')}</Text>
<Text style={styles.textSupporting}>{translate('onboarding.welcomeVideo.description')}</Text>
</View>
<Button
Expand Down
11 changes: 0 additions & 11 deletions src/components/TestToolMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,6 @@ function TestToolMenu({user = USER_DEFAULT, network}: TestToolMenuProps) {
/>
</TestToolRow>

{/* Navigate to the new Onboarding flow (Stage 1). This button is temporary and should be removed after passing QA tests. */}
<TestToolRow title="Onboarding Flow">
<Button
small
text="Navigate"
onPress={() => {
Navigation.dismissModal();
Navigation.navigate(ROUTES.ONBOARDING_PURPOSE);
}}
/>
</TestToolRow>
{/* Navigate to the new Search Page. This button is temporary and should be removed after passing QA tests. */}
<TestToolRow title="New Search Page">
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/components/VideoPlayer/BaseVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function BaseVideoPlayer({
}
togglePlayCurrentVideo();
}}
style={styles.flex1}
style={[styles.flex1, styles.noSelect]}
>
{shouldUseSharedVideoElement ? (
<>
Expand Down
22 changes: 0 additions & 22 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2741,28 +2741,6 @@ export default {
},
copyReferralLink: 'Copy invite link',
},
purposeForExpensify: {
[CONST.INTRO_CHOICES.TRACK]: 'Track business spend for taxes',
[CONST.INTRO_CHOICES.SUBMIT]: 'Get paid back by my employer',
[CONST.INTRO_CHOICES.MANAGE_TEAM]: "Manage my team's expenses",
[CONST.INTRO_CHOICES.CHAT_SPLIT]: 'Chat and split expenses with friends',
welcomeMessage: 'Welcome to Expensify',
welcomeSubtitle: 'What would you like to do?',
},
manageTeams: {
[CONST.MANAGE_TEAMS_CHOICE.MULTI_LEVEL]: 'Multi level approval',
[CONST.MANAGE_TEAMS_CHOICE.CUSTOM_EXPENSE]: 'Custom expense coding',
[CONST.MANAGE_TEAMS_CHOICE.CARD_TRACKING]: 'Company card tracking',
[CONST.MANAGE_TEAMS_CHOICE.ACCOUNTING]: 'Accounting integrations',
[CONST.MANAGE_TEAMS_CHOICE.RULE]: 'Rule enforcement',
title: 'Do you require any of the following features?',
},
expensifyClassic: {
title: "Expensify Classic has everything you'll need",
firstDescription: "While we're busy working on New Expensify, it currently doesn't support some of the features you're looking for.",
secondDescription: "Don't worry, Expensify Classic has everything you need.",
buttonText: 'Take me to Expensify Classic',
},
violations: {
allTagLevelsRequired: 'All tags required',
autoReportedRejectedExpense: ({rejectReason, rejectedBy}: ViolationsAutoReportedRejectedExpenseParams) => `${rejectedBy} rejected this expense with the comment "${rejectReason}"`,
Expand Down
22 changes: 0 additions & 22 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3234,28 +3234,6 @@ export default {
},
copyReferralLink: 'Copiar enlace de invitación',
},
purposeForExpensify: {
[CONST.INTRO_CHOICES.TRACK]: 'Seguimiento de los gastos de empresa para fines fiscales',
[CONST.INTRO_CHOICES.SUBMIT]: 'Reclamar gastos a mi empleador',
[CONST.INTRO_CHOICES.MANAGE_TEAM]: 'Gestionar los gastos de mi equipo',
[CONST.INTRO_CHOICES.CHAT_SPLIT]: 'Chatea y divide gastos con tus amigos',
welcomeMessage: 'Bienvenido a Expensify',
welcomeSubtitle: '¿Qué te gustaría hacer?',
},
manageTeams: {
[CONST.MANAGE_TEAMS_CHOICE.MULTI_LEVEL]: 'Aprobación multinivel',
[CONST.MANAGE_TEAMS_CHOICE.CUSTOM_EXPENSE]: 'Codificación personalizada de gastos',
[CONST.MANAGE_TEAMS_CHOICE.CARD_TRACKING]: 'Seguimiento de tarjetas corporativas',
[CONST.MANAGE_TEAMS_CHOICE.ACCOUNTING]: 'Integraciones de contaduría',
[CONST.MANAGE_TEAMS_CHOICE.RULE]: 'Aplicación de reglas',
title: '¿Necesitas alguna de las siguientes funciones?',
},
expensifyClassic: {
title: 'Expensify Classic tiene todo lo que necesitas',
firstDescription: 'Aunque estamos ocupados trabajando en el Nuevo Expensify, actualmente no soporta algunas de las funciones que estás buscando.',
secondDescription: 'No te preocupes, Expensify Classic tiene todo lo que necesitas.',
buttonText: 'Llévame a Expensify Classic',
},
violations: {
allTagLevelsRequired: 'Todas las etiquetas son obligatorias',
autoReportedRejectedExpense: ({rejectedBy, rejectReason}: ViolationsAutoReportedRejectedExpenseParams) => `${rejectedBy} rechazó la solicitud y comentó "${rejectReason}"`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import type {
MoneyRequestNavigatorParamList,
NewChatNavigatorParamList,
NewTaskNavigatorParamList,
OnboardEngagementNavigatorParamList,
ParticipantsNavigatorParamList,
PrivateNotesNavigatorParamList,
ProfileNavigatorParamList,
Expand Down Expand Up @@ -166,12 +165,6 @@ const NewTaskModalStackNavigator = createModalStackNavigator<NewTaskNavigatorPar
[SCREENS.NEW_TASK.DESCRIPTION]: () => require('../../../../pages/tasks/NewTaskDescriptionPage').default as React.ComponentType,
});

const OnboardEngagementModalStackNavigator = createModalStackNavigator<OnboardEngagementNavigatorParamList>({
[SCREENS.ONBOARD_ENGAGEMENT.ROOT]: () => require('../../../../pages/OnboardEngagement/PurposeForUsingExpensifyPage').default as React.ComponentType,
[SCREENS.ONBOARD_ENGAGEMENT.MANAGE_TEAMS_EXPENSES]: () => require('../../../../pages/OnboardEngagement/ManageTeamsExpensesPage').default as React.ComponentType,
[SCREENS.ONBOARD_ENGAGEMENT.EXPENSIFY_CLASSIC]: () => require('../../../../pages/OnboardEngagement/ExpensifyClassicPage').default as React.ComponentType,
});

const NewTeachersUniteNavigator = createModalStackNavigator<TeachersUniteNavigatorParamList>({
[SCREENS.SAVE_THE_WORLD.ROOT]: () => require('../../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType,
[SCREENS.I_KNOW_A_TEACHER]: () => require('../../../../pages/TeachersUnite/KnowATeacherPage').default as React.ComponentType,
Expand Down Expand Up @@ -345,7 +338,6 @@ const ProcessMoneyRequestHoldStackNavigator = createModalStackNavigator({
export {
AddPersonalBankAccountModalStackNavigator,
DetailsModalStackNavigator,
OnboardEngagementModalStackNavigator,
EditRequestStackNavigator,
EnablePaymentsStackNavigator,
FlagCommentStackNavigator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ function RightModalNavigator({navigation}: RightModalNavigatorProps) {
name={SCREENS.RIGHT_MODAL.NEW_TASK}
component={ModalStackNavigators.NewTaskModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.ONBOARD_ENGAGEMENT}
component={ModalStackNavigators.OnboardEngagementModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.TEACHERS_UNITE}
component={ModalStackNavigators.NewTeachersUniteNavigator}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,7 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps
return;
}

Welcome.isOnboardingFlowCompleted({
onNotCompleted: () =>
Navigation.navigate(
// Uncomment once Stage 1 Onboarding Flow is ready
//
// ROUTES.ONBOARDING_PERSONAL_DETAILS
//
ROUTES.ONBOARD,
),
});
Welcome.isOnboardingFlowCompleted({onNotCompleted: () => Navigation.navigate(ROUTES.ONBOARDING_ROOT)});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoadingApp]);

Expand Down
7 changes: 0 additions & 7 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,6 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.NEW_TASK.DESCRIPTION]: ROUTES.NEW_TASK_DESCRIPTION,
},
},
[SCREENS.RIGHT_MODAL.ONBOARD_ENGAGEMENT]: {
screens: {
[SCREENS.ONBOARD_ENGAGEMENT.ROOT]: ROUTES.ONBOARD,
[SCREENS.ONBOARD_ENGAGEMENT.MANAGE_TEAMS_EXPENSES]: ROUTES.ONBOARD_MANAGE_EXPENSES,
[SCREENS.ONBOARD_ENGAGEMENT.EXPENSIFY_CLASSIC]: ROUTES.ONBOARD_EXPENSIFY_CLASSIC,
},
},
[SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: {
screens: {
[SCREENS.I_KNOW_A_TEACHER]: ROUTES.I_KNOW_A_TEACHER,
Expand Down
8 changes: 0 additions & 8 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,6 @@ type NewTaskNavigatorParamList = {
[SCREENS.NEW_TASK.DESCRIPTION]: undefined;
};

type OnboardEngagementNavigatorParamList = {
[SCREENS.ONBOARD_ENGAGEMENT.ROOT]: undefined;
[SCREENS.ONBOARD_ENGAGEMENT.MANAGE_TEAMS_EXPENSES]: undefined;
[SCREENS.ONBOARD_ENGAGEMENT.EXPENSIFY_CLASSIC]: undefined;
};

type TeachersUniteNavigatorParamList = {
[SCREENS.SAVE_THE_WORLD.ROOT]: undefined;
[SCREENS.I_KNOW_A_TEACHER]: undefined;
Expand Down Expand Up @@ -659,7 +653,6 @@ type RightModalNavigatorParamList = {
[SCREENS.RIGHT_MODAL.ROOM_INVITE]: NavigatorScreenParams<RoomInviteNavigatorParamList>;
[SCREENS.RIGHT_MODAL.MONEY_REQUEST]: NavigatorScreenParams<MoneyRequestNavigatorParamList>;
[SCREENS.RIGHT_MODAL.NEW_TASK]: NavigatorScreenParams<NewTaskNavigatorParamList>;
[SCREENS.RIGHT_MODAL.ONBOARD_ENGAGEMENT]: NavigatorScreenParams<OnboardEngagementNavigatorParamList>;
[SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: NavigatorScreenParams<TeachersUniteNavigatorParamList>;
[SCREENS.RIGHT_MODAL.TASK_DETAILS]: NavigatorScreenParams<TaskDetailsNavigatorParamList>;
[SCREENS.RIGHT_MODAL.ENABLE_PAYMENTS]: NavigatorScreenParams<EnablePaymentsNavigatorParamList>;
Expand Down Expand Up @@ -863,7 +856,6 @@ export type {
NavigationStateRoute,
NewChatNavigatorParamList,
NewTaskNavigatorParamList,
OnboardEngagementNavigatorParamList,
OnboardingModalNavigatorParamList,
ParticipantsNavigatorParamList,
PrivateNotesNavigatorParamList,
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import * as Device from '@userActions/Device';
import * as PriorityMode from '@userActions/PriorityMode';
import redirectToSignIn from '@userActions/SignInRedirect';
import Timing from '@userActions/Timing';
import * as Welcome from '@userActions/Welcome';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -648,6 +649,7 @@ function resetHomeRouteParams() {
function cleanupSession() {
Pusher.disconnect();
Timers.clearAll();
Welcome.resetAllChecks();
PriorityMode.resetHasReadRequiredDataFromStorage();
MainQueue.clear();
HttpUtils.cancelPendingRequests();
Expand Down
Loading

0 comments on commit 23fe2e1

Please sign in to comment.