FEATURE: Display the reason for many reviewable items

Queued Posts and Users will now display a reason why they are in the
review queue.
This commit is contained in:
Robin Ward
2019-04-11 11:11:35 -04:00
parent 7143572e0c
commit 331a809738
13 changed files with 105 additions and 13 deletions

View File

@ -198,12 +198,9 @@ class NewPostManager
def enqueue(reason = nil)
result = NewPostResult.new(:enqueued)
payload = { raw: @args[:raw], tags: @args[:tags] }
payload[:reason] = reason.to_s if reason
reviewable = ReviewableQueuedPost.new(
created_by: @user,
payload: payload,
payload: { raw: @args[:raw], tags: @args[:tags] },
topic_id: @args[:topic_id],
reviewable_by_moderator: true
)
@ -225,6 +222,7 @@ class NewPostManager
reviewable.add_score(
Discourse.system_user,
ReviewableScore.types[:needs_approval],
reason: reason,
force_review: true
)
else