From 11d559511136522050cf4495be09fa86b46fd833 Mon Sep 17 00:00:00 2001
From: OSBotify <76178356+OSBotify@users.noreply.github.com>
Date: Fri, 19 May 2023 07:57:51 -0400
Subject: [PATCH 1/2] Merge pull request #19261 from
Expensify/version-BUILD-BF29D48F-40BF-430C-B051-BA066DA4A416
Update version to 1.3.16-5 on main
(cherry picked from commit d17562e1b6aa26f3cc9858f4d40cb11c0e8e4486)
---
android/app/build.gradle | 4 ++--
ios/NewExpensify/Info.plist | 2 +-
ios/NewExpensifyTests/Info.plist | 2 +-
package-lock.json | 4 ++--
package.json | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/android/app/build.gradle b/android/app/build.gradle
index c88925b9a1f5..a61340620405 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
- versionCode 1001031604
- versionName "1.3.16-4"
+ versionCode 1001031605
+ versionName "1.3.16-5"
}
splits {
diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist
index 2a75ed6e95fa..d66f9cfc3664 100644
--- a/ios/NewExpensify/Info.plist
+++ b/ios/NewExpensify/Info.plist
@@ -30,7 +30,7 @@
CFBundleVersion
- 1.3.16.4
+ 1.3.16.5
ITSAppUsesNonExemptEncryption
LSApplicationQueriesSchemes
diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist
index 4ce6047d497f..0ccf71908353 100644
--- a/ios/NewExpensifyTests/Info.plist
+++ b/ios/NewExpensifyTests/Info.plist
@@ -19,6 +19,6 @@
CFBundleSignature
????
CFBundleVersion
- 1.3.16.4
+ 1.3.16.5
diff --git a/package-lock.json b/package-lock.json
index 330f4af49133..0e99946f8fd9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "new.expensify",
- "version": "1.3.16-4",
+ "version": "1.3.16-5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "new.expensify",
- "version": "1.3.16-4",
+ "version": "1.3.16-5",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index a16c744f4f63..99bf1938f750 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
- "version": "1.3.16-4",
+ "version": "1.3.16-5",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
From 0397b6e8ca8552a981b320816dd43400e4c8ad32 Mon Sep 17 00:00:00 2001
From: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Date: Fri, 19 May 2023 12:50:21 +0100
Subject: [PATCH 2/2] Merge pull request #19194 from
Expensify/vit-fixHeaderPaymentButton
Fix couple of manual request bugs
(cherry picked from commit 40d992f6d6145ff3fdd6049b3dc31dc252cf0f82)
---
src/components/MoneyRequestHeader.js | 6 +++---
.../ReportActionItem/ReportPreview.js | 8 ++++---
src/libs/ReportUtils.js | 5 +++--
src/libs/actions/IOU.js | 21 ++-----------------
src/pages/home/report/ReportActionItem.js | 3 +--
5 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/src/components/MoneyRequestHeader.js b/src/components/MoneyRequestHeader.js
index 0a14315fbbd8..cc540b108c4f 100644
--- a/src/components/MoneyRequestHeader.js
+++ b/src/components/MoneyRequestHeader.js
@@ -84,8 +84,8 @@ const MoneyRequestHeader = (props) => {
? ReportUtils.getWorkspaceAvatar(moneyRequestReport)
: ReportUtils.getAvatar(lodashGet(props.personalDetails, [moneyRequestReport.managerEmail, 'avatar']), moneyRequestReport.managerEmail);
const policy = props.policies[`${ONYXKEYS.COLLECTION.POLICY}${props.report.policyID}`];
- const shouldShowSettlementButton =
- !isSettled && (Policy.isAdminOfFreePolicy([policy]) || (ReportUtils.isMoneyRequestReport(props.report) && lodashGet(props.session, 'email', null) === props.report.managerEmail));
+ const isPayer = Policy.isAdminOfFreePolicy([policy]) || (ReportUtils.isMoneyRequestReport(props.report) && lodashGet(props.session, 'email', null) === props.report.managerEmail);
+ const shouldShowSettlementButton = !isSettled && !props.isSingleTransactionView && isPayer;
return (
{
currency={props.report.currency}
policyID={props.report.policyID}
shouldShowPaypal={Boolean(lodashGet(props.personalDetails, [moneyRequestReport.managerEmail, 'payPalMeAddress']))}
- chatReportID={props.report.chatReportID}
+ chatReportID={props.chatReport.reportID}
iouReport={props.report}
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.report)}
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW}
diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js
index 814a38dba5b5..f9aa62c5b7cd 100644
--- a/src/components/ReportActionItem/ReportPreview.js
+++ b/src/components/ReportActionItem/ReportPreview.js
@@ -100,7 +100,7 @@ const ReportPreview = (props) => {
const isCurrentUserManager = managerEmail === lodashGet(props.session, 'email', null);
return (
- {_.map(props.action.message, (index) => (
+ {_.map(props.action.message, (message, index) => (
{
@@ -114,10 +114,12 @@ const ReportPreview = (props) => {
>
{props.iouReport.hasOutstandingIOU ? (
- {props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})}
+
+ {lodashGet(message, 'html', props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount}))}
+
) : (
- {props.translate('iou.payerSettled', {amount: reportAmount})}
+ {lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))}
{!props.iouReport.hasOutstandingIOU && (
{
delete originalMessage[key];
});
diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js
index 33af1acd67c5..ccc133cc56bd 100644
--- a/src/libs/actions/IOU.js
+++ b/src/libs/actions/IOU.js
@@ -882,6 +882,8 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
optimisticTransaction.transactionID,
paymentMethodType,
optimisticIOUReport.reportID,
+ false,
+ true,
);
// First, add data that will be used in all cases
@@ -1014,7 +1016,6 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
* @returns {Object}
*/
function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMethodType) {
- const reportPreviewAction = ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID);
const optimisticTransaction = TransactionUtils.buildOptimisticTransaction(iouReport.total, iouReport.currency, iouReport.reportID);
const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction(
CONST.IOU.REPORT_ACTION_TYPE.PAY,
@@ -1042,15 +1043,6 @@ function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMetho
lastMessageHtml: optimisticIOUReportAction.message[0].html,
},
},
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
- value: {
- [reportPreviewAction.reportActionID]: {
- created: DateUtils.getDBTime(),
- },
- },
- },
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
@@ -1104,15 +1096,6 @@ function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMetho
];
const failureData = [
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
- value: {
- [reportPreviewAction.reportActionID]: {
- created: reportPreviewAction.created,
- },
- },
- },
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js
index 41fcf102a138..e0749f698444 100644
--- a/src/pages/home/report/ReportActionItem.js
+++ b/src/pages/home/report/ReportActionItem.js
@@ -193,11 +193,10 @@ class ReportActionItem extends Component {
originalMessage &&
(originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE ||
originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT ||
- (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && originalMessage.IOUDetails))
+ (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails')))
) {
// There is no single iouReport for bill splits, so only 1:1 requests require an iouReportID
const iouReportID = originalMessage.IOUReportID ? originalMessage.IOUReportID.toString() : '0';
-
children = (