FEATURE: show existing tag name on rename modal
FIX: tags_filter_regexp was not being applied on tag rename
This commit is contained in:
parent
efb9fd6ac0
commit
296c707f55
|
@ -3,9 +3,12 @@ import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import BufferedContent from "discourse/mixins/buffered-content";
|
import BufferedContent from "discourse/mixins/buffered-content";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
|
import { oneWay } from "@ember/object/computed";
|
||||||
|
|
||||||
export default Controller.extend(ModalFunctionality, BufferedContent, {
|
export default Controller.extend(ModalFunctionality, BufferedContent, {
|
||||||
@discourseComputed("buffered.id", "id")
|
tagId: oneWay("model.id"),
|
||||||
|
|
||||||
|
@discourseComputed("tagId", "model.id")
|
||||||
renameDisabled(inputTagName, currentTagName) {
|
renameDisabled(inputTagName, currentTagName) {
|
||||||
const filterRegexp = new RegExp(this.site.tags_filter_regexp, "g");
|
const filterRegexp = new RegExp(this.site.tags_filter_regexp, "g");
|
||||||
const newTagName = inputTagName
|
const newTagName = inputTagName
|
||||||
|
@ -18,7 +21,7 @@ export default Controller.extend(ModalFunctionality, BufferedContent, {
|
||||||
actions: {
|
actions: {
|
||||||
performRename() {
|
performRename() {
|
||||||
this.model
|
this.model
|
||||||
.update({ id: this.get("buffered.id") })
|
.update({ id: this.get("tagId") })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.send("closeModal");
|
this.send("closeModal");
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{i18n "tagging.rename_instructions"}}
|
{{i18n "tagging.rename_instructions"}}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{input value=buffered.id maxlength=siteSettings.max_tag_length}}
|
{{input value=tagId maxlength=siteSettings.max_tag_length}}
|
||||||
</div>
|
</div>
|
||||||
{{/d-modal-body}}
|
{{/d-modal-body}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue