[Internal QA] Missing personal details magic code modal uses navigation#73116
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@ishpaul777 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
LGTM |
|
@aimane-chnaif Can you review please? |
aimane-chnaif
left a comment
There was a problem hiding this comment.
For DEV: physical card cannot be really iussued. Testing done via preparing the optimistic response to look like a real life response
Can you please add this to step? Maybe Onyx test data.
Please merge main.
| function MissingPersonalDetailsMagicCodePage() { | ||
| const {translate} = useLocalize(); | ||
| const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {canBeMissing: true}); | ||
| const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {canBeMissing: false}); |
There was a problem hiding this comment.
canBeMissing: true -> false
What's this change for? Would be good to have some context.
There was a problem hiding this comment.
Assumed this was misissue of {canBeMissing: true}.
Following canBeMissing docstring
If the component calling this does not load the data then you should set it to false, which means that if the data is not there, it will log an alert, as it means we are using data that no one loaded and that's most probably a bug.
This pages` logic relies on privatePersonalDetails so changed it to false
| const handleSubmitForm = (validateCode: string) => { | ||
| updatePersonalDetailsAndShipExpensifyCards(values, validateCode, countryCode); | ||
| }; |
|
@aimane-chnaif updated & added data I've been testing with. Also added |
|
@aimane-chnaif Can you continue to the review please? |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-07.at.12.54.13.pm.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2025-11-07.at.12.16.53.pm.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2025-11-07.at.1.12.36.pm.movMacOS: DesktopScreen.Recording.2025-11-07.at.12.37.16.pm.mov |
|
Thanks, ping me when done please |
| const [draftValues] = useOnyx(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM_DRAFT, {canBeMissing: false}); | ||
| const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE, {canBeMissing: false}); | ||
|
|
||
| const [cardList] = useOnyx(ONYXKEYS.CARD_LIST, {canBeMissing: true}); |
There was a problem hiding this comment.
Should we add the areAllCardsShipped logic to selector? I think that should be the right way to do it with the "selector-first" mind
| const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE, {canBeMissing: false}); | ||
|
|
||
| const [cardList] = useOnyx(ONYXKEYS.CARD_LIST, {canBeMissing: true}); | ||
| const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); |
There was a problem hiding this comment.
Same here, we only need the primary logic so we should select that, otherwise this is subscribed to all props of account key even if we only care about the primaryLogin
|
@aimane-chnaif Please keep that selector comments in mind to ask authors to refactor to use selectors when possible, thanks |
| function arePersonalDetailsMissing(privatePersonalDetails: OnyxEntry<PrivatePersonalDetails>): boolean { | ||
| return ( | ||
| !privatePersonalDetails?.legalFirstName || | ||
| !privatePersonalDetails?.legalLastName || | ||
| !privatePersonalDetails?.dob || | ||
| !privatePersonalDetails?.phoneNumber || | ||
| isEmptyObject(privatePersonalDetails?.addresses) || | ||
| privatePersonalDetails.addresses.length === 0 | ||
| ); | ||
| } |
There was a problem hiding this comment.
Lets also add a test for this method if there is none @jmusial feel free to do that in a follow up 🙇
Noted thanks |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.55-3 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.57-0 🚀
|
|
Tested on staging and works well 👍 |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.57-4 🚀
|
Explanation of Change
Rewrites missing personal details modal to use RHP with url instead of modal.
Fixed Issues
$ #69171
PROPOSAL:
Tests
NOTE:
For DEV: physical card cannot be really iussued. Testing done via preparing the optimistic response to look like a real life response
Pre requisite:
have a physical card generated but not send on an account (
state: 2)Open app
Go to Account -> Wallet
Click on your Physical card
Click Get physical card
Fill missing details form
Type in magic code
Modal closes* (or request succeeds and nothing happens)
* mimicking woking API by adding in
src/libs/actions/PersonalDetails.ts#537to
finallyDataOffline tests
N/A
QA Steps
Not sure if can be tested by QA due to physical card restrictions, but steps should be same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
0070.android.native.mov
Android: mWeb Chrome
0070.android.chrome.mov
iOS: Native
0070.ios.native.mov
iOS: mWeb Safari
0070.ios.safari.mov
MacOS: Chrome / Safari
0070.desktop.chrome.mov
MacOS: Desktop
0070.desktop.native.mov