Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8fb16bc
ref: migrate AddressForm to TS
kubabutkiewicz Feb 23, 2024
06d3b9a
ref: move WorkspaceResetBanAccountModal to TS, fixes for AddressForm
kubabutkiewicz Feb 23, 2024
9f40e79
ref: move RequestorStep to TS
kubabutkiewicz Feb 23, 2024
3125cbe
ref: remove RequestorOnfidoStep because its not used anywhere
kubabutkiewicz Feb 23, 2024
08a5d4e
ref: move ReimbursementAccount page and did few adjustments
kubabutkiewicz Feb 23, 2024
8c18188
ref: move ACHContractStep to TS
kubabutkiewicz Feb 26, 2024
1ca6fb0
ref: move BankAccountStep to TS
kubabutkiewicz Feb 26, 2024
ceb9fab
ref: move CompanyStep to TS
kubabutkiewicz Feb 26, 2024
646a2e5
ref: move ContinueBankAccountStep, ExampleCheck to TS, started workin…
kubabutkiewicz Feb 26, 2024
d13da54
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Feb 26, 2024
67f3da4
fix: typecheck
kubabutkiewicz Feb 27, 2024
093fe8f
fix: typecheck
kubabutkiewicz Feb 27, 2024
ee1949b
fix: small adjustment
kubabutkiewicz Feb 27, 2024
3907ee7
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Feb 28, 2024
a3dbead
fix: lint
kubabutkiewicz Feb 28, 2024
2a416fd
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Feb 28, 2024
997c4ed
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Feb 28, 2024
55630d6
fix: lint
kubabutkiewicz Feb 28, 2024
0743b0e
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Feb 28, 2024
bd53388
fix: resolve comments
kubabutkiewicz Feb 29, 2024
0148be1
fix: typecheck
kubabutkiewicz Feb 29, 2024
6b82c5d
fix: lint
kubabutkiewicz Feb 29, 2024
7f85aba
fix: resolve comments
kubabutkiewicz Feb 29, 2024
3929cc8
fix: resolve comments
kubabutkiewicz Feb 29, 2024
1862ea3
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 26, 2024
1bf4824
fix: resolve typecheck
kubabutkiewicz Mar 26, 2024
f569304
feat: move RequestorOnfidoStep to TS
kubabutkiewicz Mar 26, 2024
37bbc00
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 27, 2024
680c3e8
fix: lint and typecheck
kubabutkiewicz Mar 27, 2024
1d9571a
fix: lint
kubabutkiewicz Mar 27, 2024
6dab98a
fix: typecheck
kubabutkiewicz Mar 27, 2024
ee0cff1
fix: resolve comments
kubabutkiewicz Mar 27, 2024
2c8ec25
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 28, 2024
5cf516e
fix: lint
kubabutkiewicz Mar 28, 2024
40251dd
fix: resolve comments
kubabutkiewicz Mar 29, 2024
1fa4868
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 29, 2024
d3d38d1
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 29, 2024
322ddc0
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 2, 2024
f4943c9
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 3, 2024
6c49728
fix: resolve conflicts
kubabutkiewicz Apr 3, 2024
c1dd9b7
fix: typecheck
kubabutkiewicz Apr 3, 2024
c7076f3
fix: resolve comments
kubabutkiewicz Apr 3, 2024
302b4c4
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 5, 2024
3bd3b3b
fix: resolve comments
kubabutkiewicz Apr 5, 2024
dea796d
fix: removed unused type
kubabutkiewicz Apr 5, 2024
9086168
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 8, 2024
7f1ec9d
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 9, 2024
7023d38
fix: typecheck
kubabutkiewicz Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function AddressForm({
city: INPUT_IDS.CITY,
state: INPUT_IDS.STATE,
zipCode: INPUT_IDS.ZIP_POST_CODE,
country: INPUT_IDS.COUNTRY,
country: INPUT_IDS.COUNTRY as Country,
}}
maxInputLength={CONST.FORM_CHARACTER_LIMIT}
shouldSaveDraft={shouldSaveDraft}
Expand Down
5 changes: 3 additions & 2 deletions src/components/AddressSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import type {GeolocationErrorCodeType} from '@libs/getCurrentPosition/getCurrent
import * as GooglePlacesUtils from '@libs/GooglePlacesUtils';
Comment thread
kubabutkiewicz marked this conversation as resolved.
import variables from '@styles/variables';
import CONST from '@src/CONST';
import type {Address} from '@src/types/onyx/PrivatePersonalDetails';
import CurrentLocationButton from './CurrentLocationButton';
import isCurrentTargetInsideContainer from './isCurrentTargetInsideContainer';
import type {AddressSearchProps, RenamedInputKeysProps} from './types';
import type {AddressSearchProps} from './types';

