DEV: APIs for plugin to add custom reviewable confirm modal (#12246)

This commit is contained in:
Mark VanLandingham
2021-03-02 10:28:27 -06:00
committed by GitHub
parent 4c1e02d412
commit 4adce0d844
8 changed files with 95 additions and 6 deletions

View File

@@ -84,6 +84,7 @@ class DiscoursePluginRegistry
define_filtered_register :user_api_key_scope_mappings
define_filtered_register :permitted_bulk_action_parameters
define_filtered_register :reviewable_params
def self.register_auth_provider(auth_provider)
self.auth_providers << auth_provider

View File

@@ -877,6 +877,13 @@ class Plugin::Instance
DiscoursePluginRegistry.demon_processes << demon_class
end
def add_permitted_reviewable_param(type, param)
DiscoursePluginRegistry.register_reviewable_param({
type: type,
param: param
}, self)
end
protected
def self.js_path

View File

@@ -33,7 +33,7 @@ class Reviewable < ActiveRecord::Base
end
class Action < Item
attr_accessor :icon, :button_class, :label, :description, :confirm_message, :client_action, :require_reject_reason
attr_accessor :icon, :button_class, :label, :description, :confirm_message, :client_action, :require_reject_reason, :custom_modal
def initialize(id, icon = nil, button_class = nil, label = nil)
super(id)