From dfe25cb60deb336a9e879fd0a98b1990ebfc5e1a Mon Sep 17 00:00:00 2001 From: Sheena Trepanier Date: Wed, 17 Jan 2024 21:06:57 -0800 Subject: [PATCH 01/12] Update Admin-Card-Settings-and-Features.md Update terminology for "credit card" to satisfy Card Management updates as part of https://github.com/Expensify/Expensify/issues/342533 --- .../expensify-card/Admin-Card-Settings-and-Features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/articles/expensify-classic/expensify-card/Admin-Card-Settings-and-Features.md b/docs/articles/expensify-classic/expensify-card/Admin-Card-Settings-and-Features.md index 16e628acbeee..043cc4be1e26 100644 --- a/docs/articles/expensify-classic/expensify-card/Admin-Card-Settings-and-Features.md +++ b/docs/articles/expensify-classic/expensify-card/Admin-Card-Settings-and-Features.md @@ -81,7 +81,7 @@ Follow the below steps to run reconciliation on the Expensify Card settlements: - Entry ID: a unique number grouping card payments and transactions settled by those payments - Amount: the amount debited from the Business Bank Account for payments - Merchant: the business where a purchase was made - - Card: refers to the Expensify credit card number and cardholder's email address + - Card: refers to the Expensify Card number and cardholder's email address - Business Account: the business bank account connected to Expensify that the settlement is paid from - Transaction ID: a special ID that helps Expensify support locate transactions if there's an issue From caa025bb01c10a9a0ef592ff018f4266f024de22 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 6 Feb 2024 11:49:24 +0700 Subject: [PATCH 02/12] fix error message disappear --- src/components/ReportActionItem/MoneyRequestView.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 3a3aef6cabcd..1ca07db2eff5 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -189,10 +189,15 @@ function MoneyRequestView({ const hasReceipt = TransactionUtils.hasReceipt(transaction); let receiptURIs; - let hasErrors = false; + let hasErrors = Boolean( + canEdit && + transaction && + !TransactionUtils.isDistanceRequest(transaction) && + !TransactionUtils.isReceiptBeingScanned(transaction) && + TransactionUtils.areRequiredFieldsEmpty(transaction), + ); if (hasReceipt) { receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction); - hasErrors = canEdit && TransactionUtils.hasMissingSmartscanFields(transaction); } const pendingAction = transaction?.pendingAction; From 1ca73747a73be8446150e43d5c7eed9c5c6cea85 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 6 Feb 2024 13:32:58 +0700 Subject: [PATCH 03/12] fix lint --- src/components/ReportActionItem/MoneyRequestView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 1ca07db2eff5..ae7144e9c6a4 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -189,7 +189,7 @@ function MoneyRequestView({ const hasReceipt = TransactionUtils.hasReceipt(transaction); let receiptURIs; - let hasErrors = Boolean( + const hasErrors = Boolean( canEdit && transaction && !TransactionUtils.isDistanceRequest(transaction) && From bee6bd1c9b91f5bb2937de1f857f4b272988336c Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 15 Feb 2024 18:40:31 +0700 Subject: [PATCH 04/12] fix error message in LHN --- src/components/ReportActionItem/MoneyRequestView.tsx | 8 +------- src/libs/OptionsListUtils.ts | 2 +- src/libs/TransactionUtils.ts | 8 ++++++++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index ae7144e9c6a4..6530279a54ab 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -189,13 +189,7 @@ function MoneyRequestView({ const hasReceipt = TransactionUtils.hasReceipt(transaction); let receiptURIs; - const hasErrors = Boolean( - canEdit && - transaction && - !TransactionUtils.isDistanceRequest(transaction) && - !TransactionUtils.isReceiptBeingScanned(transaction) && - TransactionUtils.areRequiredFieldsEmpty(transaction), - ); + const hasErrors = Boolean(canEdit && TransactionUtils.hasMissingRequiredFields(transaction)); if (hasReceipt) { receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction); } diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index b6518b361381..33d97280a5ac 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -482,7 +482,7 @@ function getAllReportErrors(report: OnyxEntry, reportActions: OnyxEntry< if (parentReportAction?.actorAccountID === currentUserAccountID && ReportActionUtils.isTransactionThread(parentReportAction)) { const transactionID = parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? parentReportAction?.originalMessage?.IOUTransactionID : null; const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]; - if (TransactionUtils.hasMissingSmartscanFields(transaction ?? null) && !ReportUtils.isSettled(transaction?.reportID)) { + if (TransactionUtils.hasMissingRequiredFields(transaction ?? null) && !ReportUtils.isSettled(transaction?.reportID)) { reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage'); } } else if ((ReportUtils.isIOUReport(report) || ReportUtils.isExpenseReport(report)) && report?.ownerAccountID === currentUserAccountID) { diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 8a814f311481..9bd4b19df3be 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -435,6 +435,13 @@ function hasMissingSmartscanFields(transaction: OnyxEntry): boolean return Boolean(transaction && hasReceipt(transaction) && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); } +/** + * Check if the transaction has missing required fields + */ +function hasMissingRequiredFields(transaction: OnyxEntry): boolean { + return Boolean(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); +} + /** * Check if the transaction has a defined route */ @@ -592,4 +599,5 @@ export { waypointHasValidAddress, getRecentTransactions, hasViolation, + hasMissingRequiredFields, }; From 6215e7678218f33a7e3fbb1009d53753f0617e2a Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 15 Feb 2024 18:49:36 +0700 Subject: [PATCH 05/12] fix remove redundant boolean --- src/components/ReportActionItem/MoneyRequestView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index d5b836fb5318..e8ac5162c7e9 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -189,7 +189,7 @@ function MoneyRequestView({ const hasReceipt = TransactionUtils.hasReceipt(transaction); let receiptURIs; - const hasErrors = Boolean(canEdit && TransactionUtils.hasMissingRequiredFields(transaction)); + const hasErrors = canEdit && TransactionUtils.hasMissingRequiredFields(transaction); if (hasReceipt) { receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction); } From 7c21c94603c6b6c441f50ffa102c88ac66d69e26 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 22 Feb 2024 14:31:09 +0700 Subject: [PATCH 06/12] update hasMissingSmartscanFields function --- src/libs/ReportUtils.ts | 3 +-- src/libs/TransactionUtils.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ae6e02e70d29..2d0d91897d3b 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2252,8 +2252,7 @@ function areAllRequestsBeingSmartScanned(iouReportID: string, reportPreviewActio * */ function hasMissingSmartscanFields(iouReportID: string): boolean { - const transactionsWithReceipts = getTransactionsWithReceipts(iouReportID); - return transactionsWithReceipts.some((transaction) => TransactionUtils.hasMissingSmartscanFields(transaction)); + return TransactionUtils.getAllReportTransactions(iouReportID).some((transaction) => TransactionUtils.hasMissingSmartscanFields(transaction)); } /** diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 799a86141877..6a0a4aeb0424 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -447,7 +447,7 @@ function isReceiptBeingScanned(transaction: OnyxEntry): boolean { * Check if the transaction has a non-smartscanning receipt and is missing required fields */ function hasMissingSmartscanFields(transaction: OnyxEntry): boolean { - return Boolean(transaction && hasReceipt(transaction) && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); + return Boolean(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); } /** From 631d206773ca38ccf01e5e3d75297025dc4f2e9f Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 23 Feb 2024 13:38:18 +0700 Subject: [PATCH 07/12] fix replace hasMissingRequiredFields by hasMissingSmartscanFields --- src/components/ReportActionItem/MoneyRequestView.tsx | 2 +- src/libs/OptionsListUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 06f1843fffb0..bc31ae8b8f44 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -192,7 +192,7 @@ function MoneyRequestView({ const hasReceipt = TransactionUtils.hasReceipt(transaction); let receiptURIs; - const hasErrors = canEdit && TransactionUtils.hasMissingRequiredFields(transaction); + const hasErrors = canEdit && TransactionUtils.hasMissingSmartscanFields(transaction); if (hasReceipt) { receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction); } diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index c62adbe54fda..97b4fc0144c8 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -482,7 +482,7 @@ function getAllReportErrors(report: OnyxEntry, reportActions: OnyxEntry< if (parentReportAction?.actorAccountID === currentUserAccountID && ReportActionUtils.isTransactionThread(parentReportAction)) { const transactionID = parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? parentReportAction?.originalMessage?.IOUTransactionID : null; const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]; - if (TransactionUtils.hasMissingRequiredFields(transaction ?? null) && !ReportUtils.isSettled(transaction?.reportID)) { + if (TransactionUtils.hasMissingSmartscanFields(transaction ?? null) && !ReportUtils.isSettled(transaction?.reportID)) { reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage'); } } else if ((ReportUtils.isIOUReport(report) || ReportUtils.isExpenseReport(report)) && report?.ownerAccountID === currentUserAccountID) { From 9dcca6a38b2f54d32c4bcd8807efc04243ab9d7e Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 23 Feb 2024 13:39:35 +0700 Subject: [PATCH 08/12] fix remove hasMissingRequiredFields --- src/libs/TransactionUtils.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 6a0a4aeb0424..0f3870c90628 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -450,13 +450,6 @@ function hasMissingSmartscanFields(transaction: OnyxEntry): boolean return Boolean(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); } -/** - * Check if the transaction has missing required fields - */ -function hasMissingRequiredFields(transaction: OnyxEntry): boolean { - return Boolean(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); -} - /** * Check if the transaction has a defined route */ @@ -641,7 +634,6 @@ export { waypointHasValidAddress, getRecentTransactions, hasViolation, - hasMissingRequiredFields, }; export type {TransactionChanges}; From 1c6d40708a029a6a488fd835c0676f9773ba848f Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Sun, 25 Feb 2024 08:28:28 +0530 Subject: [PATCH 09/12] fix: Chat-In offline, uploading attachment & deleting it, is not showing strike-through. Signed-off-by: Krishna Gupta --- src/pages/home/report/ReportActionItemFragment.tsx | 1 + .../home/report/comment/AttachmentCommentFragment.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemFragment.tsx b/src/pages/home/report/ReportActionItemFragment.tsx index e762f07cf20f..4250c874a471 100644 --- a/src/pages/home/report/ReportActionItemFragment.tsx +++ b/src/pages/home/report/ReportActionItemFragment.tsx @@ -105,6 +105,7 @@ function ReportActionItemFragment({ source={source} html={fragment.html ?? ''} addExtraMargin={!displayAsGroup} + styleAsDeleted={!!(isOffline && isPendingDelete)} /> ); } diff --git a/src/pages/home/report/comment/AttachmentCommentFragment.tsx b/src/pages/home/report/comment/AttachmentCommentFragment.tsx index 3c49cb90a106..fec5ebe92e54 100644 --- a/src/pages/home/report/comment/AttachmentCommentFragment.tsx +++ b/src/pages/home/report/comment/AttachmentCommentFragment.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; +import CONST from '@src/CONST'; import type {OriginalMessageSource} from '@src/types/onyx/OriginalMessage'; import RenderCommentHTML from './RenderCommentHTML'; @@ -8,15 +9,19 @@ type AttachmentCommentFragmentProps = { source: OriginalMessageSource; html: string; addExtraMargin: boolean; + styleAsDeleted: boolean; }; -function AttachmentCommentFragment({addExtraMargin, html, source}: AttachmentCommentFragmentProps) { +function AttachmentCommentFragment({addExtraMargin, html, source, styleAsDeleted}: AttachmentCommentFragmentProps) { const styles = useThemeStyles(); + const isUploading = html === CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML; + const htmlContent = styleAsDeleted && isUploading ? `${html}` : html; + return ( ); From dfaeb66ba45e866fee6484f59798b2f412038957 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 26 Feb 2024 08:29:55 +0700 Subject: [PATCH 10/12] fix missing RBR in report preview --- src/components/ReportActionItem/ReportPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 591767234b8b..cbc728ffd1ce 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -138,7 +138,7 @@ function ReportPreview({ const hasReceipts = transactionsWithReceipts.length > 0; const isScanning = hasReceipts && areAllRequestsBeingSmartScanned; - const hasErrors = (hasReceipts && hasMissingSmartscanFields) || (canUseViolations && ReportUtils.hasViolations(iouReportID, transactionViolations)); + const hasErrors = hasMissingSmartscanFields || (canUseViolations && ReportUtils.hasViolations(iouReportID, transactionViolations)); const lastThreeTransactionsWithReceipts = transactionsWithReceipts.slice(-3); const lastThreeReceipts = lastThreeTransactionsWithReceipts.map((transaction) => ReceiptUtils.getThumbnailAndImageURIs(transaction)); From 76a1f3077a1e176309570df2d615c71e39700ec5 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 27 Feb 2024 14:26:05 +0700 Subject: [PATCH 11/12] fix console log error --- src/components/FlatList/MVCPFlatList.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/FlatList/MVCPFlatList.js b/src/components/FlatList/MVCPFlatList.js index 0abb1dc4a873..7fa8b364fb0f 100644 --- a/src/components/FlatList/MVCPFlatList.js +++ b/src/components/FlatList/MVCPFlatList.js @@ -38,6 +38,7 @@ const MVCPFlatList = React.forwardRef(({maintainVisibleContentPosition, horizont const firstVisibleViewRef = React.useRef(null); const mutationObserverRef = React.useRef(null); const lastScrollOffsetRef = React.useRef(0); + const isListRenderedRef = React.useRef(false); const getScrollOffset = React.useCallback(() => { if (scrollRef.current == null) { @@ -137,6 +138,9 @@ const MVCPFlatList = React.forwardRef(({maintainVisibleContentPosition, horizont }, [adjustForMaintainVisibleContentPosition, getContentView, getScrollOffset, scrollToOffset]); React.useEffect(() => { + if (!isListRenderedRef.current) { + return; + } requestAnimationFrame(() => { prepareForMaintainVisibleContentPosition(); setupMutationObserver(); @@ -186,6 +190,10 @@ const MVCPFlatList = React.forwardRef(({maintainVisibleContentPosition, horizont onScroll={onScrollInternal} scrollEventThrottle={1} ref={onRef} + onLayout={(e) => { + isListRenderedRef.current = true; + props.onLayout?.(e); + }} /> ); }); From 776a8bbd258ed9194dc325c3758d35146630eb2e Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 27 Feb 2024 10:43:09 +0000 Subject: [PATCH 12/12] Update version to 1.4.44-1 --- 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 cff6f004967e..741b5fa4aa10 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 1001044400 - versionName "1.4.44-0" + versionCode 1001044401 + versionName "1.4.44-1" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index e4e898423238..00a1c5fbadc8 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.44.0 + 1.4.44.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 661432acfd4c..f6291a612748 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.44.0 + 1.4.44.1 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index cdd031218474..8a43cd09c370 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.44 CFBundleVersion - 1.4.44.0 + 1.4.44.1 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 3f7bb61b64e0..5fe54d0f27a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.44-0", + "version": "1.4.44-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.44-0", + "version": "1.4.44-1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index d79437b1e65b..66ebe720a448 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.44-0", + "version": "1.4.44-1", "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.",