Skip to content

A platform for community discussion. Free, open, simple.

FIX: don't show Tags tab in group management if tags are disabled

Neil Lalonde04be39ed464c
diff --git a/app/assets/javascripts/discourse/app/controllers/group-manage.js b/app/assets/javascripts/discourse/app/controllers/group-manage.js
index 464c61c173c..fd7042334b4 100644
--- a/app/assets/javascripts/discourse/app/controllers/group-manage.js
+++ b/app/assets/javascripts/discourse/app/controllers/group-manage.js
@@ -17,13 +17,19 @@ export default Controller.extend({
route: "group.manage.categories",
title: "groups.manage.categories.title",
},
- {
+ ];
+
+ if (this.siteSettings.tagging_enabled) {
+ defaultTabs.push({
route: "group.manage.tags",
title: "groups.manage.tags.title",
- },
+ });
+ }
- { route: "group.manage.logs", title: "groups.manage.logs.title" },
- ];
+ defaultTabs.push({
+ route: "group.manage.logs",
+ title: "groups.manage.logs.title",
+ });
if (!automatic) {
if (this.siteSettings.enable_imap && this.siteSettings.enable_smtp) {
diff --git a/app/serializers/group_show_serializer.rb b/app/serializers/group_show_serializer.rb
index ee54b335849..609785499f2 100644
--- a/app/serializers/group_show_serializer.rb
+++ b/app/serializers/group_show_serializer.rb
@@ -100,6 +100,10 @@ class GroupShowSerializer < BasicGroupSerializer
group_category_notifications[NotificationLevels.all[level]] || []
end
+ define_method("include_#{level}_tags?") do
+ SiteSetting.tagging_enabled?
+ end
+
define_method("#{level}_tags") do
group_tag_notifications[NotificationLevels.all[level]] || []
end