REFACTOR: Remove `Discourse.SiteSettings` from nav-item
This commit is contained in:
parent
9dd6367d81
commit
ac0d5b1d3f
|
@ -79,7 +79,8 @@ export default Component.extend(FilterModeMixin, {
|
|||
return NavItem.buildList(category, {
|
||||
filterType,
|
||||
noSubcategories,
|
||||
persistedQueryParams: params
|
||||
persistedQueryParams: params,
|
||||
siteSettings: this.siteSettings
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -61,7 +61,8 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
|
|||
return NavItem.buildList(category, {
|
||||
tagId,
|
||||
filterType,
|
||||
noSubcategories
|
||||
noSubcategories,
|
||||
siteSettings: this.siteSettings
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -12,9 +12,7 @@ import User from "discourse/models/user";
|
|||
const NavItem = EmberObject.extend({
|
||||
@discourseComputed("name")
|
||||
title(name) {
|
||||
const extra = {};
|
||||
|
||||
return I18n.t("filters." + name.replace("/", ".") + ".help", extra);
|
||||
return I18n.t("filters." + name.replace("/", ".") + ".help", {});
|
||||
},
|
||||
|
||||
@discourseComputed("name", "count")
|
||||
|
@ -195,7 +193,14 @@ NavItem.reopenClass({
|
|||
args.category = category;
|
||||
}
|
||||
|
||||
let items = Discourse.SiteSettings.top_menu.split("|");
|
||||
if (!args.siteSettings) {
|
||||
deprecated("You must supply `buildList` with a `siteSettings` object", {
|
||||
since: "2.6.0",
|
||||
dropFrom: "2.7.0"
|
||||
});
|
||||
args.siteSettings = Discourse.SiteSettings;
|
||||
}
|
||||
let items = args.siteSettings.top_menu.split("|");
|
||||
|
||||
const filterType = (args.filterMode || "").split("/").pop();
|
||||
|
||||
|
@ -278,18 +283,3 @@ export function customNavItemHref(cb) {
|
|||
export function addNavItem(item) {
|
||||
NavItem.extraNavItemDescriptors.push(item);
|
||||
}
|
||||
|
||||
if (typeof Discourse !== "undefined") {
|
||||
Object.defineProperty(Discourse, "NavItem", {
|
||||
get() {
|
||||
deprecated(
|
||||
"Import the NavItem class instead of using Discourse.NavItem",
|
||||
{
|
||||
since: "2.4.0",
|
||||
dropFrom: "2.5.0"
|
||||
}
|
||||
);
|
||||
return NavItem;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
tagId=tag.id
|
||||
noSubcategories=noSubcategories
|
||||
}}
|
||||
{{navigation-bar navItems=navItems filterMode=filterMode}}
|
||||
{{else}}
|
||||
<h2 class="tag-show-heading">
|
||||
{{#link-to "tags"}}{{i18n "tagging.tags"}}{{/link-to}}
|
||||
|
@ -34,7 +33,7 @@
|
|||
}}
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{plugin-outlet name="before-create-topic-button"
|
||||
args=(hash
|
||||
canCreateTopic=canCreateTopic
|
||||
|
|
Loading…
Reference in New Issue