FEATURE: Gracefully handle unhandled reviewables (#31118)

Plugins like for example AI or Akismet create reviewable items. When the
plugin is disabled, then we cannot properly handle those items.

In that situation, we should display warnings about unhandled types.
Instruct admin to reenable plugins. In addition, we should allow the
admin to delete all pending reviews from disabled plugins.
This commit is contained in:
Krzysztof Kotlarek
2025-02-05 14:38:45 +11:00
committed by GitHub
parent f439bf14cc
commit 5eb7d6d9c0
13 changed files with 179 additions and 1 deletions

View File

@@ -584,6 +584,15 @@ en:
date_filter: "Posted between"
in_reply_to: "in reply to"
filtered_flagged_by: "Flagged by"
unknown:
title:
one: "You have pending reviewables from disabled plugin:"
other: "You have pending reviewables from disabled plugins:"
instruction: "They cannot be properly displayed until you enable the relevant plugin. Please enable the plugin and refresh the page. Alternatively, you can ignore them. <a href='%{url}' target='_blank'>Learn more...</a>"
ignore_all: "Ignore all"
enable_plugins: "Enable plugins"
delete_confirm: "Are you sure you want to delete all reviews created by disabled plugins?"
ignore_success: "All reviews created by disabled plugins have been deleted."
explain:
why: "explain why this item ended up in the queue"
title: "Reviewable Scoring"

View File

@@ -449,6 +449,8 @@ Discourse::Application.routes.draw do
get "section/:section_id" => "section#show", :constraints => AdminConstraint.new
resources :admin_notices, only: %i[destroy], constraints: AdminConstraint.new
delete "unknown_reviewables/destroy" => "unknown_reviewables#destroy"
end # admin namespace
get "email/unsubscribe/:key" => "email#unsubscribe", :as => "email_unsubscribe"