Skip to content

Commit 74db596

Browse files
Merge branch 'Expensify:main' into fix/54363-missing-suffix-in-base-text-input-native
2 parents e9f614a + 9c6d3d9 commit 74db596

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1422
-384
lines changed

Mobile-Expensify

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ android {
110110
minSdkVersion rootProject.ext.minSdkVersion
111111
targetSdkVersion rootProject.ext.targetSdkVersion
112112
multiDexEnabled rootProject.ext.multiDexEnabled
113-
versionCode 1009007802
114-
versionName "9.0.78-2"
113+
versionCode 1009007902
114+
versionName "9.0.79-2"
115115
// Supported language variants must be declared here to avoid from being removed during the compilation.
116116
// This also helps us to not include unnecessary language variants in the APK.
117117
resConfigs "en", "es"

ios/NewExpensify/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundlePackageType</key>
2020
<string>APPL</string>
2121
<key>CFBundleShortVersionString</key>
22-
<string>9.0.78</string>
22+
<string>9.0.79</string>
2323
<key>CFBundleSignature</key>
2424
<string>????</string>
2525
<key>CFBundleURLTypes</key>
@@ -40,7 +40,7 @@
4040
</dict>
4141
</array>
4242
<key>CFBundleVersion</key>
43-
<string>9.0.78.2</string>
43+
<string>9.0.79.2</string>
4444
<key>FullStory</key>
4545
<dict>
4646
<key>OrgId</key>

ios/NewExpensifyTests/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>9.0.78</string>
18+
<string>9.0.79</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>9.0.78.2</string>
22+
<string>9.0.79.2</string>
2323
</dict>
2424
</plist>

ios/NotificationServiceExtension/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<key>CFBundleName</key>
1212
<string>$(PRODUCT_NAME)</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>9.0.78</string>
14+
<string>9.0.79</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.0.78.2</string>
16+
<string>9.0.79.2</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "9.0.78-2",
3+
"version": "9.0.79-2",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
@@ -76,7 +76,7 @@
7676
},
7777
"dependencies": {
7878
"@dotlottie/react-player": "^1.6.3",
79-
"@expensify/react-native-live-markdown": "0.1.209",
79+
"@expensify/react-native-live-markdown": "0.1.210",
8080
"@expo/metro-runtime": "~3.2.3",
8181
"@firebase/app": "^0.10.10",
8282
"@firebase/performance": "^0.6.8",

src/components/AmountTextInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type AmountTextInputProps = {
3939

4040
/** Hide the focus styles on TextInput */
4141
hideFocusedState?: boolean;
42-
} & Pick<BaseTextInputProps, 'autoFocus'>;
42+
} & Pick<BaseTextInputProps, 'autoFocus' | 'autoGrowExtraSpace'>;
4343

