From ece3cb73dfecf65dad27eeb0eab95404edc002b7 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Tue, 31 Jul 2018 09:12:30 +0530 Subject: [PATCH] Rename humburger_menu_categories_count site setting to header_dropdown_category_count --- .../javascripts/discourse/widgets/hamburger-menu.js.es6 | 2 +- app/serializers/current_user_serializer.rb | 2 +- config/locales/server.en.yml | 2 +- config/site_settings.yml | 2 +- test/javascripts/widgets/hamburger-menu-test.js.es6 | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 index 0c361e7c1f7..651cf97360f 100644 --- a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 @@ -178,7 +178,7 @@ export default createWidget("hamburger-menu", { listCategories() { const maxCategoriesToDisplay = this.siteSettings - .hamburger_menu_categories_count; + .header_dropdown_category_count; let categories = this.site.get("categoriesByCount"); if (this.currentUser) { diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rb index c55d3ece8a5..cd44c75f663 100644 --- a/app/serializers/current_user_serializer.rb +++ b/app/serializers/current_user_serializer.rb @@ -168,7 +168,7 @@ class CurrentUserSerializer < BasicUserSerializer WHEN notification_level = 4 THEN 3 END") .pluck(:category_id) - .slice(0, SiteSetting.hamburger_menu_categories_count) + .slice(0, SiteSetting.header_dropdown_category_count) end def dismissed_banner_key diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ae2ed3a40da..067f43833c8 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1655,7 +1655,7 @@ en: suppress_uncategorized_badge: "Don't show the badge for uncategorized topics in topic lists." - hamburger_menu_categories_count: "How many categories can be displayed in the hamburger menu." + header_dropdown_category_count: "How many categories can be displayed in the header dropdown menu." permalink_normalizations: "Apply the following regex before matching permalinks, for example: /(topic.*)\\?.*/\\1 will strip query strings from topic routes. Format is regex+string use \\1 etc. to access captures" diff --git a/config/site_settings.yml b/config/site_settings.yml index 1aabd59c5d1..ee0b96c9cc9 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -1415,7 +1415,7 @@ uncategorized: client: true default: true - hamburger_menu_categories_count: + header_dropdown_category_count: client: true default: 8 diff --git a/test/javascripts/widgets/hamburger-menu-test.js.es6 b/test/javascripts/widgets/hamburger-menu-test.js.es6 index c8eacfa0d7d..e94233df476 100644 --- a/test/javascripts/widgets/hamburger-menu-test.js.es6 +++ b/test/javascripts/widgets/hamburger-menu-test.js.es6 @@ -138,8 +138,8 @@ widgetTest("top categories - anonymous", { anonymous: true, beforeEach() { - this.siteSettings.hamburger_menu_categories_count = 8; - maxCategoriesToDisplay = this.siteSettings.hamburger_menu_categories_count; + this.siteSettings.header_dropdown_category_count = 8; + maxCategoriesToDisplay = this.siteSettings.header_dropdown_category_count; categoriesByCount = this.site.get("categoriesByCount"); }, @@ -162,8 +162,8 @@ widgetTest("top categories", { template: '{{mount-widget widget="hamburger-menu"}}', beforeEach() { - this.siteSettings.hamburger_menu_categories_count = 8; - maxCategoriesToDisplay = this.siteSettings.hamburger_menu_categories_count; + this.siteSettings.header_dropdown_category_count = 8; + maxCategoriesToDisplay = this.siteSettings.header_dropdown_category_count; categoriesByCount = this.site.get("categoriesByCount").slice(); categoriesByCount.every(c => { if (!topCategoryIds.includes(c.id)) {