FIX: use a custom prefix for custom flags (#28839)

Currently, when the custom flag has the same name as the system flag (which is disabled) then it is not displayed. To fix the problem, `custom_` prefix as `name_key` is used to distinguish between the system and the custom flag.

I considered writing a migration to fix existing custom flags name key. However, at the end of migration I would need to run rails code to reset cache `Flag.reset_flag_settings!`. I decided to skip that step as it is a very edge case. If someone has the same flag name as the system flag, then all they have to do is edit the flag and click save.

In addition, I made 2 small fixes:
- edit flag title was missing translation;
- flag form UI was not showing that description is the required field.
This commit is contained in:
Krzysztof Kotlarek
2024-09-11 15:30:20 +10:00
committed by GitHub
parent 0323b366f3
commit 1f1709d249
7 changed files with 56 additions and 23 deletions

View File

@@ -5617,6 +5617,7 @@ en:
saved: "saved!"
flags:
header: "Moderation Flags"
edit_header: "Edit Flag"
subheader: "The flagging system in Discourse helps you and your moderator team manage content and user behavior, keeping your community respectful and healthy. The defaults are suitable for most communities and you dont have to change them. However, if your site has particular requirements you can disable flags you dont need and add your own custom flags."
description: "Description"
enabled: "Enabled?"