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

[Guided Setup: Stage 3] Send the Onboarding Message After Sign-In #46052

Merged
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2026504
add onboarding message for newly created admins
cdOut Jul 23, 2024
8dd7c27
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Jul 23, 2024
cee209d
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Jul 26, 2024
9610a9f
separate selectable onboarding choices from ones sent through API
cdOut Jul 26, 2024
2b923ce
correct indexing of onboarding messages for admin and employer
cdOut Jul 26, 2024
e139d38
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Jul 29, 2024
0089f73
clean-up comment and correct CONST onboarding message selector
cdOut Jul 29, 2024
cb724a5
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Jul 29, 2024
bccc3b4
code review cleanup
cdOut Jul 30, 2024
8b1e02f
fix lint errors
cdOut Jul 30, 2024
e0a93d8
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Aug 7, 2024
7a507fb
fix CONST definition for multiple onboarding choices using the same m…
cdOut Aug 9, 2024
2cb743c
correct guidedSetupParams for this onboarding flow
cdOut Aug 19, 2024
99cc4fa
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 3, 2024
2b4e248
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 3, 2024
bc16df0
set as const and fix typing, remove unused imports
cdOut Sep 3, 2024
23b909e
fix typecheck errors after as const
cdOut Sep 3, 2024
261e748
fix lint errors
cdOut Sep 3, 2024
f124f7b
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 4, 2024
ac707be
refactor the onboarding message code inside openReport
cdOut Sep 4, 2024
cd04c88
fix prettier issues
cdOut Sep 4, 2024
511050a
replace unnecessary data duplicate with completeGuidedSetup call
cdOut Sep 4, 2024
fd3663b
fix prettier
cdOut Sep 4, 2024
ee3ab24
allow split_chat option to be picked during non-organic guided setup
cdOut Sep 5, 2024
e86927d
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 5, 2024
d65fd44
fix typescript convention errors and move types
cdOut Sep 5, 2024
2bf730e
remove partial in favor of optional params
cdOut Sep 5, 2024
bcb3605
separate completeOnboarding onyx data preparation into a function
cdOut Sep 9, 2024
86a8ad0
fix prettier
cdOut Sep 9, 2024
432c19b
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 9, 2024
52b01db
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 17, 2024
7e5c1f1
refactor onboarding guided setup param name into guidedSetupData
cdOut Sep 18, 2024
a34ed03
fix prettier
cdOut Sep 18, 2024
9eaa30d
clean up code and remove duplicate definitions
cdOut Sep 18, 2024
bb8c36a
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 18, 2024
891a79b
refactor SystemChatReportFooterMessage to useOnyx
cdOut Sep 18, 2024
44161d8
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 20, 2024
c0db8a1
correct conditionals for onboarding and fix multiple concierge chats
cdOut Sep 20, 2024
cd23f0a
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 20, 2024
cb4d6d1
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Sep 30, 2024
79adb8c
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 2, 2024
9375448
fix prettier
cdOut Oct 2, 2024
081d274
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 4, 2024
a731e58
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 16, 2024
96aaf8a
fix prettier and eslint
cdOut Oct 16, 2024
77bc369
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 24, 2024
e75f0b4
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 28, 2024
75f9252
Merge branch 'main' into @cdOut/guided-3-onboarding
cdOut Oct 30, 2024
99715b5
Merge branch 'main' into @cdOut/guided-3-onboarding
blazejkustra Nov 6, 2024
f9ced59
Rename a type to fix TS
blazejkustra Nov 6, 2024
3897043
Export renamed types
blazejkustra Nov 6, 2024
5278d20
Fix possible race condition on FE
blazejkustra Nov 6, 2024
d0f451a
Fix tests and pass all data to prepareOnboardingOptimisticData
blazejkustra Nov 6, 2024
cb3d7b9
Fix that no onboarding messages were sent for a first time user
blazejkustra Nov 7, 2024
c3c6e44
Adjusted message for admin
zfurtak Nov 12, 2024
346157d
Merge main
zfurtak Nov 12, 2024
54c71f8
Merge branch 'main' into @cdOut/guided-3-onboarding
blazejkustra Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 75 additions & 18 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const selectableOnboardingChoices = {
} as const;

