-
Notifications
You must be signed in to change notification settings - Fork 510
Add dialog to delete user from UI #6652
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
Conversation
27b6157 to
9d297be
Compare
|
Does this need a configuration setting? I think it'd be pretty hard for someone to accidentally delete a user using this. If we want a setting, I'd at least make it enabled by default. On another note, since we're adding an option to delete a user, do we also want to a separate option for anonymizing? (I know that this will anonymize the user if it fails to delete, but sometimes you only want to anonymize and not hard-delete) |
|
that was my suggestion since i know cases where not every indico admin should have access |
|
Then I'd keep the setting but make it enabled by default |
On our side, we currently don't need to only anonymise but if you're requesting it then I can include it in this PR. Also I think many of the accounts will end up being anonymised and not deleted :( unless more is done to unlink stuff. Like if a user had uploaded an attachment, then it cannot get deleted. Or if it is linked to a log message. So the 2 buttons will end up doing almost the same thing. |
What if a user who is linked to things that cannot be cleared asks for deletion? In that case you'd need to go for the anonymize option. FWIW it does not destroy their content, but rather unlinks what can be unlinked, and removes their name, email, etc. from the User object. |
|
Yes, this already falls back to anonymise the user if it cannot be deleted |
|
Nice PR, but I think the dialog UI could be improved a bit:
Any thoughts? |
|
Hi @GovernmentPlates, thanks for your feedback.
Screen.Recording.2024-12-05.at.22.54.06.mov |
Unfortunately, it seems that GitHub has changed their deletion UI in recent years (the deletion UI used to be similar to the repo archiving action UI in GH). However, I still believe that having an additional screen is a bit unnecessary for something like this. Not to mention, the second confirmation prompt - whilst it is a good idea to have this safeguard in place, it does introduce a problem in terms of UX, whereby an admin trying to delete a user who may have a special character in their name (e.g. Instead, this is what I had in mind (this also addresses the text): This gives you:
I also noticed that you placed the deletion button in a separate box layout - it would make a bit more sense to move it next to the 'Block Button' (in the top right-hand corner of the 'Details' box) imo. |
|
I agree with @GovernmentPlates , I think a single dialog with all the information in one place is better UX. On another note, could we move the button where the |
|
The initial information that was passed from @ThiefMaster to @OmeGak and then to me was to make it with a 2 screen dialog. Since your team agree with this and it looks like you've already added the change why not add it as a second commit? I would rather move the block button down. This is because having the two buttons too close to each other would lead to issues where people would say that they meant to block, not delete or vice versa and the action is irreversible. |
Can do (sent you a message on Matrix confirming this).
I can see where you are coming from, but the message and countdown should be enough (with the latter ensuring that they do read the message before doing something potentially bad). On the other hand, if they do still end up deleting someone without reading the message first, then maybe its time to think about wether that admin should be an admin in the first place ;) |
ca86c0a to
4eda22b
Compare
343d780 to
525faca
Compare
525faca to
4fa885d
Compare
eb841ef to
525faca
Compare
b6286d6 to
c7b1332
Compare
Minor improvements found (post-review)
|
Just something that we found: administrators can delete other administrators - it would be best to add a check to prevent this (and no, we don't have any "super admin" roles). cc: @ThiefMaster |
|
Ok, nice catch, will add a check for that. Admins can remove other admins though so I guess they will still be able to delete them if they really wanted to. |
|
Yes, it's mainly to avoid accidents |
af35962 to
c052017
Compare
|
Done, I also added disabling blocking of admin accounts. |
823214a to
ccee375
Compare
ccee375 to
8a8ee5f
Compare
- don't pass redirection url from the server - keep dialog open until the page unloaded
It's a less dangerous/destructive option now
Co-authored-by: Dominic Hollis <[email protected]>

This adds an option for admins to delete users from the UI if
ENABLE_DELETE_USER_FROM_UIis True in indico.confIt can be found on the user profile page, e.g http://127.0.0.1:8000/user/<user_id>/profile/