// The error that's being thrown below will be ignored until we fork the
// react-native-google-places-autocomplete repo and replace the
Expand Down Expand Up @@ -213,7 +214,7 @@ function AddressSearch(

if (inputID) {
Object.entries(values).forEach(([key, inputValue]) => {
const inputKey = renamedInputKeys?.[key as keyof RenamedInputKeysProps] ?? key;
const inputKey = renamedInputKeys?.[key as keyof Address] ?? key;
if (!inputKey) {
return;
}
Expand Down
19 changes: 4 additions & 15 deletions src/components/AddressSearch/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {NativeSyntheticEvent, StyleProp, TextInputFocusEventData, View, Vie
import type {Place} from 'react-native-google-places-autocomplete';
import type {MaybePhraseKey} from '@libs/Localize';
import type Locale from '@src/types/onyx/Locale';
import type {Address} from '@src/types/onyx/PrivatePersonalDetails';

type CurrentLocationButtonProps = {
/** Callback that is called when the button is clicked */
Expand All @@ -12,18 +13,6 @@ type CurrentLocationButtonProps = {
isDisabled?: boolean;
};

type RenamedInputKeysProps = {
street: string;
street2: string;
city: string;
state: string;
lat?: string;
lng?: string;
zipCode: string;
address?: string;
country?: string;
};

type OnPressProps = {
address: string;
lat: number;
Expand Down Expand Up @@ -61,7 +50,7 @@ type AddressSearchProps = {
defaultValue?: string;

/** A callback function when the value of this field has changed */
onInputChange?: (value: string | number | RenamedInputKeysProps | StreetValue, key?: string) => void;
onInputChange?: (value: string | number | Address | StreetValue, key?: string) => void;

/** A callback function when an address has been auto-selected */
onPress?: (props: OnPressProps) => void;
Expand All @@ -79,7 +68,7 @@ type AddressSearchProps = {
predefinedPlaces?: Place[] | null;

/** A map of inputID key names */
renamedInputKeys?: RenamedInputKeysProps;
renamedInputKeys?: Address;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to replace the type here?

I find a little confusing to sometimes use the Address type as an address and sometimes as this key map.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason for replacing that it turned out that both types are the same so there is no reason to keep them both


/** Maximum number of characters allowed in search input */
maxInputLength?: number;
Expand All @@ -96,4 +85,4 @@ type AddressSearchProps = {

type IsCurrentTargetInsideContainerType = (event: FocusEvent | NativeSyntheticEvent<TextInputFocusEventData>, containerRef: RefObject<View | HTMLElement>) => boolean;

export type {CurrentLocationButtonProps, AddressSearchProps, RenamedInputKeysProps, IsCurrentTargetInsideContainerType, StreetValue};
export type {CurrentLocationButtonProps, AddressSearchProps, IsCurrentTargetInsideContainerType, StreetValue};
2 changes: 2 additions & 0 deletions src/components/StateSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ function StateSelector(
StateSelector.displayName = 'StateSelector';

export default React.forwardRef(StateSelector);

export type {State};
5 changes: 3 additions & 2 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,9 @@ type AddPersonalBankAccountNavigatorParamList = {

type ReimbursementAccountNavigatorParamList = {
[SCREENS.REIMBURSEMENT_ACCOUNT_ROOT]: {
stepToOpen: string;
policyID: string;
stepToOpen?: string;
backTo?: Routes;
policyID?: string;
};
};

Expand Down
7 changes: 4 additions & 3 deletions src/libs/actions/BankAccounts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {OnyxEntry} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
import type {OnfidoDataWithApplicantID} from '@components/Onfido/types';
Expand Down Expand Up @@ -70,7 +71,7 @@ function openPlaidView() {
clearPlaid().then(() => ReimbursementAccount.setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID));
}

function setPlaidEvent(eventName: string) {
function setPlaidEvent(eventName: OnyxEntry<string>) {
Onyx.set(ONYXKEYS.PLAID_CURRENT_EVENT, eventName);
}

Expand Down Expand Up @@ -463,11 +464,11 @@ function connectBankAccountManually(bankAccountID: number, bankAccount: PlaidBan
/**
* Verify the user's identity via Onfido
*/
function verifyIdentityForBankAccount(bankAccountID: number, onfidoData: OnfidoDataWithApplicantID, policyID: string) {
function verifyIdentityForBankAccount(bankAccountID: number, onfidoData: OnfidoDataWithApplicantID, policyID?: string) {
const parameters: VerifyIdentityForBankAccountParams = {
bankAccountID,
onfidoData: JSON.stringify(onfidoData),
policyID,
policyID: policyID ?? '',
canUseNewVbbaFlow: true,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type * as OnyxTypes from '@src/types/onyx';
/**
* Reset user's reimbursement account. This will delete the bank account.
*/
function resetFreePlanBankAccount(bankAccountID: number, session: OnyxEntry<OnyxTypes.Session>, policyID: string, user: OnyxEntry<OnyxTypes.User>) {
function resetFreePlanBankAccount(bankAccountID: number | undefined, session: OnyxEntry<OnyxTypes.Session>, policyID: string, user: OnyxEntry<OnyxTypes.User>) {
if (!bankAccountID) {
throw new Error('Missing bankAccountID when attempting to reset free plan bank account');
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/EnablePayments/AdditionalDetailsStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ function AdditionalDetailsStep({walletAdditionalDetails = DEFAULT_WALLET_ADDITIO
state: 'addressState',
zipCode: 'addressZipCode',
}}
translate={translate}
streetTranslationKey={fieldNameTranslationKeys.addressStreet}
shouldSaveDraft
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import PropTypes from 'prop-types';
import React from 'react';
import CompleteVerification from './CompleteVerification/CompleteVerification';

const propTypes = {
type ACHContractStepProps = {
/** Goes to the previous step */
onBackButtonPress: PropTypes.func.isRequired,
onBackButtonPress: () => void;
};

function ACHContractStep({onBackButtonPress}) {
function ACHContractStep({onBackButtonPress}: ACHContractStepProps) {
return <CompleteVerification onBackButtonPress={onBackButtonPress} />;
}

ACHContractStep.propTypes = propTypes;
ACHContractStep.displayName = 'ACHContractStep';

export default ACHContractStep;
Comment thread
kubabutkiewicz marked this conversation as resolved.
163 changes: 0 additions & 163 deletions src/pages/ReimbursementAccount/AddressForm.js

This file was deleted.

Loading