Page MenuHomePhabricator

Add `isApproved` field for comments
Open, MediumPublic13 Estimated Story Points

Description

To avoid overriding the explicit wishes of the user for comment visibility, we need another database field to indicate the system approval of the comment (field name is isApproved).

By default, isApproved is true. When a user adds a comment that doesn't pass the text policy validator, isApproved is set to false. isApproved is completely independent from the moderation function: Status change from "NEEDS MODERATION" to another status in the backend won't affect isApproved. Only the "show comment/hide comment" in the backend will change the visibility.

Needed Changes:

  • Add isApproved to entity and domain object. Configure entity to have true as default value
  • Write migration to set isApproved of old data to the value of isPublic.
  • Change Backend application to change isApproved instead of isPublic.
  • Change frontend to change isApproved instead of isPublic when comment is added.
  • Change CommentFinder::getPublicComments in frontend to show comments that fit the following criteria:
    • deleted timestamp is empty
    • isPublic is true
    • status is not NEEDS MODERATION
    • isActive is true
  • Remove code from fronted that changes isPublic on status changes. (see https://github.com/wmde/FundraisingFrontend/pull/490 )

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 13 2016, 12:56 PM
gabriel-wmde renamed this task from Add visibility field for comments to Add `isApproved` field for comments.Jun 13 2016, 12:56 PM
gabriel-wmde updated the task description. (Show Details)
gabriel-wmde updated the task description. (Show Details)Jun 13 2016, 1:10 PM
kai.nissen triaged this task as Medium priority.Apr 19 2017, 12:46 PM
kai.nissen added a project: Epic.
Restricted Application added a project: WMDE-FUN-Team. · View Herald TranscriptApr 19 2017, 12:46 PM

This ticket might be implemented differently when we tackle T203679: Refactor fundraising database schema