Skip to content

Commit fe1645d

Browse files
committed
Merge branch 'main' into @zfurtak/migrate-AssigneeStep
2 parents 15d42cd + 25f1d97 commit fe1645d

File tree

34 files changed

+272
-148
lines changed

34 files changed

+272
-148
lines changed

Mobile-Expensify

jest/setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import * as core from '@actions/core';
33
import '@shopify/flash-list/jestSetup';
44
import type * as RNAppLogs from 'react-native-app-logs';
5+
import type {ReadDirItem} from 'react-native-fs';
56
import 'react-native-gesture-handler/jestSetup';
67
import type * as RNKeyboardController from 'react-native-keyboard-controller';
78
import mockStorage from 'react-native-onyx/dist/storage/__mocks__';
@@ -69,6 +70,12 @@ jest.mock('react-native-fs', () => ({
6970
res();
7071
}),
7172
),
73+
readDir: jest.fn(
74+
() =>
75+
new Promise<ReadDirItem[]>((res) => {
76+
res([]);
77+
}),
78+
),
7279
CachesDirectoryPath: jest.fn(),
7380
}));
7481

package-lock.json

Lines changed: 4 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
"eslint-plugin-storybook": "^0.12.0",
322322
"eslint-plugin-testing-library": "^7.11.0",
323323
"eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
324-
"glob": "^10.3.0",
324+
"glob": "^10.4.5",
325325
"googleapis": "^144.0.0",
326326
"html-webpack-plugin": "^5.5.0",
327327
"http-server": "^14.1.1",

