-
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
Load parent report action from withOnyx in ReportActionItem #34057
Load parent report action from withOnyx in ReportActionItem #34057
Conversation
@marcaaron 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] |
Reviewer Checklist
Screenshots/Videos |
@@ -768,6 +772,10 @@ export default compose( | |||
userWallet: { | |||
key: ONYXKEYS.USER_WALLET, | |||
}, | |||
parentReportActions: { |
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.
For a little extra context, I did look into subscribing to this higher up in the component tree, but it got pretty convoluted and went all the way up to ReportScreen
. Interestingly enough, I have this PR where ReportScreen
is now subscribing to the parent report action... so if we really wanted to, we could pass the parentReportAction
all the way down as a prop. It would be a bigger change, but it might have less of a possible performance impact on this component (which looks to be highly optimized).
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!
🎯 @allroundexperts, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #34067. |
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.
1 nit otherwise LGTM
@@ -569,7 +573,7 @@ function ReportActionItem(props) { | |||
}; | |||
|
|||
if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) { | |||
const parentReportAction = ReportActionsUtils.getParentReportAction(props.report); | |||
const parentReportAction = props.parentReportActions[props.report.parentReportActionID]; |
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.
Are we sure we will have a report? I assume yes. But it's a little ambiguous because you have a conditional on line 776 that does:
key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report ? report.parentReportID : 0}`,
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.
The proptypes declare that report
is required, as well as in both of the parents that use this component, so I am confident in expecting report
to always be there (though I know it's not a guarantee). The only reason there is a conditional on 776 is because I copied it from other components. I'll remove the conditional down there.
Co-authored-by: Amy Evans <amy@expensify.com>
Updated |
I'm putting a quick HOLD on this. I found out that I am able to use selectors to limit the scope of what |
OK, nevermind. That didn't work. Removing HOLD. |
✋ 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/tgolen in version: 1.4.24-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.24-3 🚀
|
Details
This removes a deprecated method and loads the data directly from withOnyx now.
Fixed Issues
Part of #27262
Tests
Offline tests
Same as above
QA Steps
Same as above
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
Unable to test due to broken local emulator
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop