[CORL-2984]: Add ability to select rejection reason for Reject all comments when DSA enabled #4455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 commentsDoes 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 onReject all comments
selected. See that once you selectReject all comments
, theSave
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 theOther
reason, you will need to add acustom 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.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 thisSPAM
reason added.Were any tests migrated to React Testing Library?
How do we deploy this PR?