Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve creating expenses on Collect with Instant Submit #36388
Improve creating expenses on Collect with Instant Submit #36388
Changes from 15 commits
9bc5b38
34917e5
99d1542
4fc82e7
f165755
771eef6
4eb5cbf
9587d19
a2675fe
72ddbc8
f5a5959
5be0b3f
206cd78
f0a99eb
933e0d8
902f45c
9cccb7e
267de9d
4e9ccc9
c0371b2
9eb9b97
8496f5d
ee17782
6a464b3
1777c68
9d9caf6
3fcd191
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I also removed this one, because we aren't really modifying the request in the header. We just need to check for permission to hold/unhold, and delete.
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.
@youssef-lr
quick question here, it doesn't need to be anvm about itisActionOwner
to hold or unhold a request, does it?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.
Yup it doesn't. We used
isRequestModifiable
for that before, it doesn't haveisActionOwner
.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.
Confirmed in Slack that the admin should not be able to delete requests, the backend also throws an error if we try to. This check was also never true
PolicyUtils.isPolicyAdmin(policy));
, ascanDeleteRequest
assumes the actor is the owner of the action, so it contradictedisPolicyAdmin
.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 confirmed here #36202 (comment), the current logic of delete action is: user is not only
an admin
but also anaction/request owner
. If we remove the check of admin, we probably revert the login in this PR #35744There 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.
That PR is outdated given the new logic of instant submit. The backend will not throw if the policy has it enabled.
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.
NAB: Rename to
canAddOrDeleteTransactionFromMoneyRequest
or something like that so we don't have to add this comment// If the report supports adding transactions to it, then it also supports deleting transactions from it.
.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.
True true, on it
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 can remove this comment, or update it to match the new condition.
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.
I think the code is self-explanatory, so we can remove