coralproject / talk

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

[CORL-2984]: Add ability to select rejection reason for Reject all comments when DSA enabled #4455

Closed kabeaty closed 10 months ago

kabeaty commented 11 months ago

What does this PR do?

These changes add the ability to select a rejection reason when banning a user and rejecting all of their comments when DSA is enabled.

They also ensure that reason of SPAM is what is sent through when using spam ban in-stream moderation.

These changes will impact:

What changes to the GraphQL/Database Schema does this PR introduce?

rejectionReason info is added to the input for banning a user and updating a user ban so that it can be used for the reason for rejected existing comments

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?

Go into the admin and enable DSA. Go to the Community tab and find a user to ban (you'll want them to have a few comments that you can reject too). Ban them on 1) all sites with Reject all comments selected. See that once you select Reject all comments, the Save button is disabled until you choose a reason for rejection. It should be enabled when you choose a reason. You should be able to add a detailed explanation as well. If you choose the Other reason, you will need to add a custom reason as well to be able to save and submit the ban. Submit and then see that all comments for the user are rejected with the given reason/explanation/custom reason combo. 2) specific sites with Reject all comments selected. Use same testing instructions as for all sites, as should see same options.

Now disable DSA. See that the flow is as before; you can select Reject all comments but there is no required rejection reason, etc.

With DSA enabled, also go to the stream as an admin and spam ban a user with multiple comments. See that when you check those comments' rejection reason, it says SPAM. If DSA is disabled, you shouldn't see this SPAM reason added.

Were any tests migrated to React Testing Library?

How do we deploy this PR?

netlify[bot] commented 11 months ago

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
Latest commit 7b253e239a2a34e7cd59dcf638ccd4c0bdc225e8
Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6578af6358c7ba0008871082