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

feature: Add deeplinks to workspace editor in the onboarding checklist tasks #44367

Merged
merged 3 commits into from
Jul 3, 2024
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
12 changes: 6 additions & 6 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3917,13 +3917,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 @@ -3934,13 +3934,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 @@ -3951,13 +3951,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 @@ -3143,6 +3143,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 @@ -3186,6 +3187,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>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing docs @nkdengineer can you please add some simple log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mountiny I updated.

};

type BaseOnboardingPersonalDetailsProps = WithCurrentUserPersonalDetailsProps &
Expand Down
Loading