Skip to content

Commit

Permalink
Merge pull request #44367 from nkdengineer/fix/44017
Browse files Browse the repository at this point in the history
feature: Add deeplinks to workspace editor in the onboarding checklist tasks
  • Loading branch information
mountiny authored Jul 3, 2024
2 parents 32c29fc + b6cb57f commit 631976a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4081,13 +4081,13 @@ const CONST = {
type: 'setupCategories',
autoCompleted: false,
title: 'Set up categories',
description:
description: ({workspaceLink}: {workspaceLink: string}) =>
'*Set up categories* so your team can code expenses for easy reporting.\n' +
'\n' +
'Here’s how to set up categories:\n' +
'\n' +
'1. Click your profile picture.\n' +
'2. Go to *Workspaces* > [your workspace].\n' +
`2. Go to [*Workspaces* > [your workspace]](${workspaceLink}).\n` +
'3. Click *Categories*.\n' +
'4. Enable and disable default categories.\n' +
'5. Click *Add categories* to make your own.\n' +
Expand All @@ -4098,13 +4098,13 @@ const CONST = {
type: 'addExpenseApprovals',
autoCompleted: false,
title: 'Add expense approvals',
description:
description: ({workspaceLink}: {workspaceLink: string}) =>
'*Add expense approvals* to review your team’s spend and keep it under control.\n' +
'\n' +
'Here’s how to add expense approvals:\n' +
'\n' +
'1. Click your profile picture.\n' +
'2. Go to *Workspaces* > [your workspace].\n' +
`2. Go to [*Workspaces* > [your workspace]](${workspaceLink}).\n` +
'3. Click *More features*.\n' +
'4. Enable *Workflows*.\n' +
'5. In *Workflows*, enable *Add approvals*.\n' +
Expand All @@ -4115,13 +4115,13 @@ const CONST = {
type: 'inviteTeam',
autoCompleted: false,
title: 'Invite your team',
description:
description: ({workspaceLink}: {workspaceLink: string}) =>
'*Invite your team* to Expensify so they can start tracking expenses today.\n' +
'\n' +
'Here’s how to invite your team:\n' +
'\n' +
'1. Click your profile picture.\n' +
'2. Go to *Workspaces* > [your workspace].\n' +
`2. Go to [*Workspaces* > [your workspace]](${workspaceLink}).\n` +
'3. Click *Members* > *Invite member*.\n' +
'4. Enter emails or phone numbers. \n' +
'5. Add an invite message if you want.\n' +
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,7 @@ function completeOnboarding(
lastName: string;
},
adminsChatReportID?: string,
onboardingPolicyID?: string,
) {
const isAccountIDOdd = AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? 0);
const targetEmail = isAccountIDOdd ? CONST.EMAIL.NOTIFICATIONS : CONST.EMAIL.CONCIERGE;
Expand Down Expand Up @@ -3161,6 +3162,7 @@ function completeOnboarding(
typeof task.description === 'function'
? task.description({
adminsRoomLink: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID ?? '-1')}`,
workspaceLink: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID ?? '-1')}`,
})
: task.description;
const currentTask = ReportUtils.buildOptimisticTaskReport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ import ROUTES from '@src/ROUTES';
import INPUT_IDS from '@src/types/form/DisplayNameForm';
import type {BaseOnboardingPersonalDetailsOnyxProps, BaseOnboardingPersonalDetailsProps} from './types';

function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNativeStyles, onboardingPurposeSelected, onboardingAdminsChatReportID}: BaseOnboardingPersonalDetailsProps) {
function BaseOnboardingPersonalDetails({
currentUserPersonalDetails,
shouldUseNativeStyles,
onboardingPurposeSelected,
onboardingAdminsChatReportID,
onboardingPolicyID,
}: BaseOnboardingPersonalDetailsProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isSmallScreenWidth} = useWindowDimensions();
Expand Down Expand Up @@ -61,6 +67,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
lastName,
},
onboardingAdminsChatReportID ?? undefined,
onboardingPolicyID,
);

Welcome.setOnboardingAdminsChatReportID();
Expand All @@ -84,7 +91,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
Navigation.navigate(ROUTES.WELCOME_VIDEO_ROOT);
}, variables.welcomeVideoDelay);
},
[isSmallScreenWidth, onboardingPurposeSelected, onboardingAdminsChatReportID, accountID],
[onboardingPurposeSelected, onboardingAdminsChatReportID, onboardingPolicyID, isSmallScreenWidth, accountID],
);

const validate = (values: FormOnyxValues<'onboardingPersonalDetailsForm'>) => {
Expand Down Expand Up @@ -194,5 +201,8 @@ export default withCurrentUserPersonalDetails(
onboardingAdminsChatReportID: {
key: ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID,
},
onboardingPolicyID: {
key: ONYXKEYS.ONBOARDING_POLICY_ID,
},
})(BaseOnboardingPersonalDetails),
);
3 changes: 3 additions & 0 deletions src/pages/OnboardingPersonalDetails/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ type BaseOnboardingPersonalDetailsOnyxProps = {

/** Saved onboarding admin chat report ID */
onboardingAdminsChatReportID: OnyxEntry<string>;

/** Saved onboarding policy ID */
onboardingPolicyID: OnyxEntry<string>;
};

type BaseOnboardingPersonalDetailsProps = WithCurrentUserPersonalDetailsProps &
Expand Down

0 comments on commit 631976a

Please sign in to comment.