[TS migration] Migrate 'Report.js' lib to TypeScript#28730
Conversation
|
@allroundexperts @ One of you needs to 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] |
|
@allroundexperts I resolved the conflicts and merged the newest main 👌 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2023-12-11.at.5.59.59.AM.movAndroid: mWeb ChromeScreen.Recording.2023-12-11.at.5.53.36.AM.moviOS: NativeScreen.Recording.2023-12-11.at.5.51.57.AM.moviOS: mWeb SafariScreen.Recording.2023-12-11.at.5.50.30.AM.movMacOS: Chrome / SafariScreen.Recording.2023-12-11.at.5.45.16.AM.movMacOS: DesktopScreen.Recording.2023-12-11.at.5.49.05.AM.mov |
allroundexperts
left a comment
There was a problem hiding this comment.
Testing well. Approving it since I don't want to block the merge as this gets conflicts fast.
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24931 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
@blazejkustra we have typecheck errors now. |
|
Yep, I'm on it! |
|
@NikkiWines all yours! Tagging you as this PR gets conflicts pretty fast 😅 |
NikkiWines
left a comment
There was a problem hiding this comment.
Couple NABs but nothing worth holding the PR over. Looks good overall!
| : Object.keys(report).reduce<Record<string, null>>((acc, key) => { | ||
| acc[key] = null; | ||
| return acc; |
There was a problem hiding this comment.
NAB: We prefer non-abbreviated variable names so account would be better here.
| const failureData: OnyxUpdate[] = [ | ||
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`, | ||
| value: { | ||
| isLoadingInitialReportActions: false, | ||
| }, | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
NAB: Since failureData is the same as successData here, we could probably de-dupe this and just use one object called finallyData for such cases (there are a few instances in this file).
I don't think we have any style guidelines about this though, so not a blocker.
| if (typingStatus.userLogin) { | ||
| normalizedStatus = {[typingStatus.userLogin]: true}; | ||
| } else { | ||
| normalizedStatus = typingStatus; |
There was a problem hiding this comment.
NAB: This could be a ternary
| Onyx.connect({ | ||
| key: ONYXKEYS.SESSION, | ||
| callback: (val) => { | ||
| callback: (value) => { |
There was a problem hiding this comment.
Nice, thanks for updating all these variable names 🙌
| }; | ||
|
|
||
| type PersonalDetailsList = Record<string, PersonalDetails>; | ||
|
|
|
✋ 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.12-0 🚀
|
|
🚀 Deployed to staging by https://github.com/NikkiWines in version: 1.4.12-0 🚀
|
|
🚀 Deployed to staging by https://github.com/NikkiWines in version: 1.4.12-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.12-2 🚀
|
Details
Migration of
Report.jsto Typescript.Fixed Issues
$ #24931
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
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.mov
Mobile Web - Chrome
a-web.2.webm
Mobile Web - Safari
i-web.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.webm