Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
50 changes: 20 additions & 30 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const selfGuidedTourTask: OnboardingTask = {
type: 'viewTour',
autoCompleted: false,
mediaAttributes: {},
title: 'Take a 2-minute tour',
title: ({navatticURL}) => `Take a [2-minute tour](${navatticURL})`,
description: ({navatticURL}) => `[Take a self-guided product tour](${navatticURL}) and learn about everything Expensify has to offer.`,
};

Expand All @@ -147,7 +147,7 @@ const setupCategoriesTask: OnboardingTask = {
mediaAttributes: {
[`${CLOUDFRONT_URL}/videos/walkthrough-categories-v2.mp4`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-categories.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
title: 'Set up categories',
title: ({workspaceCategoriesLink}) => `Set up [categories](${workspaceCategoriesLink})`,
description: ({workspaceCategoriesLink}) =>
'*Set up categories* so your team can code expenses for easy reporting.\n' +
'\n' +
Expand Down Expand Up @@ -285,32 +285,22 @@ const onboardingCompanySize = {

type OnboardingInvite = ValueOf<typeof onboardingInviteTypes>;

type OnboardingTaskLinks = Partial<{
integrationName: string;
workspaceSettingsLink: string;
workspaceCategoriesLink: string;
workspaceMoreFeaturesLink: string;
workspaceMembersLink: string;
workspaceAccountingLink: string;
navatticURL: string;
}>;

type OnboardingTask = {
type: string;
autoCompleted: boolean;
mediaAttributes: Record<string, string>;
title:
| string
| ((
params: Partial<{
integrationName: string;
workspaceSettingsLink: string;
}>,
) => string);
description:
| string
| ((
params: Partial<{
adminsRoomLink: string;
workspaceCategoriesLink: string;
workspaceMoreFeaturesLink: string;
workspaceMembersLink: string;
integrationName: string;
workspaceAccountingLink: string;
workspaceSettingsLink: string;
navatticURL: string;
}>,
) => string);
title: string | ((params: OnboardingTaskLinks) => string);
description: string | ((params: OnboardingTaskLinks) => string);
};

type OnboardingMessage = {
Expand Down Expand Up @@ -5273,7 +5263,7 @@ const CONST = {
type: 'setupCategoriesAndTags',
autoCompleted: false,
mediaAttributes: {},
title: 'Set up categories and tags',
title: ({workspaceCategoriesLink, workspaceMoreFeaturesLink}) => `Set up [categories](${workspaceCategoriesLink}) and [tags](${workspaceMoreFeaturesLink})`,
description: ({workspaceCategoriesLink, workspaceAccountingLink}) =>
'*Set up categories and tags* so your team can code expenses for easy reporting.\n' +
'\n' +
Expand All @@ -5283,7 +5273,7 @@ const CONST = {
{
type: 'setupTags',
autoCompleted: false,
title: 'Set up tags',
title: ({workspaceMoreFeaturesLink}) => `Set up [tags](${workspaceMoreFeaturesLink})`,
mediaAttributes: {
[`${CLOUDFRONT_URL}/videos/walkthrough-tags-v2.mp4`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-tags.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
Expand All @@ -5310,7 +5300,7 @@ const CONST = {
mediaAttributes: {
[`${CLOUDFRONT_URL}/videos/walkthrough-approvals-v2.mp4`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-approvals.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
title: 'Add expense approvals',
title: ({workspaceMoreFeaturesLink}) => `Add [expense approvals](${workspaceMoreFeaturesLink})`,
description: ({workspaceMoreFeaturesLink}) =>
'*Add expense approvals* to review your team’s spend and keep it under control.\n' +
'\n' +
Expand All @@ -5335,7 +5325,7 @@ const CONST = {
mediaAttributes: {
[`${CLOUDFRONT_URL}/videos/walkthrough-invite_members-v2.mp4`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-invite_members.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
title: 'Invite your team',
title: ({workspaceMembersLink}) => `Invite [your team](${workspaceMembersLink})`,
description: ({workspaceMembersLink}) =>
'*Invite your team* to Expensify so they can start tracking expenses today.\n' +
'\n' +
Expand Down Expand Up @@ -5366,7 +5356,7 @@ const CONST = {
connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.xero]
}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_xero.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
title: ({integrationName}) => `Connect to ${integrationName}`,
title: ({integrationName, workspaceAccountingLink}) => `Connect to [${integrationName}](${workspaceAccountingLink})`,
description: ({integrationName, workspaceAccountingLink}) =>
`Connect to ${integrationName} for automatic expense coding and syncing that makes month-end close a breeze.\n` +
'\n' +
Expand Down Expand Up @@ -5403,7 +5393,7 @@ const CONST = {
type: 'inviteAccountant',
autoCompleted: false,
mediaAttributes: {},
title: 'Invite your accountant',
title: ({workspaceMembersLink}) => `Invite your [accountant](${workspaceMembersLink})`,
description: ({workspaceMembersLink}) =>
'*Invite your accountant* to Expensify and share your expenses with them to make tax time easier.\n' +
'\n' +
Expand Down
32 changes: 12 additions & 20 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3869,6 +3869,16 @@ function prepareOnboardingOnyxData(
reportComment: textComment.commentText,
};

const onboardingTaskParams = {
integrationName,
workspaceSettingsLink: `${environmentURL}/${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID)}`,
workspaceCategoriesLink: `${environmentURL}/${ROUTES.WORKSPACE_CATEGORIES.getRoute(onboardingPolicyID)}`,
workspaceMembersLink: `${environmentURL}/${ROUTES.WORKSPACE_MEMBERS.getRoute(onboardingPolicyID)}`,
workspaceMoreFeaturesLink: `${environmentURL}/${ROUTES.WORKSPACE_MORE_FEATURES.getRoute(onboardingPolicyID)}`,
navatticURL: getNavatticURL(environment, engagementChoice),
workspaceAccountingLink: `${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(onboardingPolicyID)}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aren't we missing adminsRoomLink?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was not used anywhere

@getusha getusha Mar 21, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like we don't need it since it's a room and will be highlighted anyway. thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, as now the the onboarding tasks are being created in the adminsRoom itself, hence no need to add its link.

};

let createWorkspaceTaskReportID;
const tasksData = data.tasks
.filter((task) => {
Expand Down Expand Up @@ -3896,26 +3906,8 @@ function prepareOnboardingOnyxData(
return true;
})
.map((task, index) => {
const taskDescription =
typeof task.description === 'function'
? task.description({
adminsRoomLink: `${environmentURL}/${ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID)}`,
workspaceCategoriesLink: `${environmentURL}/${ROUTES.WORKSPACE_CATEGORIES.getRoute(onboardingPolicyID)}`,
workspaceMembersLink: `${environmentURL}/${ROUTES.WORKSPACE_MEMBERS.getRoute(onboardingPolicyID)}`,
workspaceMoreFeaturesLink: `${environmentURL}/${ROUTES.WORKSPACE_MORE_FEATURES.getRoute(onboardingPolicyID)}`,
navatticURL: getNavatticURL(environment, engagementChoice),
integrationName,
workspaceAccountingLink: `${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(onboardingPolicyID)}`,
workspaceSettingsLink: `${environmentURL}/${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID)}`,
})
: task.description;
const taskTitle =
typeof task.title === 'function'
? task.title({
integrationName,
workspaceSettingsLink: `${environmentURL}/${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID)}`,
})
: task.title;
const taskDescription = typeof task.description === 'function' ? task.description(onboardingTaskParams) : task.description;
const taskTitle = typeof task.title === 'function' ? task.title(onboardingTaskParams) : task.title;
const currentTask = buildOptimisticTaskReport(
actorAccountID,
targetChatReportID,
Expand Down