-
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
Change Display Name to Functional Component #20953
Conversation
@aimane-chnaif 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] |
@srikarparsi is this ready for review? Lint failing. |
Hi @aimane-chnaif, I just added it as a draft to finish working on later but I should get this ready to review today and will ping you once I do. |
Hi @gedu! I tried addressing the feedback in this comment but didn't completely understand one thing. Why can't |
@aimane-chnaif @gedu, can we make this useCallback have an empty dependency array? containerLayout and childRefs don't change except when the component is mounted so not sure if we have to include them in the dependency array. |
No problem as long as it doesn't need recalculation during component lifecycle. but just make sure to add additional comment (https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#what-is-the-exhaustive-deps-lint-rule-can-i-ignore-it). |
Because the component |
Hi @gedu! I tried finding a couple of ways to avoid using the lambda function but I couldn't find any good ones. The only option I could come find is |
Yes, first I would split the component because if
Then in the
And you use it like:
Hope this makes sense |
Thanks for the tip @gedu! I went ahead with your advice and created a bridge function within the map so that we're not re-creating the getTooltipShiftX function on multiple renders. I did keep it all in the same component though since I didn't think it was worth creating a new UserToolTipItem component to handle this functionality. I also do agree that we should split the component based on tooltipEnabled but I think this should be done in a different PR as I think it would make sense to focus on just the refactor to a functional component. Do you think you could take a look at this whenever you get a chance? @gedu @aimane-chnaif |
@srikarparsi you have a Lint error, you can't have |
Just notice this, In my opinion, there is no better time than now while refactoring the component, you don't even have to create a new file, can be in the same file, but well I think could be @aimane-chnaif call |
created a function for usertooltipitem
Yeah that is true I agree, I'll ask internally to make sure that refactoring components as a whole can be done with refactoring to functional components as we usually like to keep PRs focussed and will make the change if all is okay. I'll also fix lint with this change. |
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.
There are several lint errors to fix
Screen.Recording.2023-07-20.at.7.30.00.AM.mov
Hi @aimane-chnaif, yeah I changed the title to "WIP (work in progress)" because I was working on some other bugs but I'll fix these and re-request review tomorrow or the day after. |
I think it is in good shape, great job migrating the component. I'm not in a C+ role, just supporting here so the final call will be from @aimane-chnaif , who will be checking and testing deeper than me |
Hi @aimane-chnaif, can you please take a look at this whenever you get a chance |
reviewing shortly |
bump @aimane-chnaif |
Hi @aimane-chnaif, did you have a chance to look at this? If you're busy, please let me know and I can ask if there are other C+s who have a spare cycle. |
I will review this by end of this week |
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. Just minor feedback:
Also, please pull main
Thanks @aimane-chnaif, made those changes so this is ready for re-review. |
Reviewer Checklist
Screenshots/VideosWebweb.movDesktopdesktop.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 🎉
@PauloGasparSv 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.
LGTM, tested on Web too and is working fine!
✋ 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/PauloGasparSv in version: 1.3.56-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
setIsEllipsisActive( | ||
containerRef.current && containerRef.current.offsetWidth && containerRef.current.scrollWidth && containerRef.current.offsetWidth < containerRef.current.scrollWidth, | ||
); | ||
}, []); |
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.
Ellipsis is not updated when the fullTitle
prop is changed which is lead to this issue - #27545
Details
Fixed Issues
$ #16141
Tests
Offline tests
QA Steps
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android