-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 'SidebarUtils.js' lib to TypeScript #28596
[TS migration] Migrate 'SidebarUtils.js' lib to TypeScript #28596
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.
LGTM
@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] |
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.
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 |
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.
LGTM
@@ -261,7 +261,7 @@ function isConsecutiveActionMadeByPreviousActor(reportActions: ReportAction[] | | |||
/** | |||
* Checks if a reportAction is deprecated. | |||
*/ | |||
function isReportActionDeprecated(reportAction: OnyxEntry<ReportAction>, key: string): boolean { | |||
function isReportActionDeprecated(reportAction: OnyxEntry<ReportAction>, key: string | number): boolean { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
const reportActionsForDisplay = _.filter( | |
actionsArray, | |
(reportAction, actionKey) => | |
ReportActionsUtils.shouldReportActionBeVisible(reportAction, actionKey) && | |
reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED && |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes index
is number
!
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.
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 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
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)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.mov
Mobile Web - Chrome
a-web.mov
Mobile Web - Safari
i-web.mov
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mov