Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 13 additions & 73 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1278,13 +1278,8 @@ const ROUTES = {
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT: {
route: 'workspaces/:policyID/accounting/quickbooks-online/export/company-card-expense-account',

getRoute: (policyID: string | undefined, backTo?: string) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT route');
}
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
return getUrlWithBackToParam(`workspaces/${policyID}/accounting/quickbooks-online/export/company-card-expense-account` as const, backTo);
},
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`workspaces/${policyID}/accounting/quickbooks-online/export/company-card-expense-account` as const, backTo),
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT: {
route: 'workspaces/:policyID/accounting/quickbooks-online/export/company-card-expense-account/account-select',
Expand Down Expand Up @@ -1494,25 +1489,15 @@ const ROUTES = {
},
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CLASSES: {
route: 'workspaces/:policyID/accounting/quickbooks-desktop/import/classes',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CLASSES route');
}
return `workspaces/${policyID}/accounting/quickbooks-desktop/import/classes` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-desktop/import/classes` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS: {
route: 'workspaces/:policyID/accounting/quickbooks-desktop/import/classes/displayed_as',
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-desktop/import/classes/displayed_as` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS: {
route: 'workspaces/:policyID/accounting/quickbooks-desktop/import/customers',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS route');
}
return `workspaces/${policyID}/accounting/quickbooks-desktop/import/customers` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-desktop/import/customers` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS: {
route: 'workspaces/:policyID/accounting/quickbooks-desktop/import/customers/displayed_as',
Expand Down Expand Up @@ -1590,12 +1575,7 @@ const ROUTES = {
},
WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY: {
route: 'workspaces/:policyID/workflows/auto-reporting-frequency',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY route');
}
return `workspaces/${policyID}/workflows/auto-reporting-frequency` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/workflows/auto-reporting-frequency` as const,
},
WORKSPACE_WORKFLOWS_AUTOREPORTING_MONTHLY_OFFSET: {
route: 'workspaces/:policyID/workflows/auto-reporting-frequency/monthly-offset',
Expand Down Expand Up @@ -2756,48 +2736,23 @@ const ROUTES = {
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CLASSES: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/classes',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_NETSUITE_SUBSIDIARY_SELECTOR route');
}
return `workspaces/${policyID}/accounting/quickbooks-online/import/classes` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-online/import/classes` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CLASSES_DISPLAYED_AS: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/classes/displayed-as',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CLASSES_DISPLAYED_AS route');
}
return `workspaces/${policyID}/accounting/quickbooks-online/import/classes/displayed-as` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-online/import/classes/displayed-as` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CUSTOMERS: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/customers',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CUSTOMERS route');
}
return `workspaces/${policyID}/accounting/quickbooks-online/import/customers` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-online/import/customers` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CUSTOMERS_DISPLAYED_AS: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/customers/displayed-as',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CUSTOMERS_DISPLAYED_AS route');
}
return `workspaces/${policyID}/accounting/quickbooks-online/import/customers/displayed-as` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-online/import/customers/displayed-as` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_LOCATIONS: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/locations',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_LOCATIONS route');
}
return `workspaces/${policyID}/accounting/quickbooks-online/import/locations` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/quickbooks-online/import/locations` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_LOCATIONS_DISPLAYED_AS: {
route: 'workspaces/:policyID/accounting/quickbooks-online/import/locations/displayed-as',
Expand Down Expand Up @@ -2831,12 +2786,7 @@ const ROUTES = {
},
POLICY_ACCOUNTING_NETSUITE_IMPORT: {
route: 'workspaces/:policyID/accounting/netsuite/import',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_NETSUITE_IMPORT route');
}
return `workspaces/${policyID}/accounting/netsuite/import` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/netsuite/import` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_MAPPING: {
route: 'workspaces/:policyID/accounting/netsuite/import/mapping/:importField',
Expand Down Expand Up @@ -2876,21 +2826,11 @@ const ROUTES = {
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS: {
route: 'workspaces/:policyID/accounting/netsuite/import/customer-projects',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS route');
}
return `workspaces/${policyID}/accounting/netsuite/import/customer-projects` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/netsuite/import/customer-projects` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS_SELECT: {
route: 'workspaces/:policyID/accounting/netsuite/import/customer-projects/select',
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS_SELECT route');
}
return `workspaces/${policyID}/accounting/netsuite/import/customer-projects/select` as const;
},
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/netsuite/import/customer-projects/select` as const,
},
POLICY_ACCOUNTING_NETSUITE_EXPORT: {
route: 'workspaces/:policyID/connections/netsuite/export/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import InputWrapper from '@components/Form/InputWrapper';
import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import SelectionList from '@components/SelectionList';
import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem';
import RadioListItem from '@components/SelectionList/RadioListItem';
import TextInput from '@components/TextInput';
import useLocalize from '@hooks/useLocalize';
import usePermissions from '@hooks/usePermissions';
Expand Down Expand Up @@ -145,7 +145,7 @@ function PaymentCardChangeCurrencyForm({changeBillingCurrency, isSecurityCodeReq
showScrollIndicator
shouldStopPropagation
shouldUseDynamicMaxToRenderPerBatch
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
/>
</View>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/AddPaymentCard/PaymentCardCurrencyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem';
import RadioListItem from '@components/SelectionList/RadioListItem';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
Expand Down Expand Up @@ -76,7 +76,7 @@ function PaymentCardCurrencyModal({isVisible, currencies, currentCurrency = CONS
showScrollIndicator
shouldStopPropagation
shouldUseDynamicMaxToRenderPerBatch
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
/>
</ScreenWrapper>
</Modal>
Expand Down
12 changes: 5 additions & 7 deletions src/components/AddPlaidBankAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ function AddPlaidBankAccount({

return (
<FullPageOfflineBlockingView>
<Text style={[styles.mh5, styles.mb3, styles.textHeadlineLineHeightXXL]}>
{translate(isDisplayedInWalletFlow ? 'walletPage.chooseYourBankAccount' : 'bankAccount.chooseAnAccount')}
</Text>
{!!text && <Text style={[styles.mh5, styles.mb6, styles.textSupporting]}>{text}</Text>}
<View style={[styles.mh5, styles.flexRow, styles.alignItemsCenter, styles.mb6]}>
<Text style={[styles.mb3, styles.textHeadlineLineHeightXXL]}>{translate(isDisplayedInWalletFlow ? 'walletPage.chooseYourBankAccount' : 'bankAccount.chooseAnAccount')}</Text>
{!!text && <Text style={[styles.mb6, styles.textSupporting]}>{text}</Text>}
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mb6]}>
<Icon
src={icon}
height={iconSize}
Expand All @@ -266,12 +264,12 @@ function AddPlaidBankAccount({
)}
</View>
</View>
<Text style={[styles.mh5, styles.textLabelSupporting]}>{`${translate('bankAccount.chooseAnAccountBelow')}:`}</Text>
<Text style={[styles.textLabelSupporting]}>{`${translate('bankAccount.chooseAnAccountBelow')}:`}</Text>
<RadioButtons
items={options}
defaultCheckedValue={defaultSelectedPlaidAccountID}
onPress={handleSelectingPlaidAccount}
radioButtonStyle={[styles.optionRowCompact, styles.ph5]}
radioButtonStyle={[styles.mb6]}
/>
<FormHelpMessage message={errorText} />
</FullPageOfflineBlockingView>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CategoryPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import SelectionList from './SelectionList';
import SingleSelectListItem from './SelectionList/SingleSelectListItem';
import RadioListItem from './SelectionList/RadioListItem';
import type {ListItem} from './SelectionList/types';

type CategoryPickerProps = {
Expand Down Expand Up @@ -82,7 +82,7 @@ function CategoryPicker({selectedCategory, policyID, onSubmit, addBottomSafeArea
textInputHint={offlineMessage}
onChangeText={setSearchValue}
onSelectRow={onSubmit}
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
initiallyFocusedOptionKey={selectedOptionKey ?? undefined}
isRowMultilineSupported
addBottomSafeAreaPadding={addBottomSafeAreaPadding}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CountryPicker/CountrySelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem';
import RadioListItem from '@components/SelectionList/RadioListItem';
import useDebouncedState from '@hooks/useDebouncedState';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -83,7 +83,7 @@ function CountrySelectorModal({isVisible, currentCountry, onCountrySelected, onC
textInputLabel={translate('common.search')}
onChangeText={setSearchValue}
onSelectRow={onCountrySelected}
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
initiallyFocusedOptionKey={currentCountry}
shouldSingleExecuteRowSelect
shouldStopPropagation
Expand Down
6 changes: 3 additions & 3 deletions src/components/CurrencySelectionList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Str} from 'expensify-common';
import React, {useCallback, useMemo, useState} from 'react';
import SelectionList from '@components/SelectionList';
import MultiSelectListItem from '@components/SelectionList/MultiSelectListItem';
import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem';
import RadioListItem from '@components/SelectionList/RadioListItem';
import SelectableListItem from '@components/SelectionList/SelectableListItem';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import {getCurrencySymbol} from '@libs/CurrencyUtils';
Expand Down Expand Up @@ -100,7 +100,7 @@ function CurrencySelectionList({
// eslint-disable-next-line react/jsx-props-no-spreading
{...restProps}
sections={sections}
ListItem={canSelectMultiple ? MultiSelectListItem : SingleSelectListItem}
ListItem={canSelectMultiple ? SelectableListItem : RadioListItem}
textInputLabel={searchInputLabel}
textInputValue={searchValue}
onChangeText={setSearchValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem';
import RadioListItem from '@components/SelectionList/RadioListItem';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -83,7 +83,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
showScrollIndicator
shouldStopPropagation
shouldUseDynamicMaxToRenderPerBatch
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
addBottomSafeAreaPadding
/>
</ScreenWrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/components/DestinationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {getPerDiemCustomUnit} from '@libs/PolicyUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import SelectionList from './SelectionList';
import SingleSelectListItem from './SelectionList/SingleSelectListItem';
import RadioListItem from './SelectionList/RadioListItem';
import type {ListItem} from './SelectionList/types';

type DestinationPickerProps = {
Expand Down Expand Up @@ -78,7 +78,7 @@ function DestinationPicker({selectedDestination, policyID, onSubmit}: Destinatio
textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
onChangeText={setSearchValue}
onSelectRow={onSubmit}
ListItem={SingleSelectListItem}
ListItem={RadioListItem}
initiallyFocusedOptionKey={selectedOptionKey ?? undefined}
isRowMultilineSupported
shouldHideKeyboardOnScroll={false}
Expand Down
14 changes: 6 additions & 8 deletions src/components/FeedbackSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,19 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe
isSubmitButtonVisible={false}
enabledWhenOffline={enabledWhenOffline}
>
<View>
<View style={styles.mh5}>
<Text style={styles.textHeadline}>{title}</Text>
<Text style={[styles.mt1, styles.textNormalThemeText]}>{description}</Text>
</View>
<View style={styles.mh5}>
<Text style={styles.textHeadline}>{title}</Text>
<Text style={[styles.mt1, styles.mb3, styles.textNormalThemeText]}>{description}</Text>
<InputWrapper
InputComponent={RadioButtons}
inputID={INPUT_IDS.REASON}
items={options}
radioButtonStyle={[styles.optionRowCompact, styles.ph5, optionRowStyles]}
radioButtonStyle={[styles.mb7, optionRowStyles]}
onPress={handleOptionSelect}
shouldSaveDraft
/>
{!!reason && (
<View style={[styles.mh5, styles.mt4]}>
<>
<Text style={[styles.textNormalThemeText, styles.mb3]}>{translate('feedbackSurvey.additionalInfoTitle')}</Text>
<InputWrapper
InputComponent={TextInput}
Expand All @@ -133,7 +131,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe
onChangeText={handleSetNote}
shouldSaveDraft
/>
</View>
</>
)}
</View>
<FixedFooter style={styles.pb0}>
Expand Down
Loading
Loading