FIX: Use new tag routes (#8683)
Commit 1fb7a62 added unambiguous routes for tags. This commit ensures
that the new routes are used.
This commit is contained in:
@@ -2,6 +2,6 @@ import RESTAdapter from "discourse/adapters/rest";
|
||||
|
||||
export default RESTAdapter.extend({
|
||||
pathFor(store, type, id) {
|
||||
return "/tags/" + id + "/info";
|
||||
return "/tag/" + id + "/info";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,6 +2,6 @@ import RESTAdapter from "discourse/adapters/rest";
|
||||
|
||||
export default RESTAdapter.extend({
|
||||
pathFor(store, type, id) {
|
||||
return "/tags/" + id + "/notifications";
|
||||
return "/tag/" + id + "/notifications";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,6 @@ export default Component.extend({
|
||||
|
||||
@discourseComputed("tagRecord.id")
|
||||
href(tagRecordId) {
|
||||
return Discourse.getURL("/tags/" + tagRecordId);
|
||||
return Discourse.getURL("/tag/" + tagRecordId);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,11 +14,11 @@ export default Component.extend({
|
||||
|
||||
@discourseComputed("tagId", "category")
|
||||
href(tagId, category) {
|
||||
var url = "/tags";
|
||||
if (category) {
|
||||
url += category.url;
|
||||
return "/tags" + category.url + "/" + tagId;
|
||||
} else {
|
||||
return "/tag/" + tagId;
|
||||
}
|
||||
return url + "/" + tagId;
|
||||
},
|
||||
|
||||
@discourseComputed("tagId")
|
||||
|
||||
@@ -76,7 +76,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
unlinkSynonym(tag) {
|
||||
ajax(`/tags/${this.tagInfo.name}/synonyms/${tag.id}`, {
|
||||
ajax(`/tag/${this.tagInfo.name}/synonyms/${tag.id}`, {
|
||||
type: "DELETE"
|
||||
})
|
||||
.then(() => this.tagInfo.synonyms.removeObject(tag))
|
||||
@@ -98,7 +98,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
addSynonyms() {
|
||||
ajax(`/tags/${this.tagInfo.name}/synonyms`, {
|
||||
ajax(`/tag/${this.tagInfo.name}/synonyms`, {
|
||||
type: "POST",
|
||||
data: {
|
||||
synonyms: this.newSynonyms
|
||||
|
||||
@@ -20,7 +20,7 @@ function defaultRenderTag(tag, params) {
|
||||
: User.current().username;
|
||||
path = `/u/${username}/messages/tags/${tag}`;
|
||||
} else {
|
||||
path = `/tags/${tag}`;
|
||||
path = `/tag/${tag}`;
|
||||
}
|
||||
}
|
||||
const href = path ? ` href='${Discourse.getURL(path)}' ` : "";
|
||||
|
||||
@@ -79,7 +79,7 @@ export function translateResults(results, opts) {
|
||||
const tagName = Handlebars.Utils.escapeExpression(tag.name);
|
||||
return EmberObject.create({
|
||||
id: tagName,
|
||||
url: Discourse.getURL("/tags/" + tagName)
|
||||
url: Discourse.getURL("/tag/" + tagName)
|
||||
});
|
||||
})
|
||||
.compact();
|
||||
|
||||
@@ -84,7 +84,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
|
||||
filter = `tags/intersection/${tagId}/${this.additionalTags.join("/")}`;
|
||||
} else {
|
||||
this.set("category", null);
|
||||
filter = `tags/${tagId}/l/${topicFilter}`;
|
||||
filter = `tag/${tagId}/l/${topicFilter}`;
|
||||
}
|
||||
|
||||
return findTopicList(this.store, this.topicTrackingState, filter, params, {
|
||||
|
||||
@@ -185,12 +185,12 @@ export default ComboBoxComponent.extend(TagsMixin, {
|
||||
} else if (tagId === "no-tags") {
|
||||
url = Discourse.getURL(this.noTagsUrl);
|
||||
} else {
|
||||
url = "/tags";
|
||||
|
||||
if (this.currentCategory) {
|
||||
url += `/c/${Category.slugFor(this.currentCategory)}/${
|
||||
url = `/tags/c/${Category.slugFor(this.currentCategory)}/${
|
||||
this.currentCategory.id
|
||||
}`;
|
||||
} else {
|
||||
url = "/tag";
|
||||
}
|
||||
|
||||
if (tag && tag.targetTagId) {
|
||||
|
||||
Reference in New Issue
Block a user