-
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
Refactor how data is loaded into the edit request page #28645
Conversation
@pecanoro bump for review please |
}, | ||
}), | ||
// eslint-disable-next-line rulesdir/no-multiple-onyx-in-file | ||
withOnyx({ |
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 not combining both withOnyx
? I am reading this and I am not totally sure why they can't be combined.
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'm glad you caught that! Basically, it can't be done until Expensify/react-native-onyx#385 is merged and implemented.
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.
Gotcha! Thank you for clarifying!
Reviewer Checklist
Screenshots/Videos |
Testing in all platforms before merging! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@pecanoro I'm getting an error when trying to access the report sub-page via deep link. Try accessing deeplink after logout (imp) |
const parentReportAction = ReportActionsUtils.getParentReportAction(report); | ||
const transaction = TransactionUtils.getLinkedTransaction(parentReportAction); | ||
function EditRequestPage({betas, report, route, parentReport, policy, session, policyCategories, policyTags, parentReportActions, transaction}) { | ||
const parentReportAction = parentReportActions[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.
Maybe we can use lodashGet function here to fetch parentReportAction.
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.
Yeah, we could. Ideally, this would be done in the withOnyx
selector
for the key parentReportActions
. When I am able to remove the withOnyx
nesting, I would like to:
- Remove this
const parentReportAction
- Rename
parentReportActions
prop toparentReportAction
- Update the
transaction
prop to useparentReportAction
parentReportAction: {
key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report ? report.parentReportID : '0'}`,
selector: (parentReportActions, {report}) => {lodashGet(parentReportActions, [report.parentReportActionID])},
canEvict: false,
},
transaction: {
key: ({parentReportAction}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportAction, 'originalMessage.IOUTransactionID', 0)}`,
},
This will be possible once Expensify/react-native-onyx#385 is merged.
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.3.80-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.80-3 🚀
|
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.3.81-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
2 similar comments
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
Details
This PR removes two deprecated function calls and moves the data loading into
withOnyx
Fixed Issues
Part of #27262
Tests
Offline tests
Same
QA Steps
Same
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