Skip to content

Add endpoint to create an abuse report note

Jarka Košanová requested to merge 458264-create-update-ar-note into master

What does this MR do and why?

It adds and endpoint to create an abuse report note

  • adds the mutation to add an abuse report note
  • adjusts frontend to use the endpoint correctly
  • behind abuse_report_notes FF

The newly created note is not dynamically added to the UI, follow-up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/489808+

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

How to set up and validate locally

  1. Enable the Feature flag

    Feature.enable(:abuse_report_notes)
  2. Visit admin area - abuse reports, eg. http://gdk.test:3000/admin/abuse_reports/23

  3. Add a comment, reload

  4. Check your comment is there

  5. You can also run the graphQL mutation:

mutation {
  createAbuseReportNote(input: {
    abuseReportId: "gid://gitlab/AbuseReport/23",
    body: "test aaaaa bbbb"
  }) {
    note {
      id
      discussion {
        id
        notes {
          nodes {
            id
            body
            bodyHtml
            createdAt
            lastEditedAt
            url
            resolved
          }
        }
      }
    }
    errors
  }
}

Related to #458264

Edited by Jarka Košanová

Merge request reports

Loading