From 7b2ab30b9f8164f7227277dd1a9ca5dd78dcd249 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 00:29:41 -0700 Subject: [PATCH 1/7] update mentionComment to use const value --- src/CONST.ts | 1 + src/libs/actions/Report.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 6517ece4276d..36bf9815220e 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3778,6 +3778,7 @@ const CONST = { }, ONBOARDING_MESSAGES: { + onboardingIntroduction: 'Let’s get you set up 🔧', [onboardingChoices.EMPLOYER]: { message: 'Getting paid back is as easy as sending a message. Let’s go over the basics.', video: { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 91a0ce5da930..f7b33f0bef36 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3076,7 +3076,7 @@ function completeOnboarding( // Mention message const mentionHandle = LoginUtils.isEmailPublicDomain(login) ? login : login.split('@')[0]; - const mentionComment = ReportUtils.buildOptimisticAddCommentReportAction(`Hey @${mentionHandle} 👋`, undefined, actorAccountID); + const mentionComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ONBOARDING_MESSAGES.onboardingIntroduction, undefined, actorAccountID); const mentionCommentAction: OptimisticAddCommentReportAction = mentionComment.reportAction; const mentionMessage: AddCommentOrAttachementParams = { reportID: targetChatReportID, From cbf477585a66e6849cf91f3cbca1e2b58b76cd96 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 00:30:34 -0700 Subject: [PATCH 2/7] rename var for clarity and update comment --- src/libs/actions/Report.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index f7b33f0bef36..ba19cc9ab964 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3074,14 +3074,12 @@ function completeOnboarding( const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {}; - // Mention message - const mentionHandle = LoginUtils.isEmailPublicDomain(login) ? login : login.split('@')[0]; - const mentionComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ONBOARDING_MESSAGES.onboardingIntroduction, undefined, actorAccountID); - const mentionCommentAction: OptimisticAddCommentReportAction = mentionComment.reportAction; - const mentionMessage: AddCommentOrAttachementParams = { + // Introductary message + const introductionCommentAction: OptimisticAddCommentReportAction = introductionComment.reportAction; + const introductionMessage: AddCommentOrAttachementParams = { reportID: targetChatReportID, - reportActionID: mentionCommentAction.reportActionID, - reportComment: mentionComment.commentText, + reportActionID: introductionCommentAction.reportActionID, + reportComment: introductionComment.commentText, }; // Text message @@ -3257,7 +3255,7 @@ function completeOnboarding( onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`, value: { - [mentionCommentAction.reportActionID]: mentionCommentAction as ReportAction, + [introductionCommentAction.reportActionID]: introductionCommentAction as ReportAction, [textCommentAction.reportActionID]: textCommentAction as ReportAction, }, }, @@ -3272,7 +3270,7 @@ function completeOnboarding( onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`, value: { - [mentionCommentAction.reportActionID]: {pendingAction: null}, + [introductionCommentAction.reportActionID]: {pendingAction: null}, [textCommentAction.reportActionID]: {pendingAction: null}, }, }, @@ -3306,7 +3304,7 @@ function completeOnboarding( onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`, value: { - [mentionCommentAction.reportActionID]: { + [introductionCommentAction.reportActionID]: { errors: ErrorUtils.getMicroSecondOnyxError('report.genericAddCommentFailureMessage'), } as ReportAction, [textCommentAction.reportActionID]: { @@ -3322,7 +3320,7 @@ function completeOnboarding( ]; const guidedSetupData: GuidedSetupData = [ - {type: 'message', ...mentionMessage}, + {type: 'message', ...introductionMessage}, {type: 'message', ...textMessage}, ]; From b29f695765bfb2dbda90ba95231c90eef7bb6c88 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 01:29:29 -0700 Subject: [PATCH 3/7] lint & type fix --- src/CONST.ts | 2 +- src/libs/actions/Report.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 36bf9815220e..d0dbbf651556 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3735,6 +3735,7 @@ const CONST = { WELCOME_VIDEO_URL: `${CLOUDFRONT_URL}/videos/intro-1280.mp4`, + ONBOARDING_INTRODUCTION: 'Let’s get you set up 🔧', ONBOARDING_CHOICES: {...onboardingChoices}, ONBOARDING_CONCIERGE: { @@ -3778,7 +3779,6 @@ const CONST = { }, ONBOARDING_MESSAGES: { - onboardingIntroduction: 'Let’s get you set up 🔧', [onboardingChoices.EMPLOYER]: { message: 'Getting paid back is as easy as sending a message. Let’s go over the basics.', video: { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index ba19cc9ab964..2fd84b29b32a 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -58,7 +58,6 @@ import * as EmojiUtils from '@libs/EmojiUtils'; import * as Environment from '@libs/Environment/Environment'; import * as ErrorUtils from '@libs/ErrorUtils'; import Log from '@libs/Log'; -import * as LoginUtils from '@libs/LoginUtils'; import Navigation, {navigationRef} from '@libs/Navigation/Navigation'; import type {NetworkStatus} from '@libs/NetworkConnection'; import LocalNotification from '@libs/Notification/LocalNotification'; @@ -3075,6 +3074,7 @@ function completeOnboarding( const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {}; // Introductary message + const introductionComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ONBOARDING_INTRODUCTION, undefined, actorAccountID); const introductionCommentAction: OptimisticAddCommentReportAction = introductionComment.reportAction; const introductionMessage: AddCommentOrAttachementParams = { reportID: targetChatReportID, From 45d60a8d0602950816e9f1c8ac00c3c8c1f3a747 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 01:33:27 -0700 Subject: [PATCH 4/7] typo --- src/libs/actions/Report.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 2fd84b29b32a..0c85708bed33 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3073,7 +3073,7 @@ function completeOnboarding( const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {}; - // Introductary message + // Introductory message const introductionComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ONBOARDING_INTRODUCTION, undefined, actorAccountID); const introductionCommentAction: OptimisticAddCommentReportAction = introductionComment.reportAction; const introductionMessage: AddCommentOrAttachementParams = { From 99f6d2b01ebffa1d14ec5a272e1c2b9eac7f0672 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 09:44:17 -0700 Subject: [PATCH 5/7] remove unused var --- src/libs/actions/Report.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 0c85708bed33..f160906178d5 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3058,11 +3058,9 @@ function completeOnboarding( engagementChoice: OnboardingPurposeType, data: ValueOf, { - login, firstName, lastName, }: { - login: string; firstName: string; lastName: string; }, From eac1aff619814a9b6ff8f8f09873b94413dce3ad Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 10:36:07 -0700 Subject: [PATCH 6/7] remove unused var --- .../OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx b/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx index 3a8212cad5a5..abddbc35866e 100644 --- a/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx +++ b/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx @@ -54,7 +54,6 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat onboardingPurposeSelected, CONST.ONBOARDING_MESSAGES[onboardingPurposeSelected], { - login: currentUserPersonalDetails.login ?? '', firstName, lastName, }, From 159410feaf88d50ca23a6fc14eead5ab00dd5522 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 21 May 2024 11:51:50 -0700 Subject: [PATCH 7/7] remove unused dependency --- .../OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx b/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx index abddbc35866e..2260fc872270 100644 --- a/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx +++ b/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx @@ -79,7 +79,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat Navigation.navigate(ROUTES.WELCOME_VIDEO_ROOT); }, variables.welcomeVideoDelay); }, - [currentUserPersonalDetails.login, isSmallScreenWidth, onboardingPurposeSelected, onboardingAdminsChatReportID], + [isSmallScreenWidth, onboardingPurposeSelected, onboardingAdminsChatReportID], ); const validate = (values: FormOnyxValues<'onboardingPersonalDetailsForm'>) => {