-
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
Accept receipt in request money #23770
Conversation
I think this PR is ready for review! The API command will fail with |
@abdulrahuman5196 @ One of you needs to 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] |
@abdulrahuman5196 let's get to reviewing this ASAP if you can please! Top priority here! ❤️ 🙇♂️ |
Sure @dylanexpensify Will take this as priority |
}) | ||
.catch((e) => { | ||
console.debug('[FileUtils] Could not read uploaded file', e); | ||
resolve(); |
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.
We are resolving even on failures? Shouldn't we reject?
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.
We resolve with an undefined receipt file and the call to RequestMoney proceeds without the receipt.
I agree that we should eventually reject and display some error to the user, but I didn't see anything about it in the doc. Since this PR is blocking others in this project and we currently don't display errors in MoneyRequestConfirmPage, I think we should keep the scope of this PR smaller and tackle displaying an error as a follow up once we align on what error will be displayed.
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.
Got it. Fine by me then.
Added to the beta and addressed comments. |
Thank you @luacmartins Will test this PR and update if any issue. |
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.
Tests well and looks great!
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeMobile Web - SafariDesktopScreen.Recording.2023-08-04.at.12.25.22.AM.mp4iOSAndroid |
On a side note the API is failing. I assume the End to End working is not complete yet and out of the scope of this PR. |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @luacmartins Good to merge.
🎀 👀 🎀
C+ Reviewed
@roryabraham 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] |
🎯 @abdulrahuman5196, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #24127. |
Incredible work!! |
✋ 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/luacmartins in version: 1.3.51-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.52-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.52-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
return res.blob(); | ||
}) | ||
.then((blob) => { | ||
const file = new File([blob], cleanFileName(fileName)); |
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.
This caused a bug #26940. On Android the File API constructor needs the type to be specified otherwise network uploads would fail.
trimmedComment, | ||
); | ||
if (props.iou.receiptPath && props.iou.receiptSource) { | ||
FileUtils.readFileAsync(props.iou.receiptPath, props.iou.receiptSource).then((receipt) => { |
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.
✋ Coming from #28347
The transaction creation with receipt upload won't work after uploading the receipt and refreshing the page because the file is removed. So we decided to check the file, if the file is not available then we navigated back the user to the main request money page.
Details
Sends the receipt to the API
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/295240
Tests
+ > Request money
RequestMoney
request hasreceipt: (binary)
in the request paramsOffline tests
N/A
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
![Screenshot 2023-08-02 at 5 24 08 PM](https://github.com/Expensify/App/assets/22219519/fbb87117-eb8b-4315-b1e4-0d01e7b59d9f)Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android