mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 23:48:44 +08:00
FEATURE: custom flag can require additional message (#27908)
Allow admin to create custom flag which requires an additional message. I decided to rename the old `custom_flag` into `require_message` as it is more descriptive.
This commit is contained in:

committed by
GitHub

parent
58b7dde599
commit
c975c7fe1b
@ -2,11 +2,11 @@
|
||||
|
||||
class FlagSettings
|
||||
attr_reader(
|
||||
:without_custom_types,
|
||||
:without_additional_message_types,
|
||||
:notify_types,
|
||||
:topic_flag_types,
|
||||
:auto_action_types,
|
||||
:custom_types,
|
||||
:additional_message_types,
|
||||
:names,
|
||||
)
|
||||
|
||||
@ -15,8 +15,8 @@ class FlagSettings
|
||||
@topic_flag_types = Enum.new
|
||||
@notify_types = Enum.new
|
||||
@auto_action_types = Enum.new
|
||||
@custom_types = Enum.new
|
||||
@without_custom_types = Enum.new
|
||||
@additional_message_types = Enum.new
|
||||
@without_additional_message_types = Enum.new
|
||||
@names = Enum.new
|
||||
end
|
||||
|
||||
@ -26,7 +26,7 @@ class FlagSettings
|
||||
topic_type: nil,
|
||||
notify_type: nil,
|
||||
auto_action_type: nil,
|
||||
custom_type: nil,
|
||||
require_message: nil,
|
||||
name: nil
|
||||
)
|
||||
@all_flag_types[name_key] = id
|
||||
@ -35,10 +35,10 @@ class FlagSettings
|
||||
@auto_action_types[name_key] = id if !!auto_action_type
|
||||
@names[id] = name if name
|
||||
|
||||
if !!custom_type
|
||||
@custom_types[name_key] = id
|
||||
if !!require_message
|
||||
@additional_message_types[name_key] = id
|
||||
else
|
||||
@without_custom_types[name_key] = id
|
||||
@without_additional_message_types[name_key] = id
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user