Skip to content

A platform for community discussion. Free, open, simple.

FIX: update tag description field placeholder (#24644)

Krzysztof Kotlarekd9ac0c33ff06
diff --git a/app/assets/javascripts/discourse/app/components/tag-info.hbs b/app/assets/javascripts/discourse/app/components/tag-info.hbs
index 3f9e44f10f0..f8773bc0375 100644
--- a/app/assets/javascripts/discourse/app/components/tag-info.hbs
+++ b/app/assets/javascripts/discourse/app/components/tag-info.hbs
@@ -13,7 +13,7 @@
<Textarea
id="edit-description"
- @value={{readonly this.tagInfo.description}}
+ @value={{readonly this.tagInfo.descriptionWithNewLines}}
placeholder={{i18n "tagging.description"}}
maxlength={{1000}}
{{on
diff --git a/app/assets/javascripts/discourse/app/components/tag-info.js b/app/assets/javascripts/discourse/app/components/tag-info.js
index 47b7795e0ea..587d7bc7daa 100644
--- a/app/assets/javascripts/discourse/app/components/tag-info.js
+++ b/app/assets/javascripts/discourse/app/components/tag-info.js
@@ -80,6 +80,10 @@ export default Component.extend({
@action
edit(event) {
event?.preventDefault();
+ this.tagInfo.set(
+ "descriptionWithNewLines",
+ this.tagInfo.description?.replaceAll("<br>", "\n")
+ );
this.setProperties({
editing: true,
newTagName: this.tag.id,
@@ -127,6 +131,7 @@ export default Component.extend({
@action
finishedEditing() {
const oldTagName = this.tag.id;
+ this.newTagDescription = this.newTagDescription.replaceAll("\n", "<br>");
this.tag
.update({ id: this.newTagName, description: this.newTagDescription })
.then((result) => {
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 7e18768a4d5..11635b18129 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -4308,7 +4308,7 @@ en:
one: "Its synonym will also be deleted."
other: "Its %{count} synonyms will also be deleted."
edit_tag: "Edit tag name and description"
- description: "Description"
+ description: "Description (max 1000 characters)"
sort_by: "Sort by:"
sort_by_count: "count"
sort_by_name: "name"