From e9fbdf367a65f8445d48dbbafcfb977362ae17a4 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Sun, 21 Apr 2024 21:31:29 +0000 Subject: [PATCH 1/3] Update version to 1.4.63-16 (cherry picked from commit acd297462149b2b25538c450354dae9b71ba1acd) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d4ab6fdd6ea7..6bcfd73ae5da 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001046315 - versionName "1.4.63-15" + versionCode 1001046316 + versionName "1.4.63-16" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 3e1784886783..f66739928265 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.63.15 + 1.4.63.16 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 3dae20451b73..cc574dc9977d 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.63.15 + 1.4.63.16 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index bf09c984c288..6f709d0e2006 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.63 CFBundleVersion - 1.4.63.15 + 1.4.63.16 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 5512356ecd13..d927d834028e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.63-15", + "version": "1.4.63-16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.63-15", + "version": "1.4.63-16", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index a685d4ab3ace..46082c72411e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.63-15", + "version": "1.4.63-16", "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 9e87f8825e6497d7b5142b8257e3acdd7288a932 Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:23:36 +0200 Subject: [PATCH 2/3] Merge pull request #40655 from DylanDylann/fix/40543 [CP Staging] Fix/40543: IOU - Currency in the amount editor is USD when the request is created in local currency (cherry picked from commit 8e8b1735a054059033cb5df5d6bda7dcac1edbe8) --- src/libs/actions/TransactionEdit.ts | 19 +++++- .../iou/request/step/IOURequestStepAmount.tsx | 59 ++++++++++++++++++- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/TransactionEdit.ts b/src/libs/actions/TransactionEdit.ts index 26219d72920e..970b34591103 100644 --- a/src/libs/actions/TransactionEdit.ts +++ b/src/libs/actions/TransactionEdit.ts @@ -39,4 +39,21 @@ function restoreOriginalTransactionFromBackup(transactionID: string, isDraft: bo }); } -export {createBackupTransaction, removeBackupTransaction, restoreOriginalTransactionFromBackup}; +function createDraftTransaction(transaction: OnyxEntry) { + if (!transaction) { + return; + } + + const newTransaction = { + ...transaction, + }; + + // Use set so that it will always fully overwrite any backup transaction that could have existed before + Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transaction.transactionID}`, newTransaction); +} + +function removeDraftTransaction(transactionID: string) { + Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, null); +} + +export {createBackupTransaction, removeBackupTransaction, restoreOriginalTransactionFromBackup, createDraftTransaction, removeDraftTransaction}; diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 64cbcb6060aa..b63e4138c79f 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -31,8 +31,19 @@ type IOURequestStepAmountOnyxProps = { /** The draft transaction that holds data to be persisted on the current transaction */ splitDraftTransaction: OnyxEntry; +<<<<<<< HEAD /** The backup transaction object being modified in Onyx */ backupTransaction: OnyxEntry; +======= + /** The draft transaction object being modified in Onyx */ + draftTransaction: OnyxEntry; + + /** Personal details of all users */ + personalDetails: OnyxEntry; + + /** The policy which the user has access to and which the report is tied to */ + policy: OnyxEntry; +>>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543) }; type IOURequestStepAmountProps = IOURequestStepAmountOnyxProps & @@ -48,7 +59,12 @@ function IOURequestStepAmount({ }, transaction, splitDraftTransaction, +<<<<<<< HEAD backupTransaction, +======= + skipConfirmation, + draftTransaction, +>>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543) }: IOURequestStepAmountProps) { const {translate} = useLocalize(); const textInput = useRef(null); @@ -59,7 +75,7 @@ function IOURequestStepAmount({ const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; const isEditingSplitBill = isEditing && isSplitBill; const {amount: transactionAmount} = ReportUtils.getTransactionDetails(isEditingSplitBill && !isEmptyObject(splitDraftTransaction) ? splitDraftTransaction : transaction) ?? {amount: 0}; - const {currency: originalCurrency} = ReportUtils.getTransactionDetails(isEditing ? backupTransaction : transaction) ?? {currency: CONST.CURRENCY.USD}; + const {currency: originalCurrency} = ReportUtils.getTransactionDetails(isEditing ? draftTransaction : transaction) ?? {currency: CONST.CURRENCY.USD}; const currency = CurrencyUtils.isValidCurrencyCode(selectedCurrency) ? selectedCurrency : originalCurrency; useFocusEffect( @@ -81,13 +97,13 @@ function IOURequestStepAmount({ // A temporary solution to not prevent users from editing the currency // We create a backup transaction and use it to save the currency and remove this transaction backup if we don't save the amount // It should be removed after this issue https://github.com/Expensify/App/issues/34607 is fixed - TransactionEdit.createBackupTransaction(isEditingSplitBill && !isEmptyObject(splitDraftTransaction) ? splitDraftTransaction : transaction); + TransactionEdit.createDraftTransaction(isEditingSplitBill && !isEmptyObject(splitDraftTransaction) ? splitDraftTransaction : transaction); return () => { if (isSaveButtonPressed.current) { return; } - TransactionEdit.removeBackupTransaction(transaction?.transactionID ?? ''); + TransactionEdit.removeDraftTransaction(transaction?.transactionID ?? ''); }; // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -175,6 +191,7 @@ function IOURequestStepAmount({ IOURequestStepAmount.displayName = 'IOURequestStepAmount'; +<<<<<<< HEAD export default withWritableReportOrNotFound( withFullTransactionOrNotFound( withOnyx({ @@ -193,3 +210,39 @@ export default withWritableReportOrNotFound( })(IOURequestStepAmount), ), ); +======= +const IOURequestStepAmountWithOnyx = withOnyx({ + splitDraftTransaction: { + key: ({route}) => { + const transactionID = route.params.transactionID ?? 0; + return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; + }, + }, + draftTransaction: { + key: ({route}) => { + const transactionID = route.params.transactionID ?? 0; + return `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`; + }, + }, + skipConfirmation: { + key: ({route}) => { + const transactionID = route.params.transactionID ?? 0; + return `${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`; + }, + }, + personalDetails: { + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + }, + policy: { + key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '0'}`, + }, +})(IOURequestStepAmount); + +const IOURequestStepAmountWithCurrentUserPersonalDetails = withCurrentUserPersonalDetails(IOURequestStepAmountWithOnyx); +// eslint-disable-next-line rulesdir/no-negated-variables +const IOURequestStepAmountWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepAmountWithCurrentUserPersonalDetails); +// eslint-disable-next-line rulesdir/no-negated-variables +const IOURequestStepAmountWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepAmountWithWritableReportOrNotFound); + +export default IOURequestStepAmountWithFullTransactionOrNotFound; +>>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543) From acafa95df9169ef30f1168da9add2e9bcd5e30c7 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 21 Apr 2024 23:41:29 +0200 Subject: [PATCH 3/3] Resolve merge conflicts --- .../iou/request/step/IOURequestStepAmount.tsx | 59 +------------------ 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index b63e4138c79f..4811b0bfdebb 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -31,19 +31,8 @@ type IOURequestStepAmountOnyxProps = { /** The draft transaction that holds data to be persisted on the current transaction */ splitDraftTransaction: OnyxEntry; -<<<<<<< HEAD - /** The backup transaction object being modified in Onyx */ - backupTransaction: OnyxEntry; -======= /** The draft transaction object being modified in Onyx */ - draftTransaction: OnyxEntry; - - /** Personal details of all users */ - personalDetails: OnyxEntry; - - /** The policy which the user has access to and which the report is tied to */ - policy: OnyxEntry; ->>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543) + draftTransaction: OnyxEntry; }; type IOURequestStepAmountProps = IOURequestStepAmountOnyxProps & @@ -59,12 +48,7 @@ function IOURequestStepAmount({ }, transaction, splitDraftTransaction, -<<<<<<< HEAD - backupTransaction, -======= - skipConfirmation, draftTransaction, ->>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543) }: IOURequestStepAmountProps) { const {translate} = useLocalize(); const textInput = useRef(null); @@ -191,7 +175,6 @@ function IOURequestStepAmount({ IOURequestStepAmount.displayName = 'IOURequestStepAmount'; -<<<<<<< HEAD export default withWritableReportOrNotFound( withFullTransactionOrNotFound( withOnyx({ @@ -201,48 +184,12 @@ export default withWritableReportOrNotFound( return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; }, }, - backupTransaction: { + draftTransaction: { key: ({route}) => { const transactionID = route.params.transactionID ?? 0; - return `${ONYXKEYS.COLLECTION.TRANSACTION_BACKUP}${transactionID}`; + return `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`; }, }, })(IOURequestStepAmount), ), ); -======= -const IOURequestStepAmountWithOnyx = withOnyx({ - splitDraftTransaction: { - key: ({route}) => { - const transactionID = route.params.transactionID ?? 0; - return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; - }, - }, - draftTransaction: { - key: ({route}) => { - const transactionID = route.params.transactionID ?? 0; - return `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`; - }, - }, - skipConfirmation: { - key: ({route}) => { - const transactionID = route.params.transactionID ?? 0; - return `${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`; - }, - }, - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - policy: { - key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '0'}`, - }, -})(IOURequestStepAmount); - -const IOURequestStepAmountWithCurrentUserPersonalDetails = withCurrentUserPersonalDetails(IOURequestStepAmountWithOnyx); -// eslint-disable-next-line rulesdir/no-negated-variables -const IOURequestStepAmountWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepAmountWithCurrentUserPersonalDetails); -// eslint-disable-next-line rulesdir/no-negated-variables -const IOURequestStepAmountWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepAmountWithWritableReportOrNotFound); - -export default IOURequestStepAmountWithFullTransactionOrNotFound; ->>>>>>> 8e8b1735 (Merge pull request #40655 from DylanDylann/fix/40543)