-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add DeleteMoneyRequest #19095
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
Add DeleteMoneyRequest #19095
Conversation
|
Test result on expense report, expense request with some messages: When delete request on expense report, minus balance shows on payer's side along with Pay button Screen.Recording.2023-07-26.at.6.05.12.PM.mov |
Reviewer Checklist
Screenshots/VideosMany tests conducted in this PR and you can see the screenshots and videos in the backlog so I am not adding another ones here explicitly. There are some known issues we will track in a follow up PRs to fix as this pr is taking a lot of time and its hard to maintain due to merge conflicts. WebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
Ok I think we can go ahead and merge this, it was tested many time across platforms and we are aware of shortcomings we will nail in follow up PRs. @luacmartins Can you make sure you keep an eye on |
|
Will do! |
|
Please feel free to tag me as reviewer on follow-up PR as I am aware of bugs so far. |
|
@luacmartins can you add this one to the follow ups? #19095 (comment) |
I will also 👁️ them. |
|
Added that issue to the follow ups and created a bunch of notification alerts for |
mountiny
left a comment
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.
Great job on this one
|
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Everything was passing |
|
✋ 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/mountiny in version: 1.3.47-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.47-6 🚀
|
|
Friendly piece of feedback that I think it would've been good to add some automated tests for this PR to the existing |
| // STEP 2: Decide if we need to: | ||
| // 1. Delete the transactionThread - delete if there are no visible comments in the thread | ||
| // 2. Update the iouPreview to show [Deleted request] - update if the transactionThread exists AND it isn't being deleted | ||
| const shouldDeleteTransactionThread = transactionThreadID ? ReportActionsUtils.getLastVisibleMessage(transactionThreadID).lastMessageText.length === 0 : false; |
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 missed to take in to account that there could be MODIFIEDEXPENSE actions which would make the last visible message as non-empty, and thus, prevent the thread from getting deleted.
| value: { | ||
| [optimisticIOUAction.reportActionID]: { | ||
| [reportAction.reportActionID]: { | ||
| ...reportAction, |
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 #33158, we're missing pendingAction: null when API is failed, which causes the above UI bug.
| */ | ||
| function canDeleteReportAction(reportAction, reportID) { | ||
| const isActionOwner = reportAction.actorAccountID === currentUserAccountID; | ||
| if (isActionOwner && ReportActionsUtils.isMoneyRequestAction(reportAction) && !isSettled(reportAction.originalMessage.IOUReportID)) { |
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.
In addition to checking if the report is not settled we should have also checked if the report is submitted. In paid policies you can't delete a money request in a submitted report (unless you are the admin).
Details
Introduces the ability to delete requests
cc @mountiny @Julesssss will you please review?
Fixed Issues
$ #19066
Tests
Should be tested with Auth and Web-E PRs
Scenario 1: Deleting from IOU report
TrashcaniconScenario 2: Deleting from transaction view
[Deleted request][Deleted request]and1 replyOffline tests
Same as test steps, but performed offline
QA Steps
Same as tests
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 - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov