@@ -11,6 +11,7 @@ import type DeepValueOf from '@src/types/utils/DeepValueOf';
11
11
import { getNextApproverAccountID } from './actions/IOU' ;
12
12
import DateUtils from './DateUtils' ;
13
13
import EmailUtils from './EmailUtils' ;
14
+ import { getLoginsByAccountIDs } from './PersonalDetailsUtils' ;
14
15
import { getCorrectedAutoReportingFrequency , getReimburserAccountID } from './PolicyUtils' ;
15
16
import { getDisplayNameForParticipant , getPersonalDetailsForAccountID , isExpenseReport , isInvoiceReport , isPayer } from './ReportUtils' ;
16
17
@@ -66,8 +67,8 @@ function parseMessage(messages: Message[] | undefined) {
66
67
return `<next-step>${ formattedHtml } </next-step>` ;
67
68
}
68
69
69
- function getNextApproverDisplayName ( report : OnyxEntry < Report > ) {
70
- const approverAccountID = getNextApproverAccountID ( report ) ;
70
+ function getNextApproverDisplayName ( report : OnyxEntry < Report > , isUnapprove ?: boolean ) {
71
+ const approverAccountID = getNextApproverAccountID ( report , isUnapprove ) ;
71
72
72
73
return getDisplayNameForParticipant ( { accountID : approverAccountID } ) ?? getPersonalDetailsForAccountID ( approverAccountID ) . login ;
73
74
}
@@ -80,7 +81,7 @@ function getNextApproverDisplayName(report: OnyxEntry<Report>) {
80
81
* @param parameters.isPaidWithExpensify - Whether a report has been paid with Expensify or outside
81
82
* @returns nextStep
82
83
*/
83
- function buildNextStep ( report : OnyxEntry < Report > , predictedNextStatus : ValueOf < typeof CONST . REPORT . STATUS_NUM > ) : ReportNextStep | null {
84
+ function buildNextStep ( report : OnyxEntry < Report > , predictedNextStatus : ValueOf < typeof CONST . REPORT . STATUS_NUM > , isUnapprove ?: boolean ) : ReportNextStep | null {
84
85
if ( ! isExpenseReport ( report ) ) {
85
86
return null ;
86
87
}
@@ -90,7 +91,9 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t
90
91
const { harvesting, autoReportingOffset} = policy ;
91
92
const autoReportingFrequency = getCorrectedAutoReportingFrequency ( policy ) ;
92
93
const ownerDisplayName = getDisplayNameForParticipant ( { accountID : ownerAccountID } ) ;
93
- const nextApproverDisplayName = getNextApproverDisplayName ( report ) ;
94
+ const nextApproverDisplayName = getNextApproverDisplayName ( report , isUnapprove ) ;
95
+ const approverAccountID = getNextApproverAccountID ( report , isUnapprove ) ;
96
+ const approvers = getLoginsByAccountIDs ( [ approverAccountID ?? CONST . DEFAULT_NUMBER_ID ] ) ;
94
97
95
98
const reimburserAccountID = getReimburserAccountID ( policy ) ;
96
99
const hasValidAccount = ! ! policy ?. achAccount ?. accountNumber ;
@@ -232,6 +235,7 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t
232
235
{
233
236
text : nextApproverDisplayName ,
234
237
type : 'strong' ,
238
+ clickToCopyText : approvers . at ( 0 ) ,
235
239
} ,
236
240
{
237
241
text : ' to ' ,
0 commit comments