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:
Krzysztof Kotlarek
2024-07-18 10:10:22 +10:00
committed by GitHub
parent 58b7dde599
commit c975c7fe1b
30 changed files with 240 additions and 100 deletions

View File

@ -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