mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Adds a pop up that shows a more detailed score for reviewables (#8035)
If you click a (?) icon beside the reviewable status a pop up will appear with expanded informatio that explains how the reviewable got its score, and how it compares to system thresholds.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
require_dependency 'reviewable_explanation_serializer'
|
||||
|
||||
class ReviewablesController < ApplicationController
|
||||
requires_login
|
||||
@ -102,6 +103,17 @@ class ReviewablesController < ApplicationController
|
||||
)
|
||||
end
|
||||
|
||||
def explain
|
||||
reviewable = find_reviewable
|
||||
|
||||
render_serialized(
|
||||
{ reviewable: reviewable, scores: reviewable.explain_score },
|
||||
ReviewableExplanationSerializer,
|
||||
rest_serializer: true,
|
||||
root: 'reviewable_explanation'
|
||||
)
|
||||
end
|
||||
|
||||
def show
|
||||
reviewable = find_reviewable
|
||||
|
||||
|
Reference in New Issue
Block a user