4444
function AmountTextInput(
4545
{

src/components/EmptySelectionListContent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function EmptySelectionListContent({contentType}: EmptySelectionListContentProps
4848
);
4949

5050
return (
51-
<ScrollView>
51+
<ScrollView contentContainerStyle={[styles.flexGrow1]}>
5252
<View style={[styles.flex1, styles.overflowHidden, styles.minHeight65]}>
5353
<BlockingView
5454
icon={Illustrations.ToddWithPhones}

src/components/MoneyRequestAmountInput.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import CONST from '@src/CONST';
1212
import isTextInputFocused from './TextInput/BaseTextInput/isTextInputFocused';
1313
import type {BaseTextInputRef} from './TextInput/BaseTextInput/types';
1414
import TextInputWithCurrencySymbol from './TextInputWithCurrencySymbol';
15+
import type {TextInputWithCurrencySymbolProps} from './TextInputWithCurrencySymbol/types';
1516

1617
type CurrentMoney = {amount: string; currency: string};
1718

@@ -91,7 +92,7 @@ type MoneyRequestAmountInputProps = {
9192

9293
/** The width of inner content */
9394
contentWidth?: number;
94-
};
95+
} & Pick<TextInputWithCurrencySymbolProps, 'autoGrowExtraSpace'>;
9596

9697
type Selection = {
9798
start: number;
@@ -126,6 +127,7 @@ function MoneyRequestAmountInput(
126127
hideFocusedState = true,
127128
shouldKeepUserInput = false,
128129
autoGrow = true,
130+
autoGrowExtraSpace,
129131
contentWidth,
130132
...props
131133
}: MoneyRequestAmountInputProps,
@@ -289,6 +291,7 @@ function MoneyRequestAmountInput(
289291
return (
290292
<TextInputWithCurrencySymbol
291293
autoGrow={autoGrow}
294+
autoGrowExtraSpace={autoGrowExtraSpace}
292295
disableKeyboard={disableKeyboard}
293296
formattedAmount={formattedAmount}
294297
onChangeAmount={setNewAmount}

src/components/ProductTrainingContext/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou
205205
]);
206206

207207
const shouldShowProductTrainingTooltip = useMemo(() => {
208-
return shouldRenderTooltip(tooltipName);
209-
}, [shouldRenderTooltip, tooltipName]);
208+
return shouldShow && shouldRenderTooltip(tooltipName);
209+
}, [shouldRenderTooltip, tooltipName, shouldShow]);
210210

211211
const hideProductTrainingTooltip = useCallback(() => {
212212
const tooltip = TOOLTIPS[tooltipName];

src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx

+21-23
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ function MoneyRequestPreviewContent({
7474
const route = useRoute<PlatformStackRouteProp<TransactionDuplicateNavigatorParamList, typeof SCREENS.TRANSACTION_DUPLICATE.REVIEW>>();
7575
const {shouldUseNarrowLayout} = useResponsiveLayout();
7676
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
77-
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || '-1'}`);
77+
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`);
7878
const [session] = useOnyx(ONYXKEYS.SESSION);
79-
const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID || '-1'}`);
79+
const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID || CONST.DEFAULT_NUMBER_ID}`);
8080

8181
const policy = PolicyUtils.getPolicy(iouReport?.policyID);
8282
const isMoneyRequestAction = ReportActionsUtils.isMoneyRequestAction(action);
83-
const transactionID = isMoneyRequestAction ? ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID : '-1';
83+
const transactionID = isMoneyRequestAction ? ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID : undefined;
8484
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`);
8585
const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS);
8686
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
8787

8888
const sessionAccountID = session?.accountID;
89-
const managerID = iouReport?.managerID ?? -1;
90-
const ownerAccountID = iouReport?.ownerAccountID ?? -1;
89+
const managerID = iouReport?.managerID ?? CONST.DEFAULT_NUMBER_ID;
90+
const ownerAccountID = iouReport?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID;
9191
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(chatReport);
9292

9393
const participantAccountIDs =
@@ -117,9 +117,9 @@ function MoneyRequestPreviewContent({
117117
const isOnHold = TransactionUtils.isOnHold(transaction);
118118
const isSettlementOrApprovalPartial = !!iouReport?.pendingFields?.partial;
119119
const isPartialHold = isSettlementOrApprovalPartial && isOnHold;
120-
const hasViolations = TransactionUtils.hasViolation(transaction?.transactionID ?? '-1', transactionViolations, true);
121-
const hasNoticeTypeViolations = TransactionUtils.hasNoticeTypeViolation(transaction?.transactionID ?? '-1', transactionViolations, true) && ReportUtils.isPaidGroupPolicy(iouReport);
122-
const hasWarningTypeViolations = TransactionUtils.hasWarningTypeViolation(transaction?.transactionID ?? '-1', transactionViolations, true);
120+
const hasViolations = TransactionUtils.hasViolation(transaction?.transactionID, transactionViolations, true);
121+
const hasNoticeTypeViolations = TransactionUtils.hasNoticeTypeViolation(transaction?.transactionID, transactionViolations, true) && ReportUtils.isPaidGroupPolicy(iouReport);
122+
const hasWarningTypeViolations = TransactionUtils.hasWarningTypeViolation(transaction?.transactionID, transactionViolations, true);
123123
const hasFieldErrors = TransactionUtils.hasMissingSmartscanFields(transaction);
124124
const isDistanceRequest = TransactionUtils.isDistanceRequest(transaction);
125125
const isFetchingWaypointsFromServer = TransactionUtils.isFetchingWaypointsFromServer(transaction);
@@ -155,8 +155,8 @@ function MoneyRequestPreviewContent({
155155
const shouldShowHoldMessage = !(isSettled && !isSettlementOrApprovalPartial) && !!transaction?.comment?.hold;
156156

157157
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params?.threadReportID}`);
158-
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '', report?.parentReportActionID ?? '');
159-
const reviewingTransactionID = ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID ?? '-1' : '-1';
158+
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID, report?.parentReportActionID);
159+
const reviewingTransactionID = ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID : undefined;
160160

