From 67077a81273a97b196a264f5b0e5d1bfee8cfe32 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Date: Thu, 12 Oct 2023 17:41:05 +0530 Subject: [PATCH 01/11] added enable wallet state --- src/languages/en.ts | 2 ++ src/languages/es.ts | 2 ++ src/pages/home/report/ReportActionItem.js | 25 ++++++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index f4c7bdc6ee603..c0f5214c76786 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -578,6 +578,8 @@ export default { genericEditFailureMessage: 'Unexpected error editing the money request, please try again later', genericSmartscanFailureMessage: 'Transaction is missing fields', }, + waitingOnEnableWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Started settling up, payment is held until ${submitterDisplayName} enables their Wallet`, + enableWallet: 'Enable Wallet', }, notificationPreferencesPage: { header: 'Notification preferences', diff --git a/src/languages/es.ts b/src/languages/es.ts index 1bbb056e82efd..de109ccc81c03 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -572,6 +572,8 @@ export default { genericEditFailureMessage: 'Error inesperado al guardar la solicitud de dinero. Por favor, inténtalo más tarde', genericSmartscanFailureMessage: 'La transacción tiene campos vacíos', }, + waitingOnEnableWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `nicio el pago, pero no se procesará hasta que ${submitterDisplayName} active su Billetera`, + enableWallet: 'Habilitar Billetera', }, notificationPreferencesPage: { header: 'Preferencias de avisos', diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index d0e84499a4434..08977cac9bdca 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -347,10 +347,20 @@ function ReportActionItem(props) { const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(props.personalDetailsList, [props.report.ownerAccountID, 'displayName'], props.report.ownerEmail); const shouldShowAddCreditBankAccountButton = ReportUtils.isCurrentUserSubmitter(props.report.reportID) && !store.hasCreditBankAccount() && !ReportUtils.isSettled(props.report.reportID); + const shouldShowEnableWalletButton = + ReportUtils.isCurrentUserSubmitter(props.report.reportID) && + lodashGet(props.action, 'paymentType', '') === CONST.IOU.PAYMENT_TYPE.EXPENSIFY && + !ReportUtils.isSettled(props.report.reportID); children = ( - - {shouldShowAddCreditBankAccountButton ? ( + + {shouldShowAddCreditBankAccountButton && (