Skip to content

Commit

Permalink
Merge pull request #51926 from jaydamani/onboaring/combine-category-a…
Browse files Browse the repository at this point in the history
…nd-tag-task--51591

feature(onboarding): combine category and tag setup task for connections
  • Loading branch information
marcaaron authored Nov 15, 2024
2 parents 4bb19d7 + 6dc5507 commit 99bf554
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ type OnboardingTask = {
workspaceMembersLink: string;
integrationName: string;
workspaceAccountingLink: string;
workspaceSettingsLink: string;
navatticURL: string;
}>,
) => string);
Expand Down Expand Up @@ -4911,6 +4912,15 @@ const CONST = {
'\n' +
`Chat with the specialist in your [#admins room](${adminsRoomLink}).`,
},
{
type: 'setupCategoriesAndTags',
autoCompleted: false,
title: 'Set up categories and tags',
description: ({workspaceSettingsLink, workspaceAccountingLink}) =>
'*Set up categories and tags* so your team can code expenses for easy reporting.\n' +
'\n' +
`Import them automatically by [connecting your accounting software](${workspaceAccountingLink}), or set them up manually in your [workspace settings](${workspaceSettingsLink}).`,
},
{
type: 'setupCategories',
autoCompleted: false,
Expand Down
7 changes: 6 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3528,7 +3528,11 @@ function prepareOnboardingOptimisticData(
}
const tasksData = data.tasks
.filter((task) => {
if (task.type === 'addAccountingIntegration' && !userReportedIntegration) {
if (['setupCategories', 'setupTags'].includes(task.type) && userReportedIntegration) {
return false;
}

if (['addAccountingIntegration', 'setupCategoriesAndTags'].includes(task.type) && !userReportedIntegration) {
return false;
}
return true;
Expand All @@ -3544,6 +3548,7 @@ function prepareOnboardingOptimisticData(
navatticURL: getNavatticURL(environment, engagementChoice),
integrationName,
workspaceAccountingLink: `${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(onboardingPolicyID ?? '-1')}`,
workspaceSettingsLink: `${environmentURL}/${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID ?? '-1')}`,
})
: task.description;
const taskTitle =
Expand Down

0 comments on commit 99bf554

Please sign in to comment.