Skip to content

Commit dc739cb

Browse files
committed
Merge branch 'main' of github.com:Expensify/App into jsenyitko-release-4-reimbursable-amt
2 parents eac16f9 + c8da63c commit dc739cb

69 files changed

Lines changed: 394 additions & 160 deletions

File tree

Some content is hidden

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

src/CONST/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,6 +2885,7 @@ const CONST = {
28852885
PER_DIEM: 'per-diem',
28862886
DISTANCE_MAP: 'distance-map',
28872887
DISTANCE_MANUAL: 'distance-manual',
2888+
DISTANCE_GPS: 'distance-gps',
28882889
},
28892890
EXPENSE_TYPE: {
28902891
DISTANCE: 'distance',
@@ -2895,6 +2896,7 @@ const CONST = {
28952896
PENDING_EXPENSIFY_CARD: 'pendingExpensifyCard',
28962897
DISTANCE_MAP: 'distance-map',
28972898
DISTANCE_MANUAL: 'distance-manual',
2899+
DISTANCE_GPS: 'distance-gps',
28982900
},
28992901
REPORT_ACTION_TYPE: {
29002902
PAY: 'pay',
@@ -5457,6 +5459,7 @@ const CONST = {
54575459
PER_DIEM: 'per-diem',
54585460
DISTANCE_MAP: 'distance-map',
54595461
DISTANCE_MANUAL: 'distance-manual',
5462+
DISTANCE_GPS: 'distance-gps',
54605463
},
54615464

54625465
STATUS_TEXT_MAX_LENGTH: 100,
@@ -6705,6 +6708,8 @@ const CONST = {
67056708
BASE_62_REPORT_ID: this.TABLE_COLUMNS.BASE_62_REPORT_ID,
67066709
REIMBURSABLE: this.TABLE_COLUMNS.REIMBURSABLE,
67076710
BILLABLE: this.TABLE_COLUMNS.BILLABLE,
6711+
TAX_RATE: this.TABLE_COLUMNS.TAX_RATE,
6712+
TAX_AMOUNT: this.TABLE_COLUMNS.TAX_AMOUNT,
67086713
STATUS: this.TABLE_COLUMNS.STATUS,
67096714
TITLE: this.TABLE_COLUMNS.TITLE,
67106715
ACTION: this.TABLE_COLUMNS.ACTION,
@@ -6806,6 +6811,7 @@ const CONST = {
68066811
ORIGINAL_AMOUNT: 'originalamount',
68076812
REIMBURSABLE: 'reimbursable',
68086813
BILLABLE: 'billable',
6814+
TAX_RATE: 'taxrate',
68096815
TOTAL_AMOUNT: 'amount',
68106816
TOTAL: 'total',
68116817
TYPE: 'type',

src/ROUTES.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,11 @@ const ROUTES = {
12561256
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backToReport?: string) =>
12571257
`${action as string}/${iouType as string}/start/${transactionID}/${reportID}/distance-new${backToReport ? `/${backToReport}` : ''}/distance-manual` as const,
12581258
},
1259+
DISTANCE_REQUEST_CREATE_TAB_GPS: {
1260+
route: 'distance-gps',
1261+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backToReport?: string) =>
1262+
`${action as string}/${iouType as string}/start/${transactionID}/${reportID}/distance-new${backToReport ? `/${backToReport}` : ''}/distance-gps` as const,
1263+
},
12591264
IOU_SEND_ADD_BANK_ACCOUNT: 'pay/new/add-bank-account',
12601265
IOU_SEND_ADD_DEBIT_CARD: 'pay/new/add-debit-card',
12611266
IOU_SEND_ENABLE_PAYMENTS: 'pay/new/enable-payments',

src/SCREENS.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ const SCREENS = {
327327
DISTANCE_CREATE: 'Money_Request_Distance_Create',
328328
STEP_DISTANCE_MAP: 'Money_Request_Step_Distance_Map',
329329
STEP_DISTANCE_MANUAL: 'Money_Request_Step_Distance_Manual',
330+
STEP_DISTANCE_GPS: 'Money_Request_Step_Distance_GPS',
330331
RECEIPT_PREVIEW: 'Money_Request_Receipt_preview',
331332
},
332333

src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import AttachmentView from '@components/Attachments/AttachmentView';
33
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
44
import {ShowContextMenuContext, showContextMenuForReport} from '@components/ShowContextMenuContext';
5+
import useLocalize from '@hooks/useLocalize';
56
import useNetwork from '@hooks/useNetwork';
67
import useOnyx from '@hooks/useOnyx';
78
import useThemeStyles from '@hooks/useThemeStyles';
@@ -28,6 +29,7 @@ function BaseAnchorForAttachmentsOnly({style, source = '', displayName = '', onP
2829
const sourceID = (source.match(CONST.REGEX.ATTACHMENT_ID) ?? [])[1];
2930

3031
const [download] = useOnyx(`${ONYXKEYS.COLLECTION.DOWNLOAD}${sourceID}`, {canBeMissing: true});
32+
const {translate} = useLocalize();
3133

3234
const {isOffline} = useNetwork();
3335
const styles = useThemeStyles();
@@ -44,7 +46,7 @@ function BaseAnchorForAttachmentsOnly({style, source = '', displayName = '', onP
4446
return;
4547
}
4648
setDownload(sourceID, true);
47-
fileDownload(sourceURLWithAuth, displayName, '', isMobileSafari()).then(() => setDownload(sourceID, false));
49+
fileDownload(translate, sourceURLWithAuth, displayName, '', isMobileSafari()).then(() => setDownload(sourceID, false));
4850
}}
4951
onPressIn={onPressIn}
5052
onPressOut={onPressOut}

src/components/AttachmentPicker/index.native.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function AttachmentPicker({
164164
if (response.errorCode) {
165165
switch (response.errorCode) {
166166
case 'permission':
167-
showCameraPermissionsAlert();
167+
showCameraPermissionsAlert(translate);
168168
return resolve();
169169
default:
170170
showGeneralAlert();
@@ -242,7 +242,7 @@ function AttachmentPicker({
242242
}
243243
});
244244
}),
245-
[fileLimit, showGeneralAlert, type],
245+
[fileLimit, showGeneralAlert, translate, type],
246246
);
247247
/**
248248
* Launch the DocumentPicker. Results are in the same format as ImagePicker

src/components/DotIndicatorMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr
7474
if (href.endsWith('retry')) {
7575
handleRetryPress(receiptError, dismissError, setShouldShowErrorModal);
7676
} else if (href.endsWith('download')) {
77-
fileDownload(receiptError.source, receiptError.filename).finally(() => dismissError());
77+
fileDownload(translate, receiptError.source, receiptError.filename).finally(() => dismissError());
7878
}
7979
};
8080

src/components/MoneyReportHeader.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,13 @@ function MoneyReportHeader({
782782
setOfflineModalVisible(true);
783783
return;
784784
}
785-
exportReportToCSV({reportID: moneyRequestReport.reportID, transactionIDList: transactionIDs}, () => {
786-
setDownloadErrorModalVisible(true);
787-
});
785+
exportReportToCSV(
786+
{reportID: moneyRequestReport.reportID, transactionIDList: transactionIDs},
787+
() => {
788+
setDownloadErrorModalVisible(true);
789+
},
790+
translate,
791+
);
788792
},
789793
},
790794
[CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION]: {
@@ -1423,9 +1427,9 @@ function MoneyReportHeader({
14231427
if (!hasFinishedPDFDownload || !canTriggerAutomaticPDFDownload.current) {
14241428
return;
14251429
}
1426-
downloadReportPDF(reportPDFFilename, moneyRequestReport?.reportName ?? '');
1430+
downloadReportPDF(reportPDFFilename, moneyRequestReport?.reportName ?? '', translate);
14271431
canTriggerAutomaticPDFDownload.current = false;
1428-
}, [hasFinishedPDFDownload, reportPDFFilename, moneyRequestReport?.reportName]);
1432+
}, [hasFinishedPDFDownload, reportPDFFilename, moneyRequestReport?.reportName, translate]);
14291433

14301434
const shouldShowBackButton = shouldDisplayBackButton || shouldUseNarrowLayout;
14311435

@@ -1734,7 +1738,7 @@ function MoneyReportHeader({
17341738
if (!hasFinishedPDFDownload) {
17351739
setIsPDFModalVisible(false);
17361740
} else {
1737-
downloadReportPDF(reportPDFFilename, moneyRequestReport?.reportName ?? '');
1741+
downloadReportPDF(reportPDFFilename, moneyRequestReport?.reportName ?? '', translate);
17381742
}
17391743
}}
17401744
text={hasFinishedPDFDownload ? translate('common.download') : translate('common.cancel')}

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ function MoneyRequestConfirmationList({
429429
setFormError('');
430430

431431
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- we don't want this effect to run if it's just setFormError that changes
432-
}, [isFocused, transaction, shouldDisplayFieldError, hasSmartScanFailed, didConfirmSplit]);
432+
}, [isFocused, shouldDisplayFieldError, hasSmartScanFailed, didConfirmSplit]);
433433

434434
useEffect(() => {
435435
// We want this effect to run only when the transaction is moving from Self DM to a expense chat

src/components/QRShare/QRShareWithDownload/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function QRShareWithDownload({ref, ...props}: QRShareWithDownloadProps) {
1717
ref,
1818
() => ({
1919
download: () =>
20-
qrCodeScreenshotRef.current?.capture?.().then((uri) => fileDownload(uri, getQrCodeFileName(props.title ?? 'QRCode'), translate('fileDownload.success.qrMessage'))),
20+
qrCodeScreenshotRef.current?.capture?.().then((uri) => fileDownload(translate, uri, getQrCodeFileName(props.title ?? 'QRCode'), translate('fileDownload.success.qrMessage'))),
2121
}),
2222
[props.title, translate],
2323
);

src/components/QRShare/QRShareWithDownload/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, {useImperativeHandle, useRef} from 'react';
22
import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName';
33
import type {QRShareHandle} from '@components/QRShare/types';
4+
import useLocalize from '@hooks/useLocalize';
45
import useNetwork from '@hooks/useNetwork';
56
import fileDownload from '@libs/fileDownload';
67
import QRShare from '..';
@@ -9,6 +10,7 @@ import type {QRShareWithDownloadProps} from './types';
910
function QRShareWithDownload({ref, ...props}: QRShareWithDownloadProps) {
1011
const {isOffline} = useNetwork();
1112
const qrShareRef = useRef<QRShareHandle>(null);
13+
const {translate} = useLocalize();
1214

1315
useImperativeHandle(
1416
ref,
@@ -22,10 +24,10 @@ function QRShareWithDownload({ref, ...props}: QRShareWithDownloadProps) {
2224
return;
2325
}
2426

25-
svg.toDataURL((dataURL) => resolve(fileDownload(dataURL, getQrCodeFileName(props.title ?? 'QRCode'))));
27+
svg.toDataURL((dataURL) => resolve(fileDownload(translate, dataURL, getQrCodeFileName(props.title ?? 'QRCode'))));
2628
}),
2729
}),
28-
[props.title],
30+
[props.title, translate],
2931
);
3032

3133
return (

0 commit comments

Comments
 (0)