-
Notifications
You must be signed in to change notification settings - Fork 356
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
[CORL-2805]: Delete user button in admin #4481
Conversation
✅ Deploy Preview for gallant-galileo-14878c canceled.
|
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.
Looks good, made a couple comments about some resolver return types that might be worth looking into.
}; | ||
|
||
export const UserDeletionStatus: Required< | ||
GQLUserDeletionStatusTypeResolver<UserDeletionStatusInput> |
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.
Are we using an input as a resolver result type here? Maybe time for a new interface or maybe there is a generated schema type that would make more sense?
@@ -57,6 +58,10 @@ export const UserStatus: Required<GQLUserStatusTypeResolver<UserStatusInput>> = | |||
...user.consolidateUsernameStatus(username), | |||
userID, | |||
}), | |||
deletion: ({ userID, deletion }): UserDeletionStatusInput => ({ |
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.
Same here, seems like the resolver might have generated a result type instead of an Input.
What does this PR do?
These changes add a button to the user account history drawer to be able to delete a user's account if you are an admin. You can also cancel the deletion request there if one has already been made. The history of account deletion requests and cancellations is also now displayed in the user account history drawer.
These changes will impact:
What changes to the GraphQL/Database Schema does this PR introduce?
These changes add user deletion history to a user's status history to keep track of requests and cancellations for deletion. The changes also add mutations for scheduling deletions and cancelling deletions to be used by admin users other than the target user.
Does this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to
INDEXES.md
?n/a
How do I test this PR?
You can test this PR by logging in as an admin user and clicking on another user's username in the Community tab of the admin to open that user's account history drawer. Then click
Account History
. You should see a button at the top that saysDelete Account
. When you click it, you will see that it now says the account has been scheduled for deletion along with when and the option to cancel it. You should also see this deletion request at the top of the account history with the username of the user who you used to request it. ClickCancel User Deletion
button. See that the request is canceled, with the deletion cancellation request shown at the top of the account history and theDelete Account
button shown again.If there is an error when scheduling the account deletion, its message will be displayed in the account deletion popover. If there is an error canceling the account deletion, it will be displayed in account history near the cancel deletion callout. You can also test these if you like.
You can also confirm that:
My profile
->Account
, the deletion history is updated and shown in the user account history drawer in the admin accordinglyWere any tests migrated to React Testing Library?
How do we deploy this PR?