src/ONYXKEYS.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ const ONYXKEYS = {
132132
/** Whether the user is a member of a policy other than their personal */
133133
HAS_NON_PERSONAL_POLICY: 'hasNonPersonalPolicy',
134134

135+
/** Key under which selfDM id is stored. Returned by OpenApp */
136+
SELF_DM_REPORT_ID: 'selfDMReportID',
137+
135138
/** NVP keys */
136139

137140
/** This NVP contains list of at most 5 recent attendees */
@@ -1297,6 +1300,7 @@ type OnyxValuesMapping = {
12971300
[ONYXKEYS.NVP_CSV_EXPORT_LAYOUTS]: Record<string, OnyxTypes.ExportTemplate>;
12981301
[ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE]: DistanceExpenseType;
12991302
[ONYXKEYS.HAS_DENIED_CONTACT_IMPORT_PROMPT]: boolean | undefined;
1303+
[ONYXKEYS.SELF_DM_REPORT_ID]: string | undefined;
13001304
};
13011305

13021306
type OnyxDerivedValuesMapping = {

src/ROUTES.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,23 @@ const ROUTES = {
148148
REQUIRE_TWO_FACTOR_AUTH: '2fa-required',
149149

150150
BANK_ACCOUNT: 'bank-account',
151+
BANK_ACCOUNT_VERIFY_ACCOUNT: {
152+
route: `bank-account/${VERIFY_ACCOUNT}`,
153+
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
154+
getRoute: (policyID?: string, backTo?: string) => getUrlWithBackToParam(`bank-account/${VERIFY_ACCOUNT}?policyID=${policyID}`, backTo),
155+
},
151156
BANK_ACCOUNT_NEW: 'bank-account/new',
152157
BANK_ACCOUNT_PERSONAL: 'bank-account/personal',
153158
BANK_ACCOUNT_WITH_STEP_TO_OPEN: {
154159
route: 'bank-account/:stepToOpen?',
155-
getRoute: (policyID: string | undefined, stepToOpen: ReimbursementAccountStepToOpen = '', backTo?: string) => {
160+
getRoute: (policyID: string | undefined, stepToOpen: ReimbursementAccountStepToOpen = '', backTo?: string, subStepToOpen?: typeof CONST.BANK_ACCOUNT.STEP.COUNTRY) => {
156161
if (!policyID) {
157162
Log.warn('Invalid policyID is used to build the BANK_ACCOUNT_WITH_STEP_TO_OPEN route');
158163
}
159-
164+
// TODO this backTo comes from drilling it through bank account form screens
165+
// should be removed once https://github.com/Expensify/App/pull/72219 is resolved
160166
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
161-
return getUrlWithBackToParam(`bank-account/${stepToOpen}?policyID=${policyID}`, backTo);
167+
return getUrlWithBackToParam(`bank-account/${stepToOpen}?policyID=${policyID}${subStepToOpen ? `&subStep=${subStepToOpen}` : ''}`, backTo);
162168
},
163169
},
164170
BANK_ACCOUNT_ENTER_SIGNER_INFO: {
@@ -380,7 +386,7 @@ const ROUTES = {
380386
getRoute: (newContactMethod: string, backTo?: string) => {
381387
const encodedMethod = encodeURIComponent(newContactMethod);
382388
// TODO this backTo comes from drilling it through settings screens
383-
// should be removed once https://github.com/Expensify/App/pull/70980 is resolved
389+
// should be removed once https://github.com/Expensify/App/pull/72219 is resolved
384390
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
385391
return getUrlWithBackToParam(`settings/profile/contact-methods/new/${encodedMethod}/confirm-magic-code`, backTo);
386392
},

src/SCREENS.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ const SCREENS = {
766766
ENABLE_PAYMENTS_ROOT: 'EnablePayments_Root',
767767
ADD_PERSONAL_BANK_ACCOUNT_ROOT: 'AddPersonalBankAccount_Root',
768768
REIMBURSEMENT_ACCOUNT_ROOT: 'Reimbursement_Account_Root',
769+
REIMBURSEMENT_ACCOUNT_VERIFY_ACCOUNT: 'Reimbursement_Account_Verify_Account',
769770
WALLET_STATEMENT_ROOT: 'WalletStatement_Root',
770771
SIGN_IN_ROOT: 'SignIn_Root',
771772
DETAILS_ROOT: 'Details_Root',

src/components/ValidateCodeActionModal/ValidateCodeActionContent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function ValidateCodeActionContent({
2525
isLoading,
2626
threeDotsMenuItems = [],
2727
onThreeDotsButtonPress = () => {},
28+
isPageModal = true,
2829
}: ValidateCodeActionContentProps) {
2930
const themeStyles = useThemeStyles();
3031
const validateCodeFormRef = useRef<ValidateCodeFormHandle>(null);
@@ -84,6 +85,7 @@ function ValidateCodeActionContent({
8485
clearError={clearError}
8586
buttonStyles={[themeStyles.justifyContentEnd, themeStyles.flex1]}
8687
ref={validateCodeFormRef}
88+
isInPageModal={isPageModal}
8789
/>
8890
</View>
8991
</ScrollView>

src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ type ValidateCodeFormProps = {
8989

9090
/** Function to call when skip button is pressed */
9191
handleSkipButtonPress?: () => void;
92+
93+
/** Whether the modal is used as a page modal. Used to determine input auto focus timing. */
94+
isInPageModal?: boolean;
9295
};
9396

9497
function BaseValidateCodeForm({
@@ -107,6 +110,7 @@ function BaseValidateCodeForm({
107110
isLoading,
108111
shouldShowSkipButton = false,
109112
handleSkipButtonPress,
113+
isInPageModal = false,
110114
}: ValidateCodeFormProps) {
111115
const {translate} = useLocalize();
112116
const {isOffline} = useNetwork();
@@ -200,14 +204,14 @@ function BaseValidateCodeForm({
200204
}
201205
// Delay prevents the input from gaining focus before the RHP slide out animation finishes,
202206
// which would cause the wide RHP to flicker in the background.
203-
if (wideRHPRouteKeys.length > 0 && !isMobileSafari()) {
207+
if ((wideRHPRouteKeys.length > 0 && !isMobileSafari()) || isInPageModal) {
204208
focusTimeoutRef.current = setTimeout(() => {
205209
inputValidateCodeRef.current?.clear();
206210
}, CONST.ANIMATED_TRANSITION);
207211
} else {
208212
inputValidateCodeRef.current?.clear();
209213
}
210-
}, [validateCodeSent, wideRHPRouteKeys.length]);
214+
}, [validateCodeSent, wideRHPRouteKeys.length, isInPageModal]);
211215

212216
/**
213217
* Request a validate code / magic code be sent to verify this contact method

src/components/ValidateCodeActionModal/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function ValidateCodeActionModal({
4949
threeDotsMenuItems={threeDotsMenuItems}
5050
onThreeDotsButtonPress={onThreeDotsButtonPress}
5151
isLoading={isLoading}
52+
isPageModal={false}
5253
/>
5354
</Modal>
5455
);

0 commit comments

Comments
 (0)