Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card Settings - Rename PaymentsPage to WalletPage #24632

Merged
merged 5 commits into from
Aug 17, 2023
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
14 changes: 7 additions & 7 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export default {
SETTINGS_CLOSE: 'settings/security/closeAccount',
SETTINGS_ABOUT: 'settings/about',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
SETTINGS_PAYMENTS: 'settings/payments',
SETTINGS_ADD_PAYPAL_ME: 'settings/payments/add-paypal-me',
SETTINGS_ADD_DEBIT_CARD: 'settings/payments/add-debit-card',
SETTINGS_ADD_BANK_ACCOUNT: 'settings/payments/add-bank-account',
SETTINGS_ENABLE_PAYMENTS: 'settings/payments/enable-payments',
SETTINGS_WALLET: 'settings/wallet',
SETTINGS_ADD_PAYPAL_ME: 'settings/wallet/add-paypal-me',
SETTINGS_ADD_DEBIT_CARD: 'settings/wallet/add-debit-card',
SETTINGS_ADD_BANK_ACCOUNT: 'settings/wallet/add-bank-account',
SETTINGS_ENABLE_PAYMENTS: 'settings/wallet/enable-payments',
getSettingsAddLoginRoute: (type) => `settings/addlogin/${type}`,
SETTINGS_PAYMENTS_TRANSFER_BALANCE: 'settings/payments/transfer-balance',
SETTINGS_PAYMENTS_CHOOSE_TRANSFER_ACCOUNT: 'settings/payments/choose-transfer-account',
SETTINGS_WALLET_TRANSFER_BALANCE: 'settings/wallet/transfer-balance',
SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT: 'settings/wallet/choose-transfer-account',
SETTINGS_PERSONAL_DETAILS,
SETTINGS_PERSONAL_DETAILS_LEGAL_NAME: `${SETTINGS_PERSONAL_DETAILS}/legal-name`,
SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH: `${SETTINGS_PERSONAL_DETAILS}/date-of-birth`,
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettlementButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const defaultProps = {

class SettlementButton extends React.Component {
componentDidMount() {
PaymentMethods.openPaymentsPage();
PaymentMethods.openWalletPage();
}

getButtonOptionsFromProps() {
Expand Down
7 changes: 4 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
workspaces: 'Workspaces',
profile: 'Profile',
payments: 'Payments',
wallet: 'Wallet',
preferences: 'Preferences',
view: 'View',
not: 'Not',
Expand Down Expand Up @@ -664,7 +665,7 @@ export default {
password: 'Please enter your Expensify password',
},
},
paymentsPage: {
walletPage: {
paymentMethodsTitle: 'Payment methods',
setDefaultConfirmation: 'Make default payment method',
setDefaultSuccess: 'Default payment method set!',
Expand All @@ -691,8 +692,8 @@ export default {
transferDetailBankAccount: 'Your money should arrive in the next 1-3 business days.',
transferDetailDebitCard: 'Your money should arrive immediately.',
failedTransfer: 'Your balance isn’t fully settled. Please transfer to a bank account.',
notHereSubTitle: 'Please transfer your balance from the payments page',
goToPayment: 'Go to Payments',
notHereSubTitle: 'Please transfer your balance from the wallet page',
goToWallet: 'Go to Wallet',
},
chooseTransferAccountPage: {
chooseAccount: 'Choose account',
Expand Down
7 changes: 4 additions & 3 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default {
workspaces: 'Espacios de trabajo',
profile: 'Perfil',
payments: 'Pagos',
wallet: 'Billetera',
preferences: 'Preferencias',
view: 'Ver',
not: 'No',
Expand Down Expand Up @@ -665,7 +666,7 @@ export default {
password: 'Por favor, introduce tu contraseña de Expensify',
},
},
paymentsPage: {
walletPage: {
paymentMethodsTitle: 'Métodos de pago',
setDefaultConfirmation: 'Marcar como método de pago predeterminado',
setDefaultSuccess: 'Método de pago configurado',
Expand All @@ -692,8 +693,8 @@ export default {
transferDetailBankAccount: 'Tu dinero debería llegar en 1-3 días laborables.',
transferDetailDebitCard: 'Tu dinero debería llegar de inmediato.',
failedTransfer: 'Tu saldo no se ha acreditado completamente. Por favor, transfiere los fondos a una cuenta bancaria.',
notHereSubTitle: 'Por favor, transfiere el saldo desde la página de pagos',
goToPayment: 'Ir a pagos',
notHereSubTitle: 'Por favor, transfiere el saldo desde la página de billetera',
goToWallet: 'Ir a billetera',
},
chooseTransferAccountPage: {
chooseAccount: 'Elegir cuenta',
Expand Down
22 changes: 11 additions & 11 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator([
},
{
getComponent: () => {
const AddDebitCardPage = require('../../../pages/settings/Payments/AddDebitCardPage').default;
const AddDebitCardPage = require('../../../pages/settings/Wallet/AddDebitCardPage').default;
return AddDebitCardPage;
},
name: 'IOU_Send_Add_Debit_Card',
Expand Down Expand Up @@ -475,28 +475,28 @@ const SettingsModalStackNavigator = createModalStackNavigator([
},
{
getComponent: () => {
const SettingsPaymentsPage = require('../../../pages/settings/Payments/PaymentsPage').default;
return SettingsPaymentsPage;
const SettingsWalletPage = require('../../../pages/settings/Wallet/WalletPage').default;
return SettingsWalletPage;
},
name: 'Settings_Payments',
name: 'Settings_Wallet',
},
{
getComponent: () => {
const TransferBalancePage = require('../../../pages/settings/Payments/TransferBalancePage').default;
const TransferBalancePage = require('../../../pages/settings/Wallet/TransferBalancePage').default;
return TransferBalancePage;
},
name: 'Settings_Payments_Transfer_Balance',
name: 'Settings_Wallet_Transfer_Balance',
},
{
getComponent: () => {
const ChooseTransferAccountPage = require('../../../pages/settings/Payments/ChooseTransferAccountPage').default;
const ChooseTransferAccountPage = require('../../../pages/settings/Wallet/ChooseTransferAccountPage').default;
return ChooseTransferAccountPage;
},
name: 'Settings_Payments_Choose_Transfer_Account',
name: 'Settings_Wallet_Choose_Transfer_Account',
},
{
getComponent: () => {
const SettingsAddPayPalMePage = require('../../../pages/settings/Payments/AddPayPalMePage').default;
const SettingsAddPayPalMePage = require('../../../pages/settings/Wallet/AddPayPalMePage').default;
return SettingsAddPayPalMePage;
},
name: 'Settings_Add_Paypal_Me',
Expand All @@ -506,11 +506,11 @@ const SettingsModalStackNavigator = createModalStackNavigator([
const EnablePaymentsPage = require('../../../pages/EnablePayments/EnablePaymentsPage').default;
return EnablePaymentsPage;
},
name: 'Settings_Payments_EnablePayments',
name: 'Settings_Wallet_EnablePayments',
},
{
getComponent: () => {
const AddDebitCardPage = require('../../../pages/settings/Payments/AddDebitCardPage').default;
const AddDebitCardPage = require('../../../pages/settings/Wallet/AddDebitCardPage').default;
return AddDebitCardPage;
},
name: 'Settings_Add_Debit_Card',
Expand Down
14 changes: 7 additions & 7 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ export default {
path: ROUTES.SETTINGS_SECURITY,
exact: true,
},
Settings_Payments: {
path: ROUTES.SETTINGS_PAYMENTS,
Settings_Wallet: {
path: ROUTES.SETTINGS_WALLET,
exact: true,
},
Settings_Payments_EnablePayments: {
Settings_Wallet_EnablePayments: {
path: ROUTES.SETTINGS_ENABLE_PAYMENTS,
exact: true,
},
Settings_Payments_Transfer_Balance: {
path: ROUTES.SETTINGS_PAYMENTS_TRANSFER_BALANCE,
Settings_Wallet_Transfer_Balance: {
path: ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE,
exact: true,
},
Settings_Payments_Choose_Transfer_Account: {
path: ROUTES.SETTINGS_PAYMENTS_CHOOSE_TRANSFER_ACCOUNT,
Settings_Wallet_Choose_Transfer_Account: {
path: ROUTES.SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT,
exact: true,
},
Settings_Add_Paypal_Me: {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function getVBBADataForOnyx() {
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {
isLoading: false,
errors: ErrorUtils.getMicroSecondOnyxError('paymentsPage.addBankAccountFailure'),
errors: ErrorUtils.getMicroSecondOnyxError('walletPage.addBankAccountFailure'),
},
},
],
Expand Down Expand Up @@ -165,7 +165,7 @@ function addPersonalBankAccount(account) {
key: ONYXKEYS.PERSONAL_BANK_ACCOUNT,
value: {
isLoading: false,
errors: ErrorUtils.getMicroSecondOnyxError('paymentsPage.addBankAccountFailure'),
errors: ErrorUtils.getMicroSecondOnyxError('walletPage.addBankAccountFailure'),
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions src/libs/actions/PaymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ROUTES from '../../ROUTES';

function deletePayPalMe() {
User.deletePaypalMeAddress();
Growl.show(Localize.translateLocal('paymentsPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000);
Growl.show(Localize.translateLocal('walletPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000);
}

/**
Expand All @@ -35,7 +35,7 @@ function continueSetup() {
kycWallRef.current.continue();
}

function openPaymentsPage() {
function openWalletPage() {
const onyxData = {
optimisticData: [
{
Expand Down Expand Up @@ -272,7 +272,7 @@ function saveWalletTransferMethodType(filterPaymentMethodType) {

function dismissSuccessfulTransferBalancePage() {
Onyx.merge(ONYXKEYS.WALLET_TRANSFER, {shouldShowSuccess: false});
Navigation.goBack(ROUTES.SETTINGS_PAYMENTS);
Navigation.goBack(ROUTES.SETTINGS_WALLET);
}

/**
Expand Down Expand Up @@ -347,7 +347,7 @@ export {
deletePayPalMe,
deletePaymentCard,
addPaymentCard,
openPaymentsPage,
openWalletPage,
makeDefaultPaymentMethod,
kycWallRef,
continueSetup,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function deletePaypalMeAddress() {
];

API.write('DeletePaypalMeAddress', {}, {optimisticData, successData});
Growl.show(Localize.translateLocal('paymentsPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000);
Growl.show(Localize.translateLocal('walletPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000);
}

function triggerNotifications(onyxUpdates) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AddPersonalBankAccountPage extends React.Component {
if (exitReportID) {
Navigation.dismissModal(exitReportID);
} else {
Navigation.goBack(ROUTES.SETTINGS_PAYMENTS);
Navigation.goBack(ROUTES.SETTINGS_WALLET);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/EnablePayments/EnablePaymentsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EnablePaymentsPage extends React.Component {
<>
<HeaderWithBackButton
title={this.props.translate('additionalDetailsStep.headerTitle')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS)}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET)}
/>
<FailedKYC />
</>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/settings/InitialSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ function InitialSettingsPage(props) {
},
},
{
translationKey: 'common.payments',
translationKey: 'common.wallet',
icon: Expensicons.Wallet,
action: () => {
Navigation.navigate(ROUTES.SETTINGS_PAYMENTS);
Navigation.navigate(ROUTES.SETTINGS_WALLET);
},
brickRoadIndicator:
PaymentMethods.hasPaymentMethodError(props.bankAccountList, paymentCardList) || !_.isEmpty(props.userWallet.errors) || !_.isEmpty(props.walletTerms.errors)
Expand Down Expand Up @@ -284,7 +284,7 @@ function InitialSettingsPage(props) {
<>
{_.map(getDefaultMenuItems, (item, index) => {
const keyTitle = item.translationKey ? translate(item.translationKey) : item.title;
const isPaymentItem = item.translationKey === 'common.payments';
const isPaymentItem = item.translationKey === 'common.wallet';

return (
<MenuItem
Expand Down
10 changes: 0 additions & 10 deletions src/pages/settings/Payments/PaymentsPage/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/pages/settings/Payments/PaymentsPage/index.native.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function DebitCardPage(props) {
>
<HeaderWithBackButton
title={translate('addDebitCardPage.addADebitCard')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS)}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET)}
/>
<Form
formID={ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function AddPayPalMePage(props) {
(values) => {
User.addPaypalMeAddress(values.payPalMeUsername);
Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000);
Navigation.goBack(ROUTES.SETTINGS_PAYMENTS);
Navigation.goBack(ROUTES.SETTINGS_WALLET);
},
[growlMessageOnSave],
);
Expand All @@ -69,7 +69,7 @@ function AddPayPalMePage(props) {
<ScreenWrapper onEntryTransitionEnd={() => payPalMeInput.current && payPalMeInput.current.focus()}>
<HeaderWithBackButton
title={props.translate('common.payPalMe')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS)}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET)}
/>
<Form
style={[styles.flex1, styles.p5]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ChooseTransferAccountPage(props) {
*/
const selectAccountAndNavigateBack = (event, accountType, account) => {
PaymentMethods.saveWalletTransferAccountTypeAndID(accountType, accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT ? account.bankAccountID : account.fundID);
Navigation.goBack(ROUTES.SETTINGS_PAYMENTS_TRANSFER_BALANCE);
Navigation.goBack(ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE);
};

/**
Expand All @@ -55,7 +55,7 @@ function ChooseTransferAccountPage(props) {
<ScreenWrapper>
<HeaderWithBackButton
title={props.translate('chooseTransferAccountPage.chooseAccount')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS_TRANSFER_BALANCE)}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE)}
/>
<View style={[styles.mt6, styles.flexShrink1, styles.flexBasisAuto]}>
<PaymentMethodList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function TransferBalancePage(props) {
return;
}

Navigation.navigate(ROUTES.SETTINGS_PAYMENTS_CHOOSE_TRANSFER_ACCOUNT);
Navigation.navigate(ROUTES.SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT);
}

useEffect(() => {
Expand Down Expand Up @@ -176,13 +176,13 @@ function TransferBalancePage(props) {
titleKey="notFound.pageNotFound"
subtitleKey="transferAmountPage.notHereSubTitle"
shouldShowLink
linkKey="transferAmountPage.goToPayment"
onLinkPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS)}
linkKey="transferAmountPage.goToWallet"
onLinkPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET)}
>
<HeaderWithBackButton
title={props.translate('common.transferBalance')}
shouldShowBackButton
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PAYMENTS)}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET)}
/>
<View style={[styles.flexGrow1, styles.flexShrink1, styles.flexBasisAuto, styles.justifyContentCenter]}>
<CurrentWalletBalance balanceStyles={[styles.transferBalanceBalance]} />
Expand Down
Loading