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
413 stars 65 forks source link

Fixed behavior when no enabled collections are configured. #214

Closed JeremyMCastillo closed 1 year ago

JeremyMCastillo commented 1 year ago

All collection types should allow comments when no enabled collection types are set.

StrapiCommentsConfigurationPage

Ticket

Configuration Page

Summary

This PR fixes the behavior of the "Enable comments only for" setting in the Comments plugin configuration. The tooltip underneath the setting states that "If none is selected, all the content types are enabled" however, in production when no content types are selected then no content types are enabled.

Test Plan

This fix was tested with two Content Types: Post and Writer.

Before Fix:

  1. Enable no content types
  2. Try to add comment to Post - Does not Comment
  3. Try to add comment to Writer - Does not Comment
  4. Enable Post in settings
  5. Try to add comment on Post - Correctly adds comment
  6. Try to add comment on Writer - Correctly does not add comment

After Fix:

  1. Enable no content types
  2. Try to add comment to Post - Adds Comment
  3. Try to add comment to Writer - Adds Comment
  4. Enable Post in settings
  5. Try to add comment on Post - Correctly adds comment
  6. Try to add comment on Writer - Correctly does not add comment
cyp3rius commented 1 year ago

@JeremyMCastillo may I ask you to rebase PR to master branch? I will save a lot of work as develop is much outdated.

JeremyMCastillo commented 1 year ago

@cyp3rius Absolutely, I've rebased the PR! I'd be glad to provide anything else if needed.

JeremyMCastillo commented 1 year ago

@cyp3rius FYI I amended my last commit to include gpg signature.