mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: APIs for plugin to add custom reviewable confirm modal (#12246)
This commit is contained in:
committed by
GitHub
parent
4c1e02d412
commit
4adce0d844
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user