Skip to content

Commit 7cc462c

Browse files
committed
Merge branch 'main' into marcaaron-fixVersions
2 parents 0710f20 + 3f91630 commit 7cc462c

136 files changed

Lines changed: 1070 additions & 897 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.

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const restrictedImportPaths = [
1414
'Text',
1515
'ScrollView',
1616
'Animated',
17+
'findNodeHandle',
1718
],
1819
message: [
1920
'',
@@ -105,6 +106,10 @@ const restrictedImportPaths = [
105106
importNames: ['useOnyx'],
106107
message: "Please use '@hooks/useOnyx' instead.",
107108
},
109+
{
110+
name: '@src/utils/findNodeHandle',
111+
message: "Do not use 'findNodeHandle' as it is no longer supported on web.",
112+
},
108113
];
109114

110115
const restrictedImportPatterns = [

Mobile-Expensify

jest/setupMockFullstoryLib.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
type FSPageInterface = {
2-
start: jest.Mock<void, []>;
3-
};
1+
import type {Fullstory, FSPageLike as mockFSPageLike} from '@libs/Fullstory/types';
42

53
export default function mockFSLibrary() {
64
jest.mock('@fullstory/react-native', () => {
7-
class Fullstory {
8-
consent = jest.fn();
9-
10-
anonymize = jest.fn();
5+
return {
6+
FSPage: jest.fn(),
7+
default: jest.fn(),
8+
};
9+
});
1110

12-
identify = jest.fn();
11+
jest.mock<Fullstory>('@libs/Fullstory', () => {
12+
class FSPage implements mockFSPageLike {
13+
start() {}
1314
}
1415

1516
return {
16-
FSPage(): FSPageInterface {
17-
return {
18-
start: jest.fn(() => {}),
19-
};
20-
},
21-
default: Fullstory,
17+
Page: FSPage,
18+
getChatFSClass: jest.fn(),
19+
init: jest.fn(),
20+
onReady: jest.fn(),
21+
consent: jest.fn(),
22+
identify: jest.fn(),
23+
consentAndIdentify: jest.fn(),
24+
anonymize: jest.fn(),
2225
};
2326
});
2427
}

patches/react-native-web/details.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,7 @@
108108
- E/App issue: 🛑
109109
- PR introducing patch: https://github.com/Expensify/App/pull/60340
110110
111-
### [react-native-web+0.20.0+010+restore-findNodeHandle.patch](react-native-web+0.20.0+010+restore-findNodeHandle.patch)
112-
113-
- Reason:
114-
115-
```
116-
Changes `findNodeHandle()` to log a Console warning instead of throwing an Error when being called.
117-
```
118-
119-
- Upstream PR/issue: 🛑
120-
- E/App issue: 🛑
121-
- PR introducing patch: https://github.com/Expensify/App/pull/60421
122-
123-
### [react-native-web+0.20.0+011+fullstory-support.patch](react-native-web+0.20.0+011+fullstory-support.patch)
111+
### [react-native-web+0.20.0+010+fullstory-support.patch](react-native-web+0.20.0+010+fullstory-support.patch)
124112
125113
- Reason:
126114

patches/react-native-web/react-native-web+0.20.0+011+fullstory-support.patch renamed to patches/react-native-web/react-native-web+0.20.0+010+fullstory-support.patch

File renamed without changes.

patches/react-native-web/react-native-web+0.20.0+010+restore-findNodeHandle.patch

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/CONST/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,6 @@ const CONST = {
18611861
MSWORD: 'application/msword',
18621862
ZIP: 'application/zip',
18631863
RFC822: 'message/rfc822',
1864-
HEIC: 'image/heic',
18651864
},
18661865

18671866
SHARE_FILE_MIMETYPE: {
@@ -1872,7 +1871,6 @@ const CONST = {
18721871
WEBP: 'image/webp',
18731872
TIF: 'image/tif',
18741873
TIFF: 'image/tiff',
1875-
HEIC: 'image/heic',
18761874
IMG: 'image/*',
18771875
PDF: 'application/pdf',
18781876
MSWORD: 'application/msword',

src/ROUTES.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,12 @@ const ROUTES = {
618618
),
619619
},
620620
MONEY_REQUEST_STEP_AMOUNT: {
621-
route: ':action/:iouType/amount/:transactionID/:reportID/:pageIndex?/:backToReport?',
622-
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, pageIndex: string, backTo = '') => {
621+
route: ':action/:iouType/amount/:transactionID/:reportID/:reportActionID?/:pageIndex?/:backToReport?',
622+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, reportActionID?: string, pageIndex?: string, backTo = '') => {
623623
if (!transactionID || !reportID) {
624624
Log.warn('Invalid transactionID or reportID is used to build the MONEY_REQUEST_STEP_AMOUNT route');
625625
}
626-
return getUrlWithBackToParam(`${action as string}/${iouType as string}/amount/${transactionID}/${reportID}/${pageIndex}`, backTo);
626+
return getUrlWithBackToParam(`${action as string}/${iouType as string}/amount/${transactionID}/${reportID}/${reportActionID ? `${reportActionID}/` : ''}${pageIndex}`, backTo);
627627
},
628628
},
629629
MONEY_REQUEST_STEP_TAX_RATE: {
@@ -707,9 +707,9 @@ const ROUTES = {
707707
getUrlWithBackToParam(`${action as string}/${iouType as string}/subrate/${transactionID}/${reportID}/edit/${pageIndex}`, backTo),
708708
},
709709
MONEY_REQUEST_STEP_REPORT: {
710-
route: ':action/:iouType/report/:transactionID/:reportID',
711-
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backTo = '') =>
712-
getUrlWithBackToParam(`${action as string}/${iouType as string}/report/${transactionID}/${reportID}`, backTo),
710+
route: ':action/:iouType/report/:transactionID/:reportID/:reportActionID?',
711+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backTo = '', reportActionID?: string) =>
712+
getUrlWithBackToParam(`${action as string}/${iouType as string}/report/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo),
713713
},
714714
MONEY_REQUEST_EDIT_REPORT: {
715715
route: ':action/:iouType/report/:reportID/edit',
@@ -835,30 +835,30 @@ const ROUTES = {
835835
},
836836
},
837837
MONEY_REQUEST_STEP_DISTANCE: {
838-
route: ':action/:iouType/distance/:transactionID/:reportID',
839-
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '') => {
838+
route: ':action/:iouType/distance/:transactionID/:reportID/:reportActionID?',
839+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '', reportActionID?: string) => {
840840
if (!transactionID || !reportID) {
841841
Log.warn('Invalid transactionID or reportID is used to build the MONEY_REQUEST_STEP_DISTANCE route');
842842
}
843-
return getUrlWithBackToParam(`${action as string}/${iouType as string}/distance/${transactionID}/${reportID}`, backTo);
843+
return getUrlWithBackToParam(`${action as string}/${iouType as string}/distance/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo);
844844
},
845845
},
846846
MONEY_REQUEST_STEP_DISTANCE_RATE: {
847-
route: ':action/:iouType/distanceRate/:transactionID/:reportID',
848-
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '') => {
847+
route: ':action/:iouType/distanceRate/:transactionID/:reportID/:reportActionID?',
848+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '', reportActionID?: string) => {
849849
if (!transactionID || !reportID) {
850850
Log.warn('Invalid transactionID or reportID is used to build the MONEY_REQUEST_STEP_DISTANCE_RATE route');
851851
}
852-
return getUrlWithBackToParam(`${action as string}/${iouType as string}/distanceRate/${transactionID}/${reportID}`, backTo);
852+
return getUrlWithBackToParam(`${action as string}/${iouType as string}/distanceRate/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo);
853853
},
854854
},
855855
MONEY_REQUEST_STEP_MERCHANT: {
856-
route: ':action/:iouType/merchant/:transactionID/:reportID',
857-
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '') => {
856+
route: ':action/:iouType/merchant/:transactionID/:reportID/:reportActionID?',
857+
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '', reportActionID?: string) => {
858858
if (!transactionID || !reportID) {
859859
Log.warn('Invalid transactionID or reportID is used to build the MONEY_REQUEST_STEP_MERCHANT route');
860860
}
861-
return getUrlWithBackToParam(`${action as string}/${iouType as string}/merchant/${transactionID}/${reportID}`, backTo);
861+
return getUrlWithBackToParam(`${action as string}/${iouType as string}/merchant/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo);
862862
},
863863
},
864864
MONEY_REQUEST_STEP_PARTICIPANTS: {

src/components/BaseMiniContextMenuItem.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {ForwardedRef} from 'react';
21
import React from 'react';
32
import type {PressableStateCallbackType} from 'react-native';
43
import {View} from 'react-native';
@@ -9,6 +8,7 @@ import getButtonState from '@libs/getButtonState';
98
import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager';
109
import variables from '@styles/variables';
1110
import CONST from '@src/CONST';
11+
import type {PressableRef} from './Pressable/GenericPressable/types';
1212
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
1313
import Tooltip from './Tooltip/PopoverAnchorTooltip';
1414

@@ -36,16 +36,18 @@ type BaseMiniContextMenuItemProps = {
3636
* Can be used to control the click event, and for example whether or not to lose focus from the composer when pressing the item
3737
*/
3838
shouldPreventDefaultFocusOnPress?: boolean;
39+
40+
/**
41+
* Reference to the outer element
42+
*/
43+
ref?: PressableRef;
3944
};
4045

4146
/**
4247
* Component that renders a mini context menu item with a
4348
* pressable. Also renders a tooltip when hovering the item.
4449
*/
45-
function BaseMiniContextMenuItem(
46-
{tooltipText, onPress, children, isDelayButtonStateComplete = true, shouldPreventDefaultFocusOnPress = true}: BaseMiniContextMenuItemProps,
47-
ref: ForwardedRef<View>,
48-
) {
50+
function BaseMiniContextMenuItem({tooltipText, onPress, children, isDelayButtonStateComplete = true, shouldPreventDefaultFocusOnPress = true, ref}: BaseMiniContextMenuItemProps) {
4951
const styles = useThemeStyles();
5052
const StyleUtils = useStyleUtils();
5153
return (
@@ -95,4 +97,4 @@ function BaseMiniContextMenuItem(
9597

9698
BaseMiniContextMenuItem.displayName = 'BaseMiniContextMenuItem';
9799

98-
export default React.forwardRef(BaseMiniContextMenuItem);
100+
export default BaseMiniContextMenuItem;

0 commit comments

Comments
 (0)