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

Update custom messages in the onboarding flow #40328

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
22 changes: 6 additions & 16 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3551,8 +3551,7 @@ const CONST = {

ONBOARDING_CONCIERGE: {
[onboardingChoices.TRACK]:
"# Welcome to Expensify, let's start tracking your expenses!\n" +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
"# Let's start tracking your expenses!\n" +
'\n' +
"To track your expenses, create a workspace to keep everything in one place. Here's how:\n" +
'1. From the home screen, click the green + button > New Workspace\n' +
Expand All @@ -3565,26 +3564,23 @@ const CONST = {
'\n' +
"We'll store all expenses in your new workspace for easy access. Let me know if you have any questions!",
[onboardingChoices.EMPLOYER]:
'# Welcome to Expensify, the fastest way to get paid back!\n' +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
'# Expensify is the fastest way to get paid back!\n' +
'\n' +
'To submit expenses for reimbursement:\n' +
'1. From the home screen, click the green + button > Request money.\n' +
"2. Enter an amount or scan a receipt, then input your boss's email.\n" +
'\n' +
"That'll send a request to get you paid back. Let me know if you have any questions!",
[onboardingChoices.MANAGE_TEAM]:
"# Welcome to Expensify, let's start managing your team's expenses!\n" +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
"# Let's start managing your team's expenses!\n" +
'\n' +
"To manage your team's expenses, create a workspace to keep everything in one place. Here's how:\n" +
'1. From the home screen, click the green + button > New Workspace\n' +
'2. Give your workspace a name (e.g. “Sales team expenses”).\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielrvidal @MariaHCD There are some inconsistencies in the double quotation marks. Here, we are using the Left Double Quotation Mark and the Right Double Quotation Mark in “Sales team expenses”, IMO, it should just use the simple quotation mark like other CONSTs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same inconsistency is with Track my business expenses to file taxes copy.

In the description, we have below text for the second point:

  1. Give your workspace a name (e.g. "My business expenses”).

But here for the "My business expenses”, we are using simple quotation marks for the opening and for closing, we are using different quotation marks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For: Track and budget personal spend

'2. Give your workspace a name (e.g. "My expenses”).\n' +

It should have used same quotation marks in "My expenses”

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, let's use the simple quotation marks in all the copy here 👍🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

'\n' +
'Then, invite your team to your workspace via the Members pane and connect a business bank account to reimburse them. Let me know if you have any questions!',
'Then, invite your team to your workspace via the Members pane and [connect a business bank account](https://help.expensify.com/articles/new-expensify/bank-accounts/Connect-a-Bank-Account) to reimburse them. Let me know if you have any questions!',
[onboardingChoices.PERSONAL_SPEND]:
"# Welcome to Expensify, let's start tracking your expenses!\n" +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
"# Let's start tracking your expenses! \n" +
'\n' +
"To track your expenses, create a workspace to keep everything in one place. Here's how:\n" +
'1. From the home screen, click the green + button > New Workspace\n' +
Expand All @@ -3597,19 +3593,13 @@ const CONST = {
'\n' +
"We'll store all expenses in your new workspace for easy access. Let me know if you have any questions!",
[onboardingChoices.CHAT_SPLIT]:
'# Welcome to Expensify, where splitting the bill is an easy conversation!\n' +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
'# Splitting the bill is as easy as a conversation!\n' +
'\n' +
'To split an expense:\n' +
'1. From the home screen, click the green + button > Request money.\n' +
'2. Enter an amount or scan a receipt, then choose who you want to split it with.\n' +
'\n' +
"We'll send a request to each person so they can pay you back. Let me know if you have any questions!",
[onboardingChoices.LOOKING_AROUND]:
'# Welcome to Expensify!\n' +
"Hi there, I'm Concierge. Chat with me here for anything you need.\n" +
'\n' +
"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.",
},

REPORT_FIELD_TITLE_FIELD_ID: 'text_title',
Expand Down
23 changes: 22 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2941,8 +2941,28 @@ function getReportPrivateNote(reportID: string | undefined) {
* - Sets the introSelected NVP to the choice the user made
* - Creates an optimistic report comment from concierge
*/
function completeEngagementModal(text: string, choice: ValueOf<typeof CONST.ONBOARDING_CHOICES>) {
function completeEngagementModal(choice: ValueOf<typeof CONST.ONBOARDING_CHOICES>, text?: string) {
const conciergeAccountID = PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.CONCIERGE])[0];

if (!text) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tienifr Please add a comment here on why we added this logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

const parameters: CompleteEngagementModalParams = {
reportID: conciergeChatReportID ?? '',
engagementChoice: choice,
};

const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_INTRO_SELECTED,
value: {choice},
},
];
API.write(WRITE_COMMANDS.COMPLETE_ENGAGEMENT_MODAL, parameters, {
optimisticData,
});
return;
}

const reportComment = ReportUtils.buildOptimisticAddCommentReportAction(text, undefined, conciergeAccountID);
const reportCommentAction: OptimisticAddCommentReportAction = reportComment.reportAction;
const lastComment = reportCommentAction?.message?.[0];
Expand Down Expand Up @@ -3007,6 +3027,7 @@ function completeEngagementModal(text: string, choice: ValueOf<typeof CONST.ONBO
},
];

// eslint-disable-next-line rulesdir/no-multiple-api-calls
API.write(WRITE_COMMANDS.COMPLETE_ENGAGEMENT_MODAL, parameters, {
optimisticData,
successData,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/OnboardEngagement/ManageTeamsExpensesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function ManageTeamsExpensesModal() {
);

const completeEngagement = () => {
Report.completeEngagementModal(messageCopy, CONST.INTRO_CHOICES.MANAGE_TEAM);
Report.completeEngagementModal(CONST.INTRO_CHOICES.MANAGE_TEAM, messageCopy);
Report.navigateToConciergeChat();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function PurposeForUsingExpensifyModal() {
return Navigation.navigate(ROUTES.ONBOARD_MANAGE_EXPENSES);
}

Report.completeEngagementModal(message, choice);
Report.completeEngagementModal(choice, message);
Report.navigateToConciergeChat(true);
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, on
return;
}

Report.completeEngagementModal(CONST.ONBOARDING_CONCIERGE[selectedPurpose], selectedPurpose);
Report.completeEngagementModal(selectedPurpose, CONST.ONBOARDING_CONCIERGE[selectedPurpose]);

Navigation.dismissModal();
// Only navigate to concierge chat when central pane is visible
Expand Down
Loading