rename `visible` to `visibleSiteSettings`

This commit is contained in:
Kyle Zhao 2018-12-11 10:48:12 -05:00 committed by Sam
parent c9279a118e
commit 92df7b212c
5 changed files with 9 additions and 8 deletions

View File

@ -4,7 +4,7 @@ export default Ember.Controller.extend({
categoryNameKey: null,
adminSiteSettings: Ember.inject.controller(),
@computed("adminSiteSettings.visible", "categoryNameKey")
@computed("adminSiteSettings.visibleSiteSettings", "categoryNameKey")
category(categories, nameKey) {
return (categories || []).findBy("nameKey", nameKey);
},

View File

@ -3,7 +3,7 @@ import debounce from "discourse/lib/debounce";
export default Ember.Controller.extend({
filter: null,
allSiteSettings: Ember.computed.alias("model"),
visible: null,
visibleSiteSettings: null,
onlyOverridden: false,
filterContentNow(category) {
@ -16,7 +16,7 @@ export default Ember.Controller.extend({
}
if ((!filter || 0 === filter.length) && !this.get("onlyOverridden")) {
this.set("visible", this.get("allSiteSettings"));
this.set("visibleSiteSettings", this.get("allSiteSettings"));
this.transitionToRoute("adminSiteSettings");
return;
}
@ -64,7 +64,7 @@ export default Ember.Controller.extend({
all.hasMore = matches.length > 30;
all.count = all.hasMore ? "30+" : matches.length;
this.set("visible", matchesGroupedByCategory);
this.set("visibleSiteSettings", matchesGroupedByCategory);
this.transitionToRoute(
"adminSiteSettingsCategory",
category || "all_results"

View File

@ -6,7 +6,8 @@ export default Discourse.Route.extend({
beforeModel() {
this.replaceWith(
"adminSiteSettingsCategory",
this.controllerFor("adminSiteSettings").get("visible")[0].nameKey
this.controllerFor("adminSiteSettings").get("visibleSiteSettings")[0]
.nameKey
);
}
});

View File

@ -12,8 +12,8 @@ export default Discourse.Route.extend({
afterModel(siteSettings) {
const controller = this.controllerFor("adminSiteSettings");
if (!controller.get("visible")) {
controller.set("visible", siteSettings);
if (!controller.get("visibleSiteSettings")) {
controller.set("visibleSiteSettings", siteSettings);
}
}
});

View File

@ -15,7 +15,7 @@
<div class="admin-nav pull-left">
<ul class="nav nav-stacked">
{{#each visible as |category|}}
{{#each visibleSiteSettings as |category|}}
<li class="{{category.nameKey}}">
{{#link-to 'adminSiteSettingsCategory' category.nameKey class=category.nameKey}}
{{category.name}}