VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
409 stars 64 forks source link

[CU-2cq60k0] feat: issue #113 author field population #133

Closed cyp3rius closed 2 years ago

cyp3rius commented 2 years ago

Ticket

https://github.com/VirtusLab/strapi-plugin-comments/issues/113

Summary

What does this PR do/solve?

Provides ability to populate author field and all fields related to it.

Note PR #132 must be merged first

Test Plan

Scenario 1

  1. Run application
  2. Add couple comments using Strapi Users (Authenticated)
  3. Try to call REST API as api/comments/api::page.page:1/flat?populate[author][populate][0]=role
  4. See that role is part of the author per each comment

Scenario 2

  1. Run application
  2. Provide an avatar field to the User Collection and set it for your test users
  3. Add couple comments using Strapi Users (Authenticated)
  4. Try to call REST API as api/comments/api::page.page:1/flat?populate[author][populate][0]=role&populate[author][populate][1]=avatar
  5. See that role is part of the author per each comment as well as avatar
  6. Check the Moderation panel and see that avatar is also visible on the list of comments and their details
codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@9716494). Click here to learn what that means. The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop     #133   +/-   ##
==========================================
  Coverage           ?   40.04%           
==========================================
  Files              ?        9           
  Lines              ?      497           
  Branches           ?      192           
==========================================
  Hits               ?      199           
  Misses             ?      296           
  Partials           ?        2           
Flag Coverage Δ
unittest 40.04% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9716494...af08dae. Read the comment docs.

cyp3rius commented 2 years ago

Task linked: CU-2cq60k0 Support for pupulate in scope of authorUser