migrate PopoverReportActionContextMenu class to function component#27221
Conversation
|
something's wrong with indentation width - sometimes is 2 and in other places 4 - should be 4 (run prettier 😉) |
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
86b28fd to
4ff55d1
Compare
|
@hayata-suenaga 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] |
|
@gedu or @thiagobrez could one of you fill the checklist please 🙇 ? |
|
@hayata-suenaga Sure! I'm on it 👍🏻 |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid.web.movMobile Web - Safariios.web.mp4Desktopdesktop.moviOSios.native.mp4Androidandroid.native.mov |
src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
dd65a06 to
a6f63a2
Compare
|
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
|
✋ 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/hayata-suenaga in version: 1.3.75-0 🚀
|
| reportIDRef.current = '0'; | ||
| reportActionRef.current = {}; |
There was a problem hiding this comment.
I'm not sure why this was added.
@OlimpiaZurek Can you explain?
There was a problem hiding this comment.
@s-alves10 This shouldn't be here. I will prepare a PR to fix this.
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.76-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
| } | ||
| </PopoverWithMeasuredContent> | ||
| <ConfirmModal | ||
| title={translate('reportActionContextMenu.deleteAction', {reportAction})} |
There was a problem hiding this comment.
@OlimpiaZurek Why you change this line? It should be
title={this.props.translate('reportActionContextMenu.deleteAction', {action: this.state.reportAction})}
It causes regression here
| setIsDeleteCommentConfirmModalVisible(true); | ||
| }; | ||
|
|
||
| useImperativeHandle(ref, () => ({ |
| vertical: 0, | ||
| }); | ||
|
|
||
| const [instanceID, setInstanceID] = useState(''); |
There was a problem hiding this comment.
Looks like transforming this from class component to functional useState led to the following issue:
which we fixed by using ref instead.
Details
PR involves refactoring the PopoverReportActionContextMenu from a class to a functional component
Fixed Issues
$ #16260
$
PROPOSAL:
Tests
Offline tests
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 */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
mobile_web_chrome.mov
Mobile Web - Safari
mobile_web_safari.mp4
Desktop
desktop.mov
iOS
iOS.mp4
Android
android.mov