ui(alerting): Update "Enter custom fieldName" placeholder (#109665)

* ui(alerting): Update custom template placeholder

* Use i18n unescape format, instead of JS unescape fn

* Run `make i18n-extract`

* edit code comment
This commit is contained in:
Pepe Cano
2025-09-23 10:29:02 +02:00
committed by GitHub
parent e53b5902fa
commit d471817cc7
2 changed files with 16 additions and 2 deletions
@@ -303,7 +303,19 @@ function OptionCustomfield({
<TextArea
id={id}
label={t('alerting.option-customfield.label-custom-template', 'Custom template')}
placeholder={option.placeholder}
placeholder={
option.placeholder
? t(
'alerting.option-customfield.placeholder-with-template',
'Enter plain text or reference a template, e.g. {{- currentTemplate}}',
{ currentTemplate: option.placeholder }
)
: // if "option.placeholder" is not set, the placeholder displays the "default.message" template
t(
'alerting.option-customfield.placeholder',
'Enter plain text or reference a template, e.g. {{template "default.message" .}}'
)
}
onChange={(e) => onCustomTemplateChange(e.currentTarget.value)}
defaultValue={initialValue}
/>
+3 -1
View File
@@ -2039,7 +2039,9 @@
"recipient-notification-fires": "Select who should receive a notification when an alert rule fires."
},
"option-customfield": {
"label-custom-template": "Custom template"
"label-custom-template": "Custom template",
"placeholder": "Enter plain text or reference a template, e.g. {{template \"default.message\" .}}",
"placeholder-with-template": "Enter plain text or reference a template, e.g. {{- currentTemplate}}"
},
"other-alert-managers-available": {
"body-selected-alertmanager-not-found": "The selected Alertmanager no longer exists or you may not have permission to access it. You can select a different Alertmanager from the dropdown.",