coralproject / talk

A better commenting experience from Vox Media
https://coralproject.net
Other
1.89k stars 355 forks source link

[CORL-2805]: Delete user button in admin #4481

Closed kabeaty closed 7 months ago

kabeaty commented 8 months ago

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 says Delete 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. Click Cancel User Deletion button. See that the request is canceled, with the deletion cancellation request shown at the top of the account history and the Delete 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:

Were any tests migrated to React Testing Library?

How do we deploy this PR?

netlify[bot] commented 8 months ago

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
Latest commit 97d845a6768284de9ae06fc403934d5f923f0367
Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/65b00bdcf29c66000884d480