[No QA][TS migration] Migrate 'models' lib to TypeScript#27667
Conversation
|
@thesahindia 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] |
rezkiy37
left a comment
There was a problem hiding this comment.
I see that json and accountJSON has good detailed types. I am not sure that all those 1-line methods should have return types.
|
@fvlvte this issue is not ready for cross-review (removing it from spreadsheet for now). Please attach some videos / screenshots from your side. Thank you! 🙇🏼♂️ |
|
Sorry - updated @BartoszGrajdek |
|
Reviewing... |
blazejkustra
left a comment
There was a problem hiding this comment.
LGTM, SWM still need to do the checklist.
|
LGTM! |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromechrome.movMobile Web - Safarisafari.movDesktopdesktop.moviOSios.movAndroidandroid.mp4 |
# Conflicts: # src/types/onyx/BankAccount.ts
# Conflicts: # src/libs/models/BankAccount.js # src/types/onyx/BankAccount.ts
5a410c0 to
b99bb38
Compare
|
@BartoszGrajdek can I ask for re-review? i've resolved conflicts on main branch and staled review |
|
@fvlvte Could you update this PR so I can ask Expensify to review and merge it? |
|
Sure, can do it now @fabioh8010 |
# Conflicts: # src/libs/models/BankAccount.ts
|
@thesahindia Could you review it again so we can get this merged quicker? Thanks! |
situchan
left a comment
There was a problem hiding this comment.
Just approving to pull up engineer for final review
Not sure why it didn't trigger the assignment when I approved the PR. |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks good. Some NAB comments.
| import _ from 'underscore'; | ||
| import {ValueOf} from 'type-fest'; | ||
| import CONST from '@src/CONST'; | ||
| import BankAccountJSON, {AdditionalData} from '@src/types/onyx/BankAccount'; |
There was a problem hiding this comment.
NAB: I would rather not call this BankAccountJSON because that makes me think it's a string that needs to be parsed. Would you please instead match the name here with the type declaration BankAccount?
There was a problem hiding this comment.
Oh I do see that it's already called json in this class even though it's an object. I still like the name change.
| bankAccountID: number; | ||
| state: State; | ||
| validateCodeExpectedDate: string; | ||
| needsToUpgrade: boolean; |
There was a problem hiding this comment.
NAB: Can we make this optionally have additionalData?
| }, | ||
| this.getAdditionalData(), | ||
| ); | ||
| toACHData(): Partial<ACHData> { |
There was a problem hiding this comment.
NAB: I don't really understand why we need Partial here? Aren't we filling in all required fields?
|
@fvlvte I'm going to go ahead and merge this since it's been open for a while. Please create a follow up PR if you want to address the NAB comments. |
|
✋ 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 production by https://github.com/mountiny in version: 1.4.6-2 🚀
|
Details
Migrated src/libs/modules to TypeScript.
Fixed Issues
$ #24871
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
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-ff.mov
Mobile Web - Chrome
web-chrome.mov
Mobile Web - Safari
web-safari.mov
Desktop
electron.mov
iOS
ios17.mov
Android
android.mov