Conversation
|
This pull request introduces 1 alert when merging 456551f into a0414e1 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## main #874 +/- ##
=======================================
Coverage ? 79.77%
=======================================
Files ? 1000
Lines ? 21936
Branches ? 2286
=======================================
Hits ? 17500
Misses ? 3437
Partials ? 999 Continue to review full report at Codecov.
|
Conflicts: src/app/core/data/feature-authorization/feature-id.ts
|
This pull request introduces 2 alerts when merging 5615390 into c67d2e6 - view on LGTM.com new alerts:
|
tdonohue
left a comment
There was a problem hiding this comment.
@artlowel : The code looks good overall. No comments there.
However in testing, I found a minor bug when I forced an error to occur. Here's how to reproduce it:
- Create a new eperson (or use an existing one)
- Find a Collection that has no workflow yet. Add that EPerson as the only member of a workflow group (it doesn't matter which one)
- Try to delete that EPerson. An error occurs (as that's expected), but the message says:
Error occured when trying to delete EPerson with id: [uuid] with code: 422 and message: OK. The problem is the "OK" in that message.
When looking at the actual response from the REST API (in Chrome DevTools), it has a different message. It shows:
{"timestamp":"2020-10-01T21:23:54.979+0000",
"status":422,
"error":"Unprocessable Entity",
"message":"Unprocessable or invalid entity",
"trace":"[a really long exception]",
"path":"/server/api/eperson/epersons/d32471a1-c625-4598-a75c-64e24fafed29"}
The message here likely should be improved/enhanced (possibly on the backend). But, it's obviously not saying "OK" :)
Beyond that minor bug, everything else seems to be working. I get a confirmation when I try to delete, and I can delete other epersons successfully.
tdonohue
left a comment
There was a problem hiding this comment.
👍 I re-tested this today with the backend PR (DSpace/DSpace#2928). The previous bug I reported is now solved. I did find a small bug in the backend PR, but that issue is unrelated to this PR. So, once the backend is ready-to-go, this PR can also be merged.
(NOTE to other reviewers. The red ❌ on this PR can be disregarded, as it's a failure in an optional check. It appears simply because the code coverage of new code in this PR is slightly lower than the percentage on main. However, the overall code coverage still improves, so this PR is good enough as-is.)
Thanks @artlowel and @Raf-atmire !
|
Merging, as the backend PR (DSpace/DSpace#2928) was also just merged. Thanks @artlowel ! |
…oad after agreeing (DSpace#874) * Changed logic (condition) of retrieving file download link * Saved the original logic, but changed caching parameter
References
Description
This PR adds the ability to delete EPersons
Instructions for Reviewers
This PR adds functionality to the pre-existing delete buttons on the EPerson detail page and the EPerson overview.
After clicking a delete button you'll get a confirmation dialog.
This PR will test whether the current user should have the right to delete a certain EPerson before enabling the button using the features and authorizations system. However, there are certain rules in the backend which prevent an EPerson from being deleted, that are only checked after you send the delete request for performance reasons (e.g. you try to delete the only EPerson in a workflow group that has items). In those cases, we can't disable the button ahead of time, instead you'll get an error notification with the message from the backend if you try the delete and it fails.
Reviewers can test this PR by:
Checklist
yarn run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.