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

[Self-guided tours][V2] Add tour links to onboarding tasks #51153

Merged
merged 10 commits into from
Nov 5, 2024
16 changes: 15 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ const signupQualifiers = {
SMB: 'smb',
} as const;

const selfGuidedTourTask: OnboardingTaskType = {
type: 'viewTour',
autoCompleted: false,
mountiny marked this conversation as resolved.
Show resolved Hide resolved
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 = {
message: 'Getting paid back is as easy as sending a message. Let’s go over the basics.',
video: {
Expand All @@ -99,6 +106,7 @@ const onboardingEmployerOrSubmitMessage: OnboardingMessageType = {
height: 960,
},
tasks: [
selfGuidedTourTask,
{
type: 'submitExpense',
autoCompleted: false,
Expand Down Expand Up @@ -264,6 +272,7 @@ type OnboardingTaskType = {
workspaceMembersLink: string;
integrationName: string;
workspaceAccountingLink: string;
navatticURL: string;
}>,
) => string);
};
Expand Down Expand Up @@ -4882,6 +4891,7 @@ const CONST = {
'\n' +
'*Your new workspace is ready! It’ll keep all of your spend (and chats) in one place.*',
},
selfGuidedTourTask,
{
type: 'meetGuide',
autoCompleted: false,
Expand Down Expand Up @@ -4986,7 +4996,10 @@ const CONST = {
},
],
},
[onboardingChoices.PERSONAL_SPEND]: onboardingPersonalSpendMessage,
[onboardingChoices.PERSONAL_SPEND]: {
...onboardingPersonalSpendMessage,
tasks: [selfGuidedTourTask, ...onboardingPersonalSpendMessage.tasks],
},
[onboardingChoices.CHAT_SPLIT]: {
message: 'Splitting bills with friends is as easy as sending a message. Here’s how.',
video: {
Expand All @@ -4997,6 +5010,7 @@ const CONST = {
height: 960,
},
tasks: [
selfGuidedTourTask,
{
type: 'startChat',
autoCompleted: false,
Expand Down
10 changes: 9 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import DateUtils from '@libs/DateUtils';
import {prepareDraftComment} from '@libs/DraftCommentUtils';
import * as EmojiUtils from '@libs/EmojiUtils';
import * as Environment from '@libs/Environment/Environment';
import getEnvironment from '@libs/Environment/getEnvironment';
import type EnvironmentType from '@libs/Environment/getEnvironment/types';
import * as ErrorUtils from '@libs/ErrorUtils';
import fileDownload from '@libs/fileDownload';
import HttpUtils from '@libs/HttpUtils';
Expand All @@ -84,6 +86,7 @@ import type {OptimisticAddCommentReportAction} from '@libs/ReportUtils';
import * as ReportUtils from '@libs/ReportUtils';
import {doesReportBelongToWorkspace} from '@libs/ReportUtils';
import shouldSkipDeepLinkNavigation from '@libs/shouldSkipDeepLinkNavigation';
import {getNavatticURL} from '@libs/TourUtils';
import Visibility from '@libs/Visibility';
import CONFIG from '@src/CONFIG';
import type {OnboardingAccountingType, OnboardingCompanySizeType, OnboardingPurposeType} from '@src/CONST';
Expand Down Expand Up @@ -281,6 +284,11 @@ Onyx.connect({
let environmentURL: string;
Environment.getEnvironmentURL().then((url: string) => (environmentURL = url));

let environment: EnvironmentType;
getEnvironment().then((env) => {
environment = env;
});

registerPaginationConfig({
initialCommand: WRITE_COMMANDS.OPEN_REPORT,
previousCommand: READ_COMMANDS.GET_OLDER_ACTIONS,
Expand Down Expand Up @@ -3436,7 +3444,6 @@ function completeOnboarding(
reportComment: videoComment.commentText,
};
}

const tasksData = data.tasks
.filter((task) => {
if (task.type === 'addAccountingIntegration' && !userReportedIntegration) {
Expand All @@ -3452,6 +3459,7 @@ function completeOnboarding(
workspaceCategoriesLink: `${environmentURL}/${ROUTES.WORKSPACE_CATEGORIES.getRoute(onboardingPolicyID ?? '-1')}`,
workspaceMembersLink: `${environmentURL}/${ROUTES.WORKSPACE_MEMBERS.getRoute(onboardingPolicyID ?? '-1')}`,
workspaceMoreFeaturesLink: `${environmentURL}/${ROUTES.WORKSPACE_MORE_FEATURES.getRoute(onboardingPolicyID ?? '-1')}`,
navatticURL: getNavatticURL(environment, engagementChoice),
integrationName,
workspaceAccountingLink: `${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(onboardingPolicyID ?? '-1')}`,
})
Expand Down
Loading