Add report abuse category to comments on issues & MRs
What does this MR do and why?
- Asks user to select an abuse category before they are redirected to the standard report abuse form, when they are reporting a comment posted on an Issue or an MR.
- This change will be added to comments posted on Commits or Snippets in a follow-up MR, in order to reduce the number of changes.
Code changes explained:
- Earlier each note would have it's own
reportAbusePath
attached to it, this would be of the format/abuse_reports/new?ref_url={note_url}&user_id={author_id}
. When a user would click on the report abuse button, they would be redirected to this URL. - Now, we want to trigger the
AbuseCategorySelector
which is a side-drawer to ask users to select the abuse category first. This drawer accepts thereportAbusePath
which is now a fixed path/abuse_reports/add_category
(and hence can be injected), and 2 props -authorId
andnoteUrl
. Hence, each note doesn't need to have it's ownreportAbusePath
anymore.
Screenshots or screen recordings
Issue | Merge Request | Commit (un-changed) |
---|---|---|
issue | merge-request | commit |
How to set up and validate locally
- Log-in as a user and post comments on an issue and merge request.
- Log-in as another user, navigate to the comment, then click on
︙ > Report abuse to administrator
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Resolves gitlab-org/modelops/anti-abuse/team-tasks#192
Edited by Hinam Mehra