-
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
Remove data from being sideloaded in the money request header #27286
Conversation
@techievivek 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] |
My android setup is broken 😢 I am not sure if I can fill the whole checklist. |
Let me try to bring it up. Sorry for the delay. |
Before any new conflicts arise, I'm going to bring in a C+ to help with review, since both Android and iOS builds are broken for me: https://expensify.slack.com/archives/C03TQ48KC/p1694747895004179 |
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.
Also please pull main
src/components/MoneyRequestHeader.js
Outdated
@@ -34,7 +35,9 @@ const propTypes = { | |||
/** Personal details so we can get the ones for the report participants */ | |||
personalDetails: PropTypes.objectOf(participantPropTypes).isRequired, | |||
|
|||
/** Onyx Props */ | |||
...windowDimensionsPropTypes, |
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.
As this is function component, let's use useWindowDimensions
hook
src/components/MoneyRequestHeader.js
Outdated
@@ -140,8 +144,7 @@ export default compose( | |||
canEvict: false, | |||
}, | |||
transaction: { | |||
key: ({report, parentReportActions}) => | |||
`${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportActions, [report.parentReportActionID, 'originalMessage', 'IOUTransactionID'], '')}`, | |||
key: ({parentReportAction}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportAction, 'originalMessage.IOUTransactionID', 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.
Good catch! parentReportActions
-> parentReportAction
Seems like fixing regression from #25498
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! I spotted that and wanted to fix it here.
Lint is failing |
I have fixed the lint issues, used the dimension hook, and retested it. Can you please have another look? Thanks! |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.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.
@arosiclair 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] |
🎯 @aimane-chnaif, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #27676. |
@arosiclair can you please review and merge this? There is already a reviewer checklist filled out, so you can skip that (I'm not sure why Melvin requested you to fill one out). |
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.
Code LGTM but I don't actually see any of those sideloading get functions being removed from MoneyRequestHeader in these changes 🤔
So, the funny part about it is that someone already updated this component while my PR was open to remove those methods :D I promise they were there when I started! 😂 |
Oh makes sense haha. Good to merge then 👍 |
✋ 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/arosiclair in version: 1.3.72-0 🚀
|
I just checked on However, for the purposes of this testing, as long as you see this scanning header, then that's really all that matters. An alternative way to test this would be to do a manual request to User A and a scan request to User B, and check each of the headers. It doesn't matter if the transactions are in the same report or not. |
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.72-11 🚀
|
Details
This PR marks the two methods as deprecated and then removes them from the money request header and instead loads the data using
withOnyx()
Fixed Issues
Part of #27262
Tests
Offline tests
None really. If you create the requests when you're offline, you can't open them up to view the details until it's synced with the server.
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android