[TS migration] Migrate 'Wallet.js' lib to TypeScript#30248
Conversation
blazejkustra
left a comment
There was a problem hiding this comment.
Different names for parameters are used across Wallet.ts, requestParams and parameters. It's better to stick with one name, not a blocker though!
| addressZip?: string; | ||
| dob?: string; | ||
| ssn?: string; | ||
| }; |
There was a problem hiding this comment.
maybe we can move this type to the top of the file to be consistent with other files, and also maybe should we name it diffrently as its the same name as we have in Onyx ?
There was a problem hiding this comment.
@kubabutkiewicz @BartoszGrajdek check my comment above.
fabioh8010
left a comment
There was a problem hiding this comment.
@BartoszGrajdek I did some additional review here 🙂
| addressZip?: string; | ||
| dob?: string; | ||
| ssn?: string; | ||
| }; |
There was a problem hiding this comment.
@kubabutkiewicz @BartoszGrajdek check my comment above.
|
Updated the PR, please answer my comments @fabioh8010 😄 |
|
Great, resolved the conflicts, and fixed things you've asked for. Please take a look! 😄 @fabioh8010 @kubabutkiewicz |
|
LGTM |
|
@BartoszGrajdek Let's add tests steps, record videos and mark as ready for review, thanks! |
|
@s77rt bump 😄 |
|
@BartoszGrajdek Can you |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
@BartoszGrajdek I think the Tests / QA Tests are inverted. Unresolved comments: |
|
@s77rt fixed! Sorry, not sure how I've missed those 😅 Let me know if it's fine now 😄 |
|
Thanks! |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24840 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
NikkiWines
left a comment
There was a problem hiding this comment.
Looks good, some very small adjustments
| phoneNumber: parsePhoneNumber(values.phoneNumber, {regionCode: CONST.COUNTRY.US}).number.significant || '', | ||
| legalFirstName: values.legalFirstName || '', | ||
| legalLastName: values.legalLastName || '', | ||
| addressStreet: values.addressStreet || '', | ||
| addressCity: values.addressCity || '', | ||
| addressState: values.addressState || '', | ||
| addressZip: values.addressZipCode || '', | ||
| dob: values.dob || '', | ||
| ssn: values.ssn || '', |
There was a problem hiding this comment.
NAB: I think we prefer ?? '' in these cases
| const successData: OnyxUpdate[] = [ | ||
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: ONYXKEYS.WALLET_ONFIDO, | ||
| value: { | ||
| isLoading: false, | ||
| }, | ||
| }, | ||
| ]; | ||
|
|
||
| const failureData: OnyxUpdate[] = [ | ||
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: ONYXKEYS.WALLET_ONFIDO, | ||
| value: { | ||
| isLoading: false, | ||
| }, | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
This is a new convention, but since the the successData and failureData are the same, you can use a single object named finallyData here instead.
There was a problem hiding this comment.
Same for any others in this file 🙇
There was a problem hiding this comment.
Thanks for updating this. We're looking into adding finallyData in the network layer instead. So, you can revert these changes for now (sorry, should've held off on suggesting we use finallyData) or we can wait until the corresponding PR is merged and update this one accordingly.
There was a problem hiding this comment.
we can wait until the corresponding PR is merged and update this one accordingly
Let's wait then! 😄 @NikkiWines @BartoszGrajdek
There was a problem hiding this comment.
Sorry for the delay, the aforementioned PR has been merged!
|
@s77rt Could you check again? |
|
Retested. Working as expected |
NikkiWines
left a comment
There was a problem hiding this comment.
Nice, thanks for your patience on this one. ![]()
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ 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/NikkiWines in version: 1.4.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.25-10 🚀
|

Details
Migrate 'Wallet.js' lib file to TypeScript
Fixed Issues
$ #24840
Tests
Preconditions: The user must not have enabled the wallet yet and must have no payment method.
Offline tests
Preconditions: The user must not have enabled the wallet yet but must have added a payment method.
QA Steps
Preconditions: The user must not have enabled the wallet yet and must have no payment method.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
web-2.mov
Mobile Web - Chrome
chrome-2.mov
Mobile Web - Safari
safari-2.mov
Desktop
desktop-2.mov
iOS
ios-2.mov
Android
android-2.mov