-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[TS migration] Migrate 'Wallet.js' lib to TypeScript #30248
[TS migration] Migrate 'Wallet.js' lib to TypeScript #30248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different names for parameters are used across Wallet.ts
, requestParams
and parameters
. It's better to stick with one name, not a blocker though!
src/libs/actions/Wallet.ts
Outdated
addressZip?: string; | ||
dob?: string; | ||
ssn?: string; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubabutkiewicz @BartoszGrajdek check my comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BartoszGrajdek I did some additional review here 🙂
src/libs/actions/Wallet.ts
Outdated
addressZip?: string; | ||
dob?: string; | ||
ssn?: string; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: I think we prefer ?? ''
in these cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/libs/actions/Wallet.ts
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for any others in this file 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NikkiWines Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, the aforementioned PR has been merged!
@s77rt Could you check again? |
Retested. Working as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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