[TS migration] Migrate 'SidebarUtils.js' lib to TypeScript#28596
[TS migration] Migrate 'SidebarUtils.js' lib to TypeScript#28596bondydaa merged 18 commits intoExpensify:mainfrom
Conversation
|
@Santhosh-Sellavel 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] |
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
I didn't review this if C+ review required reassign thanks
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24915 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
@Santhosh-Sellavel TS process was changed recently and now C+ are responsible for the reviewer checklist: |
|
Will review this by today/tomorrow. Sorry for the delay. |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-21.at.1.30.56.AM.movMobile Web - Chrome & Mobile Web - SafariScreen.Recording.2023-10-21.at.1.57.14.AM.movDesktopDesktop.moviOS & AndroidAndroid.IOS.mov |
| import _ from 'lodash'; | ||
| import lodashFindLast from 'lodash/findLast'; | ||
| import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; | ||
| import {ValueOf} from 'type-fest'; |
There was a problem hiding this comment.
why are these string or number now? I'd thought the API should be returning reportActionIDs as strings all the time so if they aren't we need to fix that in the API.
There was a problem hiding this comment.
Here actionKey is number that's why. Which is passed to shouldReportActionBeVisible which invoked isReportActionDeprecated with the same type.
Lines 32 to 36 in 1c31bf7
There was a problem hiding this comment.
Hmm think I understand.
so actionKey is an int because in that code for _.filter we're looping over an array which is going to be keyed by an integer?
There was a problem hiding this comment.
Yes index is number!
There was a problem hiding this comment.
hm okay.
It looks like this is mostly there just for checking if the deprecated sequenceNumbers exist which I think should be fully killed by now but I don't think we should do too much in this refactor so I think it's probably fine to leave as is for now.
but after we merge this we should probably clean up that code, i don't think we need to pass key ever and should be able to only pass reportAction but I'm no the most involved on this side of things either.
|
I'm approving this but going to hold on merging until after Money2020 is over |
|
✋ 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/bondydaa in version: 1.3.92-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.92-4 🚀
|
|
🚀 Deployed to staging by https://github.com/bondydaa in version: 1.3.93-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.93-1 🚀
|

Details
Migration of 'SidebarUtils.js' to Typescript.
Fixed Issues
$ #24915
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 */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)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.mov
Mobile Web - Safari
i-web.mov
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mov