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

This commit is contained in:
Neil Lalonde 2020-09-16 15:39:57 -04:00
parent 8333872e88
commit 04be39ed46
No known key found for this signature in database
GPG Key ID: FF871CA9037D0A91
2 changed files with 14 additions and 4 deletions

View File

@ -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) {

View File

@ -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