mirror of
https://github.com/discourse/discourse.git
synced 2025-04-10 03:00:49 +08:00
FIX: regression preventing addition of multiple tags in a group
This commit is contained in:
parent
16341219ab
commit
a828da33aa
@ -44,7 +44,7 @@ export default ComboBox.extend(Tags, {
|
|||||||
|
|
||||||
@computed("tags")
|
@computed("tags")
|
||||||
selection(tags) {
|
selection(tags) {
|
||||||
return makeArray(tags);
|
return makeArray(tags).map(c => this.computeContentItem(c));
|
||||||
},
|
},
|
||||||
|
|
||||||
filterComputedContent(computedContent) {
|
filterComputedContent(computedContent) {
|
||||||
@ -125,7 +125,9 @@ export default ComboBox.extend(Tags, {
|
|||||||
computeHeaderContent() {
|
computeHeaderContent() {
|
||||||
let content = this._super();
|
let content = this._super();
|
||||||
|
|
||||||
const joinedTags = this.get("selection").join(", ");
|
const joinedTags = this.get("selection")
|
||||||
|
.map(s => Ember.get(s, "value"))
|
||||||
|
.join(", ");
|
||||||
|
|
||||||
if (isEmpty(this.get("selection"))) {
|
if (isEmpty(this.get("selection"))) {
|
||||||
content.label = I18n.t("tagging.choose_for_topic");
|
content.label = I18n.t("tagging.choose_for_topic");
|
||||||
@ -144,7 +146,13 @@ export default ComboBox.extend(Tags, {
|
|||||||
limit: this.get("siteSettings.max_tag_search_results"),
|
limit: this.get("siteSettings.max_tag_search_results"),
|
||||||
categoryId: this.get("categoryId")
|
categoryId: this.get("categoryId")
|
||||||
};
|
};
|
||||||
if (this.get("selection")) data.selected_tags = this.get("selection").slice(0, 100);
|
|
||||||
|
if (this.get("selection")) {
|
||||||
|
data.selected_tags = this.get("selection")
|
||||||
|
.map(s => Ember.get(s, "value"))
|
||||||
|
.slice(0, 100);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.get("everyTag")) data.filterForInput = true;
|
if (!this.get("everyTag")) data.filterForInput = true;
|
||||||
|
|
||||||
this.searchTags("/tags/filter/search", data, this._transformJson);
|
this.searchTags("/tags/filter/search", data, this._transformJson);
|
||||||
|
@ -49,7 +49,8 @@ export default Ember.Mixin.create({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const inCollection = this.get("collectionComputedContent").map(c => get(c, "id")).includes(term);
|
const inCollection = this.get("collectionComputedContent").map(c => get(c, "id")).includes(term);
|
||||||
const inSelection = this.get("selection").map(s => s.toLowerCase()).includes(term);
|
|
||||||
|
const inSelection = this.get("selection").map(s => get(s, "value").toLowerCase()).includes(term);
|
||||||
if (inCollection || inSelection) {
|
if (inCollection || inSelection) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user