FIX: update tag description field placeholder (#24644)

Improvements after  https://github.com/discourse/discourse/pull/24561

1. Make placeholder more descriptive
2. Respect new line breaks in description
This commit is contained in:
Krzysztof Kotlarek 2023-12-04 09:38:20 +11:00 committed by GitHub
parent 56795f5c07
commit d9ac0c33ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -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) => {

View File

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