@@ -100,8 +100,6 @@ import {
100100 getDeletedParentActionMessageForChatReport ,
101101 getDeletedTransactionMessage ,
102102 getDisplayNameForParticipant ,
103- getDowngradeWorkspaceMessage ,
104- getForcedCorporateUpgradeMessage ,
105103 getIcons ,
106104 getMovedActionMessage ,
107105 getMovedTransactionMessage ,
@@ -110,14 +108,12 @@ import {
110108 getPolicyName ,
111109 getReimbursementDeQueuedOrCanceledActionMessage ,
112110 getReimbursementQueuedActionMessage ,
113- getRejectedReportMessage ,
114111 getReportLastMessage ,
115112 getReportNotificationPreference ,
116113 getReportOrDraftReport ,
117114 getReportPreviewMessage ,
118115 getReportSubtitlePrefix ,
119116 getUnreportedTransactionMessage ,
120- getUpgradeWorkspaceMessage ,
121117 hasIOUWaitingOnCurrentUserBankAccount ,
122118 isArchivedNonExpenseReport ,
123119 isChatThread ,
@@ -684,9 +680,9 @@ function getLastMessageTextForReport({
684680 lastMessageTextFromReport = formatReportLastMessageText ( Parser . htmlToText ( reportPreviewMessage ) ) ;
685681 }
686682 } else if ( isReimbursementQueuedAction ( lastReportAction ) ) {
687- lastMessageTextFromReport = getReimbursementQueuedActionMessage ( { reportAction : lastReportAction , formatPhoneNumber : formatPhoneNumberPhoneUtils , reportOrID : report } ) ;
683+ lastMessageTextFromReport = getReimbursementQueuedActionMessage ( { reportAction : lastReportAction , translate , formatPhoneNumber : formatPhoneNumberPhoneUtils , report} ) ;
688684 } else if ( isReimbursementDeQueuedOrCanceledAction ( lastReportAction ) ) {
689- lastMessageTextFromReport = getReimbursementDeQueuedOrCanceledActionMessage ( lastReportAction , report ) ;
685+ lastMessageTextFromReport = getReimbursementDeQueuedOrCanceledActionMessage ( translate , lastReportAction , report ) ;
690686 } else if ( isDeletedParentAction ( lastReportAction ) && reportUtilsIsChatReport ( report ) ) {
691687 lastMessageTextFromReport = getDeletedParentActionMessageForChatReport ( lastReportAction ) ;
692688 } else if ( isPendingRemove ( lastReportAction ) && report ?. reportID && isThreadParentMessage ( lastReportAction , report . reportID ) ) {
@@ -705,7 +701,7 @@ function getLastMessageTextForReport({
705701 } ) ;
706702 lastMessageTextFromReport = formatReportLastMessageText ( properSchemaForModifiedExpenseMessage , true ) ;
707703 } else if ( isMovedTransactionAction ( lastReportAction ) ) {
708- lastMessageTextFromReport = Parser . htmlToText ( getMovedTransactionMessage ( lastReportAction ) ) ;
704+ lastMessageTextFromReport = Parser . htmlToText ( getMovedTransactionMessage ( translate , lastReportAction ) ) ;
709705 } else if ( isTaskAction ( lastReportAction ) ) {
710706 lastMessageTextFromReport = formatReportLastMessageText ( getTaskReportActionMessage ( translate , lastReportAction ) . text ) ;
711707 } else if ( isCreatedTaskReportAction ( lastReportAction ) ) {
@@ -745,13 +741,13 @@ function getLastMessageTextForReport({
745741 lastMessageTextFromReport = translate ( 'iou.forwarded' ) ;
746742 }
747743 } else if ( lastReportAction ?. actionName === CONST . REPORT . ACTIONS . TYPE . REJECTED ) {
748- lastMessageTextFromReport = getRejectedReportMessage ( ) ;
744+ lastMessageTextFromReport = translate ( 'iou.rejectedThisReport' ) ;
749745 } else if ( lastReportAction ?. actionName === CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . CORPORATE_UPGRADE ) {
750- lastMessageTextFromReport = getUpgradeWorkspaceMessage ( ) ;
746+ lastMessageTextFromReport = translate ( 'workspaceActions.upgradedWorkspace' ) ;
751747 } else if ( lastReportAction ?. actionName === CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . CORPORATE_FORCE_UPGRADE ) {
752- lastMessageTextFromReport = Parser . htmlToText ( getForcedCorporateUpgradeMessage ( ) ) ;
748+ lastMessageTextFromReport = Parser . htmlToText ( translate ( 'workspaceActions.forcedCorporateUpgrade' ) ) ;
753749 } else if ( lastReportAction ?. actionName === CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . TEAM_DOWNGRADE ) {
754- lastMessageTextFromReport = getDowngradeWorkspaceMessage ( ) ;
750+ lastMessageTextFromReport = translate ( 'workspaceActions.downgradedWorkspace' ) ;
755751 } else if ( isActionableAddPaymentCard ( lastReportAction ) ) {
756752 lastMessageTextFromReport = getReportActionMessageText ( lastReportAction ) ;
757753 } else if ( lastReportAction ?. actionName === CONST . REPORT . ACTIONS . TYPE . EXPORTED_TO_INTEGRATION ) {
@@ -775,45 +771,40 @@ function getLastMessageTextForReport({
775771 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . REOPENED ) ) {
776772 lastMessageTextFromReport = translate ( 'iou.reopened' ) ;
777773 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . CHANGE_POLICY ) ) {
778- lastMessageTextFromReport = getPolicyChangeMessage ( lastReportAction ) ;
774+ lastMessageTextFromReport = getPolicyChangeMessage ( translate , lastReportAction ) ;
779775 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . TRAVEL_UPDATE ) ) {
780776 lastMessageTextFromReport = getTravelUpdateMessage ( translate , lastReportAction ) ;
781777 } else if ( isInviteOrRemovedAction ( lastReportAction ) ) {
782778 lastMessageTextFromReport = getRoomChangeLogMessage ( translate , lastReportAction ) ;
783779 } else if ( isRenamedAction ( lastReportAction ) ) {
784780 lastMessageTextFromReport = getRenamedAction ( translate , lastReportAction , isExpenseReport ( report ) ) ;
785781 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . DELETED_TRANSACTION ) ) {
786- lastMessageTextFromReport = getDeletedTransactionMessage ( lastReportAction ) ;
782+ lastMessageTextFromReport = getDeletedTransactionMessage ( translate , lastReportAction ) ;
787783 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . TAKE_CONTROL ) || isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . REROUTE ) ) {
788784 lastMessageTextFromReport = Parser . htmlToText ( getChangedApproverActionMessage ( translate , lastReportAction ) ) ;
789785 } else if ( isMovedAction ( lastReportAction ) ) {
790- lastMessageTextFromReport = Parser . htmlToText ( getMovedActionMessage ( lastReportAction , report ) ) ;
786+ lastMessageTextFromReport = Parser . htmlToText ( getMovedActionMessage ( translate , lastReportAction , report ) ) ;
791787 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . UNREPORTED_TRANSACTION ) ) {
792- lastMessageTextFromReport = Parser . htmlToText ( getUnreportedTransactionMessage ( lastReportAction ) ) ;
788+ lastMessageTextFromReport = Parser . htmlToText ( getUnreportedTransactionMessage ( translate , lastReportAction ) ) ;
793789 } else if ( isActionableMentionWhisper ( lastReportAction ) ) {
794790 lastMessageTextFromReport = Parser . htmlToText ( getActionableMentionWhisperMessage ( translate , lastReportAction ) ) ;
795791 } else if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . DYNAMIC_EXTERNAL_WORKFLOW_ROUTED ) ) {
796792 lastMessageTextFromReport = getDynamicExternalWorkflowRoutedMessage ( lastReportAction , translate ) ;
797793 }
798794 if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . UPDATE_MAX_EXPENSE_AMOUNT ) ) {
799- // eslint-disable-next-line @typescript-eslint/no-deprecated
800- lastMessageTextFromReport = getPolicyChangeLogMaxExpenseAmountMessage ( translateLocal , lastReportAction ) ;
795+ lastMessageTextFromReport = getPolicyChangeLogMaxExpenseAmountMessage ( translate , lastReportAction ) ;
801796 }
802797 if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . UPDATE_MAX_EXPENSE_AGE ) ) {
803- // eslint-disable-next-line @typescript-eslint/no-deprecated
804- lastMessageTextFromReport = getPolicyChangeLogMaxExpenseAgeMessage ( translateLocal , lastReportAction ) ;
798+ lastMessageTextFromReport = getPolicyChangeLogMaxExpenseAgeMessage ( translate , lastReportAction ) ;
805799 }
806800 if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . UPDATE_ACH_ACCOUNT ) ) {
807- // eslint-disable-next-line @typescript-eslint/no-deprecated
808- lastMessageTextFromReport = getUpdateACHAccountMessage ( translateLocal , lastReportAction ) ;
801+ lastMessageTextFromReport = getUpdateACHAccountMessage ( translate , lastReportAction ) ;
809802 }
810803 if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . UPDATE_INVOICE_COMPANY_NAME ) ) {
811- // eslint-disable-next-line @typescript-eslint/no-deprecated
812- lastMessageTextFromReport = getInvoiceCompanyNameUpdateMessage ( translateLocal , lastReportAction ) ;
804+ lastMessageTextFromReport = getInvoiceCompanyNameUpdateMessage ( translate , lastReportAction ) ;
813805 }
814806 if ( isActionOfType ( lastReportAction , CONST . REPORT . ACTIONS . TYPE . POLICY_CHANGE_LOG . UPDATE_INVOICE_COMPANY_WEBSITE ) ) {
815- // eslint-disable-next-line @typescript-eslint/no-deprecated
816- lastMessageTextFromReport = getInvoiceCompanyWebsiteUpdateMessage ( translateLocal , lastReportAction ) ;
807+ lastMessageTextFromReport = getInvoiceCompanyWebsiteUpdateMessage ( translate , lastReportAction ) ;
817808 }
818809
819810 // we do not want to show report closed in LHN for non archived report so use getReportLastMessage as fallback instead of lastMessageText from report
0 commit comments