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:
parent
56795f5c07
commit
d9ac0c33ff
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<Textarea
|
<Textarea
|
||||||
id="edit-description"
|
id="edit-description"
|
||||||
@value={{readonly this.tagInfo.description}}
|
@value={{readonly this.tagInfo.descriptionWithNewLines}}
|
||||||
placeholder={{i18n "tagging.description"}}
|
placeholder={{i18n "tagging.description"}}
|
||||||
maxlength={{1000}}
|
maxlength={{1000}}
|
||||||
{{on
|
{{on
|
||||||
|
|
|
@ -80,6 +80,10 @@ export default Component.extend({
|
||||||
@action
|
@action
|
||||||
edit(event) {
|
edit(event) {
|
||||||
event?.preventDefault();
|
event?.preventDefault();
|
||||||
|
this.tagInfo.set(
|
||||||
|
"descriptionWithNewLines",
|
||||||
|
this.tagInfo.description?.replaceAll("<br>", "\n")
|
||||||
|
);
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
editing: true,
|
editing: true,
|
||||||
newTagName: this.tag.id,
|
newTagName: this.tag.id,
|
||||||
|
@ -127,6 +131,7 @@ export default Component.extend({
|
||||||
@action
|
@action
|
||||||
finishedEditing() {
|
finishedEditing() {
|
||||||
const oldTagName = this.tag.id;
|
const oldTagName = this.tag.id;
|
||||||
|
this.newTagDescription = this.newTagDescription.replaceAll("\n", "<br>");
|
||||||
this.tag
|
this.tag
|
||||||
.update({ id: this.newTagName, description: this.newTagDescription })
|
.update({ id: this.newTagName, description: this.newTagDescription })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
|
|
|
@ -4308,7 +4308,7 @@ en:
|
||||||
one: "Its synonym will also be deleted."
|
one: "Its synonym will also be deleted."
|
||||||
other: "Its %{count} synonyms will also be deleted."
|
other: "Its %{count} synonyms will also be deleted."
|
||||||
edit_tag: "Edit tag name and description"
|
edit_tag: "Edit tag name and description"
|
||||||
description: "Description"
|
description: "Description (max 1000 characters)"
|
||||||
sort_by: "Sort by:"
|
sort_by: "Sort by:"
|
||||||
sort_by_count: "count"
|
sort_by_count: "count"
|
||||||
sort_by_name: "name"
|
sort_by_name: "name"
|
||||||
|
|
Loading…
Reference in New Issue