const backendOnboardingChoices = {
ADMIN: 'newDotAdmin',
SUBMIT: 'newDotSubmit',
} as const;

Expand All @@ -90,14 +91,14 @@ const signupQualifiers = {
SMB: 'smb',
} as const;

const selfGuidedTourTask: OnboardingTaskType = {
const selfGuidedTourTask: OnboardingTask = {
type: 'viewTour',
autoCompleted: false,
title: 'Take a 2-minute tour',
description: ({navatticURL}) => `[Take a self-guided product tour](${navatticURL}) and learn about everything Expensify has to offer.`,
};

const onboardingEmployerOrSubmitMessage: OnboardingMessageType = {
const onboardingEmployerOrSubmitMessage: OnboardingMessage = {
message: 'Getting paid back is as easy as sending a message. Let’s go over the basics.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-get-paid-back-v2.mp4`,
Expand Down Expand Up @@ -142,7 +143,7 @@ const onboardingEmployerOrSubmitMessage: OnboardingMessageType = {
],
};

const combinedTrackSubmitOnboardingEmployerOrSubmitMessage: OnboardingMessageType = {
const combinedTrackSubmitOnboardingEmployerOrSubmitMessage: OnboardingMessage = {
...onboardingEmployerOrSubmitMessage,
tasks: [
{
Expand Down Expand Up @@ -180,7 +181,7 @@ const combinedTrackSubmitOnboardingEmployerOrSubmitMessage: OnboardingMessageTyp
],
};

const onboardingPersonalSpendMessage: OnboardingMessageType = {
const onboardingPersonalSpendMessage: OnboardingMessage = {
message: 'Here’s how to track your spend in a few clicks.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-track-personal-v2.mp4`,
Expand Down Expand Up @@ -208,7 +209,7 @@ const onboardingPersonalSpendMessage: OnboardingMessageType = {
},
],
};
const combinedTrackSubmitOnboardingPersonalSpendMessage: OnboardingMessageType = {
const combinedTrackSubmitOnboardingPersonalSpendMessage: OnboardingMessage = {
...onboardingPersonalSpendMessage,
tasks: [
{
Expand All @@ -231,11 +232,11 @@ const combinedTrackSubmitOnboardingPersonalSpendMessage: OnboardingMessageType =
],
};

type OnboardingPurposeType = ValueOf<typeof onboardingChoices>;
type OnboardingPurpose = ValueOf<typeof onboardingChoices>;

type OnboardingCompanySizeType = ValueOf<typeof onboardingCompanySize>;
type OnboardingCompanySize = ValueOf<typeof onboardingCompanySize>;

type OnboardingAccountingType = ValueOf<typeof CONST.POLICY.CONNECTIONS.NAME> | null;
type OnboardingAccounting = ValueOf<typeof CONST.POLICY.CONNECTIONS.NAME> | null;

const onboardingInviteTypes = {
IOU: 'iou',
Expand All @@ -251,9 +252,9 @@ const onboardingCompanySize = {
LARGE: '1001+',
} as const;

type OnboardingInviteType = ValueOf<typeof onboardingInviteTypes>;
type OnboardingInvite = ValueOf<typeof onboardingInviteTypes>;

type OnboardingTaskType = {
type OnboardingTask = {
type: string;
autoCompleted: boolean;
title:
Expand All @@ -278,10 +279,17 @@ type OnboardingTaskType = {
) => string);
};

type OnboardingMessageType = {
type OnboardingMessage = {
/** Text message that will be displayed first */
message: string;

/** Video object to be displayed after initial description message */
video?: Video;
tasks: OnboardingTaskType[];

/** List of tasks connected with the message, they will have a checkbox and a separate report for more information */
tasks: OnboardingTask[];

/** Type of task described in a string format */
type?: string;
};

Expand Down Expand Up @@ -5068,18 +5076,67 @@ const CONST = {
},
],
},
[onboardingChoices.ADMIN]: {
message: "As an admin, learn how to manage your team's workspace and submit expenses yourself.",
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-manage-team-v2.mp4`,
thumbnailUrl: `${CLOUDFRONT_URL}/images/guided-setup-manage-team.jpg`,
duration: 55,
width: 1280,
height: 960,
},
tasks: [
{
type: 'meetSetupSpecialist',
autoCompleted: false,
title: 'Meet your setup specialist',
description:
'*Meet your setup specialist* who can answer any questions as you get started with Expensify. Yes, a real human!' +
'\n' +
'Chat with them in your #admins room or schedule a call today.',
},
{
type: 'reviewWorkspaceSettings',
autoCompleted: false,
title: 'Review your workspace settings',
description:
"Here's how to review and update your workspace settings:" +
'\n' +
'1. Click your profile picture.' +
'2. Click *Workspaces* > [Your workspace].' +
'\n' +
"Make any changes there and we'll track them in the #admins room.",
},
{
type: 'submitExpense',
autoCompleted: false,
title: 'Submit an expense',
description:
'*Submit an expense* by entering an amount or scanning a receipt.\n' +
'\n' +
'Here’s how to submit an expense:\n' +
'\n' +
'1. Click the green *+* button.\n' +
'2. Choose *Submit expense*.\n' +
'3. Enter an amount or scan a receipt.\n' +
'4. Add your reimburser to the request.\n' +
'\n' +
'Then, send your request and wait for that sweet “Cha-ching!” when it’s complete.',
},
],
},
[onboardingChoices.LOOKING_AROUND]: {
message:
"Expensify is best known for expense and corporate card management, but we do a lot more than that. Let me know what you're interested in and I'll help get you started.",
tasks: [],
},
} satisfies Record<OnboardingPurposeType, OnboardingMessageType>,
} satisfies Record<OnboardingPurpose, OnboardingMessage>,

COMBINED_TRACK_SUBMIT_ONBOARDING_MESSAGES: {
[combinedTrackSubmitOnboardingChoices.PERSONAL_SPEND]: combinedTrackSubmitOnboardingPersonalSpendMessage,
[combinedTrackSubmitOnboardingChoices.EMPLOYER]: combinedTrackSubmitOnboardingEmployerOrSubmitMessage,
[combinedTrackSubmitOnboardingChoices.SUBMIT]: combinedTrackSubmitOnboardingEmployerOrSubmitMessage,
} satisfies Record<ValueOf<typeof combinedTrackSubmitOnboardingChoices>, OnboardingMessageType>,
} satisfies Record<ValueOf<typeof combinedTrackSubmitOnboardingChoices>, OnboardingMessage>,

REPORT_FIELD_TITLE_FIELD_ID: 'text_title',

Expand Down Expand Up @@ -6246,14 +6303,14 @@ export type {
Country,
IOUAction,
IOUType,
OnboardingPurposeType,
OnboardingCompanySizeType,
OnboardingPurpose,
OnboardingCompanySize,
IOURequestType,
SubscriptionType,
FeedbackSurveyOptionID,
CancellationType,
OnboardingInviteType,
OnboardingAccountingType,
OnboardingInvite,
OnboardingAccounting,
};

export default CONST;
8 changes: 4 additions & 4 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {ValueOf} from 'type-fest';
import type CONST from './CONST';
import type {OnboardingCompanySizeType, OnboardingPurposeType} from './CONST';
import type {OnboardingCompanySize} from './CONST';
import type Platform from './libs/getPlatform/types';
import type * as FormTypes from './types/form';
import type * as OnyxTypes from './types/onyx';
Expand Down Expand Up @@ -982,9 +982,9 @@ type OnyxValuesMapping = {
[ONYXKEYS.MAX_CANVAS_AREA]: number;
[ONYXKEYS.MAX_CANVAS_HEIGHT]: number;
[ONYXKEYS.MAX_CANVAS_WIDTH]: number;
[ONYXKEYS.ONBOARDING_PURPOSE_SELECTED]: OnboardingPurposeType;
[ONYXKEYS.ONBOARDING_COMPANY_SIZE]: OnboardingCompanySizeType;
[ONYXKEYS.ONBOARDING_CUSTOM_CHOICES]: OnboardingPurposeType[] | [];
[ONYXKEYS.ONBOARDING_PURPOSE_SELECTED]: OnyxTypes.OnboardingPurpose;
[ONYXKEYS.ONBOARDING_COMPANY_SIZE]: OnboardingCompanySize;
[ONYXKEYS.ONBOARDING_CUSTOM_CHOICES]: OnyxTypes.OnboardingPurpose[] | [];
[ONYXKEYS.ONBOARDING_ERROR_MESSAGE]: string;
[ONYXKEYS.ONBOARDING_POLICY_ID]: string;
[ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID]: string;
Expand Down
9 changes: 5 additions & 4 deletions src/libs/API/parameters/CompleteGuidedSetupParams.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import type {OnboardingAccountingType, OnboardingCompanySizeType, OnboardingPurposeType} from '@src/CONST';
import type {OnboardingAccounting, OnboardingCompanySize} from '@src/CONST';
import type {OnboardingPurpose} from '@src/types/onyx';

type CompleteGuidedSetupParams = {
firstName: string;
lastName: string;
actorAccountID: number;
guidedSetupData: string;
engagementChoice: OnboardingPurposeType;
engagementChoice: OnboardingPurpose;
paymentSelected?: string;
companySize?: OnboardingCompanySizeType;
userReportedIntegration?: OnboardingAccountingType;
companySize?: OnboardingCompanySize;
userReportedIntegration?: OnboardingAccounting;
policyID?: string;
};

Expand Down
1 change: 1 addition & 0 deletions src/libs/API/parameters/OpenReportParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type OpenReportParams = {
chatType?: string;
optimisticAccountIDList?: string;
file?: File | CustomRNImageManipulatorResult;
guidedSetupData?: string;
};

export default OpenReportParams;
4 changes: 2 additions & 2 deletions src/libs/TourUtils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {ValueOf} from 'type-fest';
import CONST from '@src/CONST';
import type {OnboardingPurposeType} from '@src/CONST';
import type {OnboardingPurpose} from '@src/CONST';

function getNavatticURL(environment: ValueOf<typeof CONST.ENVIRONMENT>, introSelected?: OnboardingPurposeType) {
function getNavatticURL(environment: ValueOf<typeof CONST.ENVIRONMENT>, introSelected?: OnboardingPurpose) {
const adminTourURL = environment === CONST.ENVIRONMENT.PRODUCTION ? CONST.NAVATTIC.ADMIN_TOUR_PRODUCTION : CONST.NAVATTIC.ADMIN_TOUR_STAGING;
const employeeTourURL = environment === CONST.ENVIRONMENT.PRODUCTION ? CONST.NAVATTIC.EMPLOYEE_TOUR_PRODUCTION : CONST.NAVATTIC.EMPLOYEE_TOUR_STAGING;
return introSelected === CONST.SELECTABLE_ONBOARDING_CHOICES.MANAGE_TEAM ? adminTourURL : employeeTourURL;
Expand Down
6 changes: 3 additions & 3 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7379,12 +7379,12 @@ function completePaymentOnboarding(paymentSelected: ValueOf<typeof CONST.PAYMENT
const personalDetailsListValues = Object.values(OptionsListUtils.getPersonalDetailsForAccountIDs(session?.accountID ? [session.accountID] : [], personalDetailsList));
const personalDetails = personalDetailsListValues.at(0);

let onboardingPurpose = introSelected.choice;
if (introSelected.inviteType === CONST.ONBOARDING_INVITE_TYPES.IOU && paymentSelected === CONST.IOU.PAYMENT_SELECTED.BBA) {
let onboardingPurpose = introSelected?.choice;
if (introSelected?.inviteType === CONST.ONBOARDING_INVITE_TYPES.IOU && paymentSelected === CONST.IOU.PAYMENT_SELECTED.BBA) {
onboardingPurpose = CONST.ONBOARDING_CHOICES.MANAGE_TEAM;
}

if (introSelected.inviteType === CONST.ONBOARDING_INVITE_TYPES.INVOICE && paymentSelected !== CONST.IOU.PAYMENT_SELECTED.BBA) {
if (introSelected?.inviteType === CONST.ONBOARDING_INVITE_TYPES.INVOICE && paymentSelected !== CONST.IOU.PAYMENT_SELECTED.BBA) {
onboardingPurpose = CONST.ONBOARDING_CHOICES.CHAT_SPLIT;
}

Expand Down
Loading
Loading