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

feat 22876 allow users to update the card address via update address link #28907

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3114d6b
feat: update address link
MrMuzyk Sep 13, 2023
d7c7289
add right icon press handler and accessibilityLabel to MenuItem
JKobrynski Sep 5, 2023
8b12931
add translations for CardDetails
JKobrynski Sep 5, 2023
9b263f2
create CardDetails component
JKobrynski Sep 5, 2023
cc5a296
format code
JKobrynski Sep 5, 2023
ab44a6f
remove unused prop type
JKobrynski Sep 5, 2023
36c331b
improve comments grammar
JKobrynski Sep 6, 2023
7b8fbf4
simplify accessibilityLabel
JKobrynski Sep 6, 2023
34f5c7f
lint code
JKobrynski Sep 6, 2023
d626f6f
Fix translation of copy requested money action messages
rayane-djouah Sep 11, 2023
b5b03db
Copy email with text when iou message is copied
huzaifa-99 Aug 29, 2023
df153d1
Fix lint
huzaifa-99 Sep 11, 2023
1a9bdc5
Show payer name for paid iou/expense msg in LHN
huzaifa-99 Sep 13, 2023
0f075e8
upgrade to rn 0.72.4 + fix patches
fabOnReact Sep 10, 2023
c96e864
commit package-lock.json
fabOnReact Sep 10, 2023
21df891
add back package.json over-rides
fabOnReact Sep 13, 2023
5f80b41
commit Podfile.lock and package-lock.json
fabOnReact Sep 14, 2023
6fb080b
add back material-top-tabs patch
fabOnReact Sep 14, 2023
5e3ac2a
use attachmentmodal in reportActionItemImage
luacmartins Sep 5, 2023
04faad8
Revert "use attachmentmodal in reportActionItemImage"
luacmartins Sep 5, 2023
193b950
create route const, add onSubmit callback, navigate to correct route
luacmartins Sep 5, 2023
614f6f7
stash work
Szymon20000 Sep 11, 2023
46c5060
remove console.logs
Szymon20000 Sep 12, 2023
0acb3d6
clean up
Szymon20000 Sep 14, 2023
fd7d76a
rename to waitForNetworkPromises and waitForBatchedUpdates
Szymon20000 Sep 14, 2023
d93bd89
add rightComponent support to MenuItem
JKobrynski Sep 21, 2023
07d3aa4
add CardDetails to ExpensifyCardPage
JKobrynski Sep 21, 2023
96ec68c
implement address editing functionality
JKobrynski Sep 21, 2023
d2d1330
remove redundant imports
JKobrynski Sep 21, 2023
cfafc00
apply minor fixes
JKobrynski Sep 21, 2023
501c897
revert OptionsListUtils changes
JKobrynski Sep 21, 2023
824ba47
revert ReportTest changes
JKobrynski Sep 21, 2023
accf327
revert APITest changes
JKobrynski Sep 21, 2023
1ddd4a7
bring back react-native-image-manipulator patch
JKobrynski Sep 21, 2023
566e598
bring back react-native-image-manipulator patch
JKobrynski Sep 21, 2023
18f6ed2
bring back react-native-image-manipulator patch
JKobrynski Sep 21, 2023
21f0d74
fix patch typo
JKobrynski Sep 21, 2023
6280522
bring back react-native-sdk patch
JKobrynski Sep 21, 2023
9299d97
bring back @react-navigation/native patch
JKobrynski Sep 21, 2023
a2c2b6a
Merge branch 'feature/expensify-card' of https://github.com/pasyukevi…
MrMuzyk Sep 22, 2023
1eb3e9c
change useMemo to regular function
JKobrynski Sep 22, 2023
16755eb
move formatPiece outside component definition
JKobrynski Sep 22, 2023
cada4ef
remove update address button
JKobrynski Sep 22, 2023
4793d43
remove unnecessary style
JKobrynski Sep 22, 2023
3fe5b96
feat: stash changes
MrMuzyk Sep 22, 2023
ecfaa73
Merge branch 'addRevealDetails' of https://github.com/JKobrynski/Expe…
MrMuzyk Sep 22, 2023
1bffdb7
Merge remote-tracking branch 'eugene/feature/expensify-card' into add…
JKobrynski Sep 25, 2023
6b54548
format address with reduce
JKobrynski Sep 25, 2023
19d5d6c
remove formatPiece funciton
JKobrynski Sep 25, 2023
357410a
remove pointerEvents style for pressable variants
JKobrynski Sep 25, 2023
d96baec
Merge branch 'addRevealDetails' of https://github.com/JKobrynski/Expe…
MrMuzyk Sep 25, 2023
9aa4682
feat: connect with card page
MrMuzyk Sep 25, 2023
defdd1b
feat: remove test data
MrMuzyk Sep 25, 2023
6ae0b78
Merge branch 'addRevealDetails' of https://github.com/JKobrynski/Expe…
MrMuzyk Sep 28, 2023
ae177fc
fix: remove doubled translations
MrMuzyk Sep 28, 2023
0332f5f
fix: revert translation changes
MrMuzyk Sep 28, 2023
665011a
fix: translations
MrMuzyk Sep 28, 2023
8de2074
fix: config fix
MrMuzyk Sep 28, 2023
678d070
Merge branch 'main' of github.com:MrMuzyk/App into feat-22876-allow-u…
MrMuzyk Sep 29, 2023
2ba05ee
Merge branch 'addRevealDetails' of https://github.com/JKobrynski/Expe…
MrMuzyk Oct 3, 2023
c58c2f4
Merge branch 'main' of github.com:MrMuzyk/App into feat-22876-allow-u…
MrMuzyk Oct 5, 2023
32978b7
fix: update key in personal details initial page
MrMuzyk Oct 9, 2023
3616cb0
Merge branch 'main' of github.com:MrMuzyk/App into feat-22876-allow-u…
MrMuzyk Oct 12, 2023
8004a76
fix: rename pages to be consistent
MrMuzyk Oct 13, 2023
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: 9 additions & 5 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,26 @@ export default {
SETTINGS_ABOUT: 'settings/about',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
SETTINGS_WALLET: 'settings/wallet',
SETTINGS_WALLET_DOMAINCARDS: {
SETTINGS_WALLET_DOMAINCARD: {
Copy link
Contributor

Choose a reason for hiding this comment

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

route: '/settings/wallet/card/:domain',
getRoute: (domain: string) => `/settings/wallet/card/${domain}`,
},
SETTINGS_REPORT_FRAUD: {
route: '/settings/wallet/cards/:domain/report-virtual-fraud',
getRoute: (domain: string) => `/settings/wallet/cards/${domain}/report-virtual-fraud`,
route: '/settings/wallet/card/:domain/report-virtual-fraud',
getRoute: (domain: string) => `/settings/wallet/card/${domain}/report-virtual-fraud`,
},
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',
SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS: {
route: 'settings/wallet/card/:domain/digital-details/update-address',
getRoute: (domain: string) => `settings/wallet/card/${domain}/digital-details/update-address`,
},
SETTINGS_WALLET_TRANSFER_BALANCE: 'settings/wallet/transfer-balance',
SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT: 'settings/wallet/choose-transfer-account',
SETTINGS_WALLET_CARD_ACTIVATE: {
route: 'settings/wallet/cards/:domain/activate',
getRoute: (domain: string) => `settings/wallet/cards/${domain}/activate`,
route: 'settings/wallet/card/:domain/activate',
getRoute: (domain: string) => `settings/wallet/card/${domain}/activate`,
},
SETTINGS_PERSONAL_DETAILS: 'settings/profile/personal-details',
SETTINGS_PERSONAL_DETAILS_LEGAL_NAME: 'settings/profile/personal-details/legal-name',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ export default {
address: 'Address',
revealDetails: 'Reveal details',
copyCardNumber: 'Copy card number',
updateAddress: 'Update address',
},
},
reportFraudPage: {
Expand Down Expand Up @@ -1013,7 +1014,7 @@ export default {
legalName: 'Legal name',
legalFirstName: 'Legal first name',
legalLastName: 'Legal last name',
homeAddress: 'Home address',
address: 'Address',
error: {
dateShouldBeBefore: ({dateString}: DateShouldBeBeforeParams) => `Date should be before ${dateString}.`,
dateShouldBeAfter: ({dateString}: DateShouldBeAfterParams) => `Date should be after ${dateString}.`,
Expand Down
3 changes: 2 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ export default {
address: 'Dirección',
revealDetails: 'Revelar detalles',
copyCardNumber: 'Copiar número de la tarjeta',
updateAddress: 'Actualizar dirección',
},
},
reportFraudPage: {
Expand Down Expand Up @@ -1011,7 +1012,7 @@ export default {
legalName: 'Nombre completo',
legalFirstName: 'Nombre legal',
legalLastName: 'Apellidos legales',
homeAddress: 'Domicilio',
address: 'Dirección',
error: {
dateShouldBeBefore: ({dateString}: DateShouldBeBeforeParams) => `La fecha debe ser anterior a ${dateString}.`,
dateShouldBeAfter: ({dateString}: DateShouldBeAfterParams) => `La fecha debe ser posterior a ${dateString}.`,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const SettingsModalStackNavigator = createModalStackNavigator({
Settings_App_Download_Links: () => require('../../../pages/settings/AppDownloadLinks').default,
Settings_Lounge_Access: () => require('../../../pages/settings/Profile/LoungeAccessPage').default,
Settings_Wallet: () => require('../../../pages/settings/Wallet/WalletPage').default,
Settings_Wallet_Cards_Digital_Details_Update_Address: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default,
Settings_Wallet_DomainCards: () => require('../../../pages/settings/Wallet/ExpensifyCardPage').default,
Settings_Wallet_ReportVirtualCardFraud: () => require('../../../pages/settings/Wallet/ReportVirtualCardFraudPage').default,
Settings_Wallet_Card_Activate: () => require('../../../pages/settings/Wallet/ActivatePhysicalCardPage').default,
Expand Down
6 changes: 5 additions & 1 deletion src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
exact: true,
},
Settings_Wallet_DomainCards: {
path: ROUTES.SETTINGS_WALLET_DOMAINCARDS.route,
path: ROUTES.SETTINGS_WALLET_DOMAINCARD.route,
exact: true,
},
Settings_Wallet_ReportVirtualCardFraud: {
Expand All @@ -93,6 +93,10 @@ export default {
path: ROUTES.SETTINGS_WALLET_CARD_ACTIVATE.route,
exact: true,
},
Settings_Wallet_Cards_Digital_Details_Update_Address: {
path: ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.route,
exact: true,
},
Settings_Add_Debit_Card: {
path: ROUTES.SETTINGS_ADD_DEBIT_CARD,
exact: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function AddressPage({privatePersonalDetails, route}) {
testID={AddressPage.displayName}
>
<HeaderWithBackButton
title={translate('privatePersonalDetails.homeAddress')}
title={translate('privatePersonalDetails.address')}
shouldShowBackButton
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PERSONAL_DETAILS)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function PersonalDetailsInitialPage(props) {
/>
<MenuItemWithTopDescription
title={PersonalDetailsUtils.getFormattedAddress(props.privatePersonalDetails)}
description={props.translate('privatePersonalDetails.homeAddress')}
description={props.translate('privatePersonalDetails.address')}
shouldShowRightIcon
onPress={() => Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS)}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Wallet/ActivatePhysicalCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function ActivatePhysicalCardPage({
return;
}

Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARDS.getRoute(domain));
Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain));
}, [cardID, cardList, domain, physicalCard.isLoading]);

useEffect(
Expand Down Expand Up @@ -131,7 +131,7 @@ function ActivatePhysicalCardPage({
return (
<IllustratedHeaderPageLayout
title={translate('activateCardPage.activateCard')}
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARDS.getRoute(domain))}
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))}
backgroundColor={themeColors.PAGE_BACKGROUND_COLORS[SCREENS.SETTINGS.PREFERENCES]}
illustration={LottieAnimations.Magician}
scrollViewContainerStyles={[styles.mnh100]}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Wallet/ExpensifyCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function ExpensifyCardPage({
pan="1234123412341234"
expiration="11/02/2024"
cvv="321"
domain={domain}
/>
) : (
<MenuItemWithTopDescription
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Wallet/ReportVirtualCardFraudPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function ReportVirtualCardFraudPage({
return;
}

Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARDS.getRoute(domain));
Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain));
}, [domain, formData.isLoading, prevIsLoading, virtualCard.errors]);

if (_.isEmpty(virtualCard)) {
Expand All @@ -74,7 +74,7 @@ function ReportVirtualCardFraudPage({
<ScreenWrapper testID={ReportVirtualCardFraudPage.displayName}>
<HeaderWithBackButton
title={translate('reportFraudPage.title')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAINCARDS.getRoute(domain))}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))}
/>
<View style={[styles.flex1, styles.justifyContentBetween]}>
<Text style={[styles.baseFontStyle, styles.mh5]}>{translate('reportFraudPage.description')}</Text>
Expand Down
14 changes: 13 additions & 1 deletion src/pages/settings/Wallet/WalletPage/CardDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import ONYXKEYS from '../../../../ONYXKEYS';
import * as PersonalDetailsUtils from '../../../../libs/PersonalDetailsUtils';
import PressableWithDelayToggle from '../../../../components/Pressable/PressableWithDelayToggle';
import styles from '../../../../styles/styles';
import TextLink from '../../../../components/TextLink';
import Navigation from '../../../../libs/Navigation/Navigation';
import ROUTES from '../../../../ROUTES';

const propTypes = {
/** Card number */
Expand All @@ -33,6 +36,9 @@ const propTypes = {
country: PropTypes.string,
}),
}),

/** Domain name */
domain: PropTypes.string.isRequired,
};

const defaultProps = {
Expand All @@ -51,7 +57,7 @@ const defaultProps = {
},
};

function CardDetails({pan, expiration, cvv, privatePersonalDetails}) {
function CardDetails({pan, expiration, cvv, privatePersonalDetails, domain}) {
usePrivatePersonalDetails();
const {translate} = useLocalize();

Expand Down Expand Up @@ -92,6 +98,12 @@ function CardDetails({pan, expiration, cvv, privatePersonalDetails}) {
title={PersonalDetailsUtils.getFormattedAddress(privatePersonalDetails)}
interactive={false}
/>
<TextLink
style={[styles.link, styles.mh5, styles.mb3]}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.getRoute(domain))}
>
{translate('cardPage.cardDetails.updateAddress')}
</TextLink>
</>
);
}
Expand Down
Loading