Skip to content

Commit

Permalink
fix: linter/ts
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Oct 11, 2024
1 parent dc98c23 commit a4608b5
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/components/ImportOnyxState/BaseImportOnyxState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function BaseImportOnyxState({
wrapperStyle={[styles.sectionMenuItemTopDescription]}
onPress={() => {
openPicker({
onPicked: onFileRead,
onPicked: (data) => onFileRead(data.at(0) ?? {}),
});
}}
/>
Expand Down
18 changes: 11 additions & 7 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ import type {
CharacterLengthLimitParams,
CharacterLimitParams,
CompanyCardFeedNameParams,
CompanyNameParams,
ConfirmThatParams,
ConnectionNameParams,
ConnectionParams,
CurrencyCodeParams,
CustomersOrJobsLabelParams,
DateParams,
DateShouldBeAfterParams,
Expand All @@ -63,6 +65,7 @@ import type {
ExportedToIntegrationParams,
ExportIntegrationSelectedParams,
FeatureNameParams,
FileLimitParams,
FiltersAmountBetweenParams,
FormattedMaxLengthParams,
ForwardedAmountParams,
Expand All @@ -81,6 +84,7 @@ import type {
InvalidPropertyParams,
InvalidValueParams,
IssueVirtualCardParams,
LastFourDigitsParams,
LastSyncAccountingParams,
LastSyncDateParams,
LocalTimeParams,
Expand Down Expand Up @@ -507,7 +511,7 @@ const translations = {
attachmentImageTooLarge: 'This image is too large to preview before uploading.',
filesTooBig: 'Total files size exceeds the limit',
filesTooBigMessage: 'The total size of the files you are trying to upload exceeds the limit. Please try again.',
tooManyFiles: ({fileLimit}) => `You can only upload up to ${fileLimit} files at a time.`,
tooManyFiles: ({fileLimit}: FileLimitParams) => `You can only upload up to ${fileLimit} files at a time.`,
},
filePicker: {
fileError: 'File error',
Expand Down Expand Up @@ -2175,7 +2179,7 @@ const translations = {
incorporationTypeName: 'Incorporation type',
businessCategory: 'Business category',
annualPaymentVolume: 'Annual payment volume',
annualPaymentVolumeInCurrency: ({currencyCode}) => `Annual payment volume in ${currencyCode}`,
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Annual payment volume in ${currencyCode}`,
selectIncorporationType: 'Select incorporation type',
selectBusinessCategory: 'Select business category',
selectAnnualPaymentVolume: 'Select annual payment volume',
Expand Down Expand Up @@ -2284,16 +2288,16 @@ const translations = {
whyDoWeAsk: 'Why do we ask for this?',
chooseFile: 'Choose file',
uploadYourLatest: 'Upload your latest statement',
pleaseUpload: ({lastFourDigits}) => `Please upload the most recent monthly statement for your business bank account ending in ${lastFourDigits}.`,
pleaseUpload: ({lastFourDigits}: LastFourDigitsParams) => `Please upload the most recent monthly statement for your business bank account ending in ${lastFourDigits}.`,
bankInfo: 'Bank info',
confirmBankInfo: 'Confirm bank info',
},
ownershipInfoStep: {
ownerInfo: 'Owner info',
businessOwner: 'Business owner',
signerInfo: 'Signer info',
doYouOwn: ({companyName}) => `Do you own 25% or more of ${companyName}`,
doesAnyoneOwn: ({companyName}) => `Does any individuals own 25% or more of ${companyName}`,
doYouOwn: ({companyName}: CompanyNameParams) => `Do you own 25% or more of ${companyName}`,
doesAnyoneOwn: ({companyName}: CompanyNameParams) => `Does any individuals own 25% or more of ${companyName}`,
regulationsRequire: 'Regulations require us to verify the identity of any individual who owns more than 25% of the business.',
legalFirstName: 'Legal first name',
legalLastName: 'Legal last name',
Expand All @@ -2314,7 +2318,7 @@ const translations = {
letsDoubleCheck: 'Let’s double check that everything looks right.',
legalName: 'Legal name',
ownershipPercentage: 'Ownership percentage',
areThereOther: ({companyName}) => `Are there other individuals who own 25% or more of ${companyName}`,
areThereOther: ({companyName}: CompanyNameParams) => `Are there other individuals who own 25% or more of ${companyName}`,
owners: 'Owners',
addCertified: 'Add a certified org chart that shows the beneficial owners',
regulationRequiresChart: 'Regulation requires us to collect a certified copy of the ownership chart that shows every individual or entity who owns 25% or more of the business.',
Expand All @@ -2327,7 +2331,7 @@ const translations = {
},
signerInfoStep: {
signerInfo: 'Signer info',
areYouDirector: ({companyName}) => `Are you a director or senior officer at ${companyName}?`,
areYouDirector: ({companyName}: CompanyNameParams) => `Are you a director or senior officer at ${companyName}?`,
regulationRequiresUs: 'Regulation requires us to verify if the signer has the authority to take this action on behalf of the business.',
whatsYourName: "What's your legal name",
legalFirstName: 'Legal first name',
Expand Down
19 changes: 11 additions & 8 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {Str} from 'expensify-common';
import PROVINCES from '@pages/ReimbursementAccount/NonUSD/mockedCanadianProvinces';
import CONST from '@src/CONST';
import type en from './en';
Expand Down Expand Up @@ -40,9 +39,11 @@ import type {
CharacterLengthLimitParams,
CharacterLimitParams,
CompanyCardFeedNameParams,
CompanyNameParams,
ConfirmThatParams,
ConnectionNameParams,
ConnectionParams,
CurrencyCodeParams,
CustomersOrJobsLabelParams,
DateParams,
DateShouldBeAfterParams,
Expand All @@ -62,6 +63,7 @@ import type {
ExportedToIntegrationParams,
ExportIntegrationSelectedParams,
FeatureNameParams,
FileLimitParams,
FiltersAmountBetweenParams,
FormattedMaxLengthParams,
ForwardedAmountParams,
Expand All @@ -80,6 +82,7 @@ import type {
InvalidPropertyParams,
InvalidValueParams,
IssueVirtualCardParams,
LastFourDigitsParams,
LastSyncAccountingParams,
LastSyncDateParams,
LocalTimeParams,
Expand Down Expand Up @@ -503,7 +506,7 @@ const translations = {
attachmentImageTooLarge: 'Esta imagen es demasiado grande para obtener una vista previa antes de subirla.',
filesTooBig: 'Total files size exceeds the limit',
filesTooBigMessage: 'The total size of the files you are trying to upload exceeds the limit. Please try again.',
tooManyFiles: ({fileLimit}) => `You can only upload up to ${fileLimit} files at a time.`,
tooManyFiles: ({fileLimit}: FileLimitParams) => `You can only upload up to ${fileLimit} files at a time.`,
},
filePicker: {
fileError: 'Error de archivo',
Expand Down Expand Up @@ -2199,7 +2202,7 @@ const translations = {
incorporationTypeName: 'Incorporation type',
businessCategory: 'Business category',
annualPaymentVolume: 'Annual payment volume',
annualPaymentVolumeInCurrency: ({currencyCode}) => `Annual payment volume in ${currencyCode}`,
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Annual payment volume in ${currencyCode}`,
selectIncorporationType: 'Select incorporation type',
selectIncorporationCountry: 'Select incorporation country',
selectIncorporationState: 'Select incorporation state',
Expand Down Expand Up @@ -2308,16 +2311,16 @@ const translations = {
whyDoWeAsk: 'Why do we ask for this?',
chooseFile: 'Choose file',
uploadYourLatest: 'Upload your latest statement',
pleaseUpload: ({lastFourDigits}) => `Please upload the most recent monthly statement for your business bank account ending in ${lastFourDigits}.`,
pleaseUpload: ({lastFourDigits}: LastFourDigitsParams) => `Please upload the most recent monthly statement for your business bank account ending in ${lastFourDigits}.`,
bankInfo: 'Bank info',
confirmBankInfo: 'Confirm bank info',
},
ownershipInfoStep: {
ownerInfo: 'Owner info',
businessOwner: 'Business owner',
signerInfo: 'Signer info',
doYouOwn: ({companyName}) => `Do you own 25% or more of ${companyName}`,
doesAnyoneOwn: ({companyName}) => `Does any individuals own 25% or more of ${companyName}`,
doYouOwn: ({companyName}: CompanyNameParams) => `Do you own 25% or more of ${companyName}`,
doesAnyoneOwn: ({companyName}: CompanyNameParams) => `Does any individuals own 25% or more of ${companyName}`,
regulationsRequire: 'Regulations require us to verify the identity of any individual who owns more than 25% of the business.',
legalFirstName: 'Legal first name',
legalLastName: 'Legal last name',
Expand All @@ -2338,7 +2341,7 @@ const translations = {
letsDoubleCheck: 'Let’s double check that everything looks right.',
legalName: 'Legal name',
ownershipPercentage: 'Ownership percentage',
areThereOther: ({companyName}) => `Are there other individuals who own 25% or more of ${companyName}`,
areThereOther: ({companyName}: CompanyNameParams) => `Are there other individuals who own 25% or more of ${companyName}`,
owners: 'Owners',
addCertified: 'Add a certified org chart that shows the beneficial owners',
regulationRequiresChart: 'Regulation requires us to collect a certified copy of the ownership chart that shows every individual or entity who owns 25% or more of the business.',
Expand All @@ -2351,7 +2354,7 @@ const translations = {
},
signerInfoStep: {
signerInfo: 'Signer info',
areYouDirector: ({companyName}) => `Are you a director or senior officer at ${companyName}?`,
areYouDirector: ({companyName}: CompanyNameParams) => `Are you a director or senior officer at ${companyName}?`,
regulationRequiresUs: 'Regulation requires us to verify if the signer has the authority to take this action on behalf of the business.',
whatsYourName: "What's your legal name",
legalFirstName: 'Legal first name',
Expand Down
20 changes: 20 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,22 @@ type ImportedTypesParams = {
importedTypes: string[];
};

type CurrencyCodeParams = {
currencyCode: string;
};

type FileLimitParams = {
fileLimit: number;
};

type LastFourDigitsParams = {
lastFourDigits: string;
};

type CompanyNameParams = {
companyName: string;
};

export type {
AuthenticationErrorParams,
ImportMembersSuccessfullDescriptionParams,
Expand Down Expand Up @@ -735,4 +751,8 @@ export type {
OptionalParam,
AssignCardParams,
ImportedTypesParams,
CurrencyCodeParams,
FileLimitParams,
LastFourDigitsParams,
CompanyNameParams,
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Manual({onNext}: ManualProps) {
[BANK_INFO_STEP_KEYS.ACCOUNT_NUMBER]: reimbursementAccount?.achData?.[BANK_INFO_STEP_KEYS.ACCOUNT_NUMBER] ?? '',
};

const shouldBeReadOnlyInput = reimbursementAccount?.achData?.setupType === CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID;
const shouldBeReadOnlyInput = reimbursementAccount?.achData?.setupType === CONST.USD_BANK_ACCOUNT.SETUP_TYPE.PLAID;

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function AccountHolderDetails({onNext, isEditing, corpayFields}: BankInfoSubStep
</View>
);
});
}, [accountHolderDetailsFields, styles.flex2, styles.mb6, styles.mhn5, isEditing, selectedCountry, translate]);
}, [accountHolderDetailsFields, styles.flex2, styles.mb6, styles.mhn5, defaultValues, isEditing, selectedCountry, translate]);

return (
<FormProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Address({onNext, isEditing}: AddressProps) {

const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT);
const onyxValues = useMemo(() => getSubstepValues(INPUT_KEYS, reimbursementAccountDraft, reimbursementAccount), [INPUT_KEYS, reimbursementAccount, reimbursementAccountDraft]);
const onyxValues = useMemo(() => getSubstepValues(INPUT_KEYS, reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);

// TODO look into default country
const businessStepCountryDraftValue = onyxValues[COMPANY_COUNTRY];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const {
BUSINESS_CONTACT_NUMBER,
COUNTRY_CODE,
FORMATION_INCORPORATION_COUNTRY_CODE,
FORMATION_INCORPORATION_STATE,
ANNUAL_VOLUME,
APPLICANT_TYPE_ID,
BUSINESS_CATEGORY,
Expand Down
Loading

0 comments on commit a4608b5

Please sign in to comment.