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

@@ -0,0 +1,8 @@
# frozen_string_literal: true
class Admin::UnknownReviewablesController < Admin::AdminController
def destroy
Reviewable.destroy_unknown_types!
render json: success_json
end
end

View File

@@ -74,6 +74,7 @@ class ReviewablesController < ApplicationController
total_rows_reviewables: total_rows,
types: meta_types,
reviewable_types: Reviewable.types,
unknown_reviewable_types: Reviewable.unknown_types,
score_types:
ReviewableScore
.types