161161
/*
162162
Show the merchant for IOUs and expenses only if:
@@ -253,10 +253,10 @@ function MoneyRequestPreviewContent({
253253
if (TransactionUtils.isPending(transaction)) {
254254
return {shouldShow: true, messageIcon: Expensicons.CreditCardHourglass, messageDescription: translate('iou.transactionPending')};
255255
}
256-
if (TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID ?? '-1', iouReport, policy)) {
256+
if (TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID, iouReport, policy)) {
257257
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('violations.brokenConnection530Error')};
258258
}
259-
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID ?? '-1', transactionViolations))) {
259+
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID, transactionViolations))) {
260260
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('iou.pendingMatchWithCreditCard')};
261261
}
262262
return {shouldShow: false};
@@ -301,12 +301,8 @@ function MoneyRequestPreviewContent({
301301
// Clear the draft before selecting a different expense to prevent merging fields from the previous expense
302302
// (e.g., category, tag, tax) that may be not enabled/available in the new expense's policy.
303303
Transaction.abandonReviewDuplicateTransactions();
304-
const comparisonResult = TransactionUtils.compareDuplicateTransactionFields(
305-
reviewingTransactionID,
306-
transaction?.reportID ?? '',
307-
transaction?.transactionID ?? reviewingTransactionID,
308-
);
309-
Transaction.setReviewDuplicatesKey({...comparisonResult.keep, duplicates, transactionID: transaction?.transactionID ?? '', reportID: transaction?.reportID});
304+
const comparisonResult = TransactionUtils.compareDuplicateTransactionFields(reviewingTransactionID, transaction?.reportID, transaction?.transactionID ?? reviewingTransactionID);
305+
Transaction.setReviewDuplicatesKey({...comparisonResult.keep, duplicates, transactionID: transaction?.transactionID, reportID: transaction?.reportID});
310306

311307
if ('merchant' in comparisonResult.change) {
312308
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_MERCHANT_PAGE.getRoute(route.params?.threadReportID, backTo));
@@ -349,11 +345,13 @@ function MoneyRequestPreviewContent({
349345
!onPreviewPressed ? [styles.moneyRequestPreviewBox, containerStyles] : {},
350346
]}
351347
>
352-
<ReportActionItemImages
353-
images={receiptImages}
354-
isHovered={isHovered || isScanning}
355-
size={1}
356-
/>
348+
{!isDeleted && (
349+
<ReportActionItemImages
350+
images={receiptImages}
351+
isHovered={isHovered || isScanning}
352+
size={1}
353+
/>
354+
)}
357355
{isEmptyObject(transaction) && !ReportActionsUtils.isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? (
358356
<MoneyRequestSkeletonView />
359357
) : (

src/components/ReportActionItem/ReportPreview.tsx

+13-12
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function ReportPreview({
103103
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
104104
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET);
105105
const [invoiceReceiverPolicy] = useOnyx(
106-
`${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : -1}`,
106+
`${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : CONST.DEFAULT_NUMBER_ID}`,
107107
);
108108
const theme = useTheme();
109109
const styles = useThemeStyles();
@@ -144,10 +144,10 @@ function ReportPreview({
144144
const shouldDisableApproveButton = shouldShowApproveButton && !ReportUtils.isAllowedToApproveExpenseReport(iouReport);
145145

146146
const {nonHeldAmount, fullAmount, hasValidNonHeldAmount} = ReportUtils.getNonHeldAndFullAmount(iouReport, shouldShowPayButton);
147-
const hasOnlyHeldExpenses = ReportUtils.hasOnlyHeldExpenses(iouReport?.reportID ?? '');
148-
const hasHeldExpenses = ReportUtils.hasHeldExpenses(iouReport?.reportID ?? '');
147+
const hasOnlyHeldExpenses = ReportUtils.hasOnlyHeldExpenses(iouReport?.reportID);
148+
const hasHeldExpenses = ReportUtils.hasHeldExpenses(iouReport?.reportID);
149149

150-
const managerID = iouReport?.managerID ?? action.childManagerAccountID ?? 0;
150+
const managerID = iouReport?.managerID ?? action.childManagerAccountID ?? CONST.DEFAULT_NUMBER_ID;
151151
const {totalDisplaySpend, reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(iouReport);
152152

153153
const iouSettled = ReportUtils.isSettled(iouReportID) || action?.childStatusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
@@ -189,9 +189,8 @@ function ReportPreview({
189189
const lastThreeReceipts = lastThreeTransactions.map((transaction) => ({...ReceiptUtils.getThumbnailAndImageURIs(transaction), transaction}));
190190
const showRTERViolationMessage =
191191
numberOfRequests === 1 &&
192-
TransactionUtils.hasPendingUI(allTransactions.at(0), TransactionUtils.getTransactionViolations(allTransactions.at(0)?.transactionID ?? '-1', transactionViolations));
193-
const shouldShowBrokenConnectionViolation =
194-
numberOfRequests === 1 && TransactionUtils.shouldShowBrokenConnectionViolation(allTransactions.at(0)?.transactionID ?? '-1', iouReport, policy);
192+
TransactionUtils.hasPendingUI(allTransactions.at(0), TransactionUtils.getTransactionViolations(allTransactions.at(0)?.transactionID, transactionViolations));
193+
const shouldShowBrokenConnectionViolation = numberOfRequests === 1 && TransactionUtils.shouldShowBrokenConnectionViolation(allTransactions.at(0)?.transactionID, iouReport, policy);
195194
let formattedMerchant = numberOfRequests === 1 ? TransactionUtils.getMerchant(allTransactions.at(0)) : null;
196195
const formattedDescription = numberOfRequests === 1 ? TransactionUtils.getDescription(allTransactions.at(0)) : null;
197196

@@ -500,11 +499,13 @@ function ReportPreview({
500499
accessibilityLabel={translate('iou.viewDetails')}
501500
>
502501
<View style={[styles.reportPreviewBox, isHovered || isScanning || isWhisper ? styles.reportPreviewBoxHoverBorder : undefined]}>
503-
<ReportActionItemImages
504-
images={lastThreeReceipts}
505-
total={allTransactions.length}
506-
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
507-
/>
502+
{lastThreeReceipts.length > 0 && (
503+
<ReportActionItemImages
504+
images={lastThreeReceipts}
505+
total={allTransactions.length}
506+
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
507+
/>
508+
)}
508509
<View style={[styles.expenseAndReportPreviewBoxBody, hasReceipts ? styles.mtn1 : {}]}>
509510
<View style={shouldShowSettlementButton ? {} : styles.expenseAndReportPreviewTextButtonContainer}>
510511
<View style={styles.expenseAndReportPreviewTextContainer}>

0 commit comments

Comments
 (0)