discourse/app/serializers/reviewable_flagged_post_serializer.rb
Sam 55a8184231
FEATURE: Reason and deleted content support in the review queue ()
Add flag reason filter and improve handling of deleted content in review queue

This commit enhances the review queue with several key improvements:

1. Adds a new "Reason" filter to allow filtering flags by their score type
2. Improves UI for deleted content by:
   - Adding visual indication for deleted posts (red background)
   - Properly handling deleted content visibility for staff (category mods can not see deleted content)
3. Refactors reviewable score type handling for better code organization
4. Adds  tests for trashed topics/posts visibility

This change will help moderators more efficiently manage the review queue by
being able to focus on specific types of flags and better identify deleted
content.
2024-12-17 11:44:46 +11:00

27 lines
482 B
Ruby

# frozen_string_literal: true
class ReviewableFlaggedPostSerializer < ReviewableSerializer
target_attributes :cooked, :raw, :reply_count, :reply_to_post_number, :deleted_at
attributes :blank_post, :post_updated_at, :post_version
def created_from_flag?
true
end
def post_version
object.target&.version
end
def post_updated_at
object.target&.updated_at
end
def blank_post
true
end
def include_blank_post?
object.target.blank?
end
end