Repository navigation
Add delete report option - #70349
Add delete report option#70349techievivek merged 17 commits into
Conversation
|
@dominictb 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] |
|
I'm still having trouble running the iOS app. |
|
@bernhardoj Can you merge |
|
Oh, I forgot to add the iOS recording when my iOS was already working. Now I can't run it anymore. |
|
@bernhardoj Please check other language files and resolve failed check. |
|
@bernhardoj I haven't seen translated copies for other languages. For now as the |
|
Wouldn't we follow exactly what we do for the delete option in the
|
|
Totally agree with Tom here, let's reuse the exact same pattern that already exists. |
Mhm, there's never a time where |
|
Agree. @bernhardoj Let's make it only |
|
Not sure where we added |
|
|
I think we can ask the team to run the script since it requires OpenAI API key. |
|
@bernhardoj Can you update steps 5-7 in your tests to reflect the latest changes regarding the |
|
Done |
dominictb
left a comment
There was a problem hiding this comment.
Except for this bug #70349 (comment) that has already happened on prod, which is caused by missing the expense report actions data (it's only available once we open it), everything looks good and tests well.
🎀👀🎀
|
@dominictb Have you reported the above bug? Also @bernhardoj there are conflicts, can you fix them, thanks. |
|
Fixed |
|
@techievivek I've just reported this bug here. |
techievivek
left a comment
There was a problem hiding this comment.
Looks good, just have a quick question regarding selfDM behaviour.
| return true; | ||
| } | ||
|
|
||
| if (isSelfDM(report)) { |
There was a problem hiding this comment.
I don't think we allow users to delete selfDM, no? Did we check on this?
There was a problem hiding this comment.
Oh this means that you can delete your own tracked expenses in self DM. All the logic in this function was moved intact from this one:
App/src/libs/ReportSecondaryActionUtils.ts
Lines 461 to 463 in 0fcf7c2
There was a problem hiding this comment.
That is for the action, no? @bernhardoj's change is for the report, right?
There was a problem hiding this comment.
I think it's fine to delete unreported transactions that may sit inside selfDM but not the selfDM report itself.
There was a problem hiding this comment.
Ok, I see the usage, and it sort of does the same thing but the function name confused me.
There was a problem hiding this comment.
The canDeleteReport name? I named it like this because we are technically deleting the report and also we use this to show the delete option in the expense report itself.
There was a problem hiding this comment.
Hmm, but we can't delete the selfDM, no? So why does that method return true for selfDM?
There was a problem hiding this comment.
This does not mean "deleting the self DM report", it's returning isOwner which means if this transaction is in the self DM and you owned it (technically your tracked expense), you can delete it. So it means you can delete your own tracked expenses.
@bernhardoj I think the function name could be canDeleteMoneyRequestReport. And you can keep the old name isUnreported = isSelfDM so it's not misunderstood as deleting the self DM itself.
There was a problem hiding this comment.
This does not mean "deleting the self DM report", it's returning isOwner which means if this transaction is in the self DM and you owned it (technically your tracked expense), you can delete it. So it means you can delete your own tracked expenses.
Yeah, I understood the same but the method name confused me, I think your suggestion works for me.
|
@bernhardoj Can you please fix the conflicts, we can then get this merged. |
|
@techievivek fixed |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
✋ 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/techievivek in version: 9.2.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.2.19-3 🚀
|
| const isApprovalEnabled = policy ? policy.approvalMode && policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL : false; | ||
| const isForwarded = isProcessingReport(report) && isApprovalEnabled && !isAwaitingFirstLevelApproval(report); | ||
|
|
||
| return isReportSubmitter && isReportOpenOrProcessing && !isForwarded; |
There was a problem hiding this comment.
I'm not sure if it comes from this PR or it's the new requirement
But after bypassing approver, the Delete option should be present in More menu because the report is not approved yet.
More context here





Explanation of Change
Fixed Issues
$ #69546
PROPOSAL: #69546 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
NOTE for QA:
If the report preview only has 1 expense and has never been opened before, the confirmation modal will say delete report instead of delete expense. It's technically an existing issue.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4