Improve conditions for allowing/disallowing editing a money request#29101
Conversation
…/28963-edit-category-paid-request
|
@fedirjh @puneetlath 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] |
…/28963-edit-category-paid-request
|
@fedirjh Could you please give this one a thorough test 🙇 thanks! |
|
@rezkiy37 App crashes when you deep link to the edit form of a non-existent request eg: http://localhost:8082/r/2961714000886174343/edit/amount CleanShot.2023-10-11.at.18.58.06.mp4 |
…/28963-edit-category-paid-request
|
Conflicts resolved! |
…/28963-edit-category-paid-request
|
I've resolved conflicts and @mountiny's comments. Please take a look 🙂 |
…/28963-edit-category-paid-request
|
@fedirjh do you think you could give this one more test |
Yes, I will re-test it shortly. |
fedirjh
left a comment
There was a problem hiding this comment.
Re-tested and looks good to me.
|
✋ 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.90-0 🚀
|
|
My apologies for the slowness here. I had jury duty yesterday. Thanks for moving it forward! |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.90-2 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|
| title={transactionDate} | ||
| interactive={canEdit} | ||
| shouldShowRightIcon={canEdit} | ||
| interactive={canEdit && !isSettled} |
There was a problem hiding this comment.
Curious why we didn't use here canEditFieldOfMoneyRequest and pass the date field to it?
There was a problem hiding this comment.
Looks like we actually can use canEditFieldOfMoneyRequest for those 3 specific fields of MoneyRequestView.
@youssef-lr, can I create a follow up PR for the issue - #28963?
There was a problem hiding this comment.
It's okay, I'm working on this issue and will include this update.

Details
The PR improves conditions for allowing/disallowing editing a money request based on different values of a current user and current money request.
Fixed Issues
$ #28963
PROPOSAL: N/A
Tests
In general, users can only edit a money request if:
All other scenarios mean that the users cannot edit a money request.
By the way, once a report is settled, nobody can modify
amount,currencynordate(creation date).IOU report
Expense report (admin)
amount,currency,date,distanceandreceipt.Expense report (member)
Offline tests
Same as "Tests".
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
Android: Native
Expense Opened Admin
Expense Opened Member
Expense Paid Admin
Expense Paid Member
IOU Opened Requester
IOU Paid Receiver
Android: mWeb Chrome
Expense Paid Admin
Expense Paid Member
IOU Opened Requester
IOU Paid Receiver
Expense Opened Admin
Expense Opened Member
iOS: Native
Expense Opened Admin
Expense Opened Member
Expense Paid Admin
Expense Paid Member
IOU Opened Requester
IOU Paid Receiver
iOS: mWeb Safari
Expense Opened Admin
Expense Opened Member
Expense Paid Admin
Expense Paid Member
IOU Opened Requester
IOU Paid Receiver
MacOS: Chrome / Safari
Expense Opened Admin
Chrome.Expense.Opened.Member.mp4
Expense Opened Admin
Expense Paid Admin
Expense Paid Member
IOU Opened Receiver
IOU Opened Requester
IOU Paid Receiver
IOU Paid Requester
MacOS: Desktop
Expense Opened Admin
Expense Opened Member
Expense Paid Admin
Expense Paid Member
IOU Opened Requester
IOU Paid Receiver