This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/controllers/group-manage.js
Martin Brennan af15bf1350
FIX: Show group Email settings if just SMTP enabled (#13362)
We previously only showed the link to the Email section
of group settings if both SMTP and IMAP were enabled for
a site, but this is not necessary now, only SMTP can be
enabled by itself so we should show the section if SMTP
is enabled.
2021-06-15 10:09:25 +10:00

48 lines
1.2 KiB
JavaScript

import Controller from "@ember/controller";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
@discourseComputed("model.automatic")
tabs(automatic) {
const defaultTabs = [
{ route: "group.manage.profile", title: "groups.manage.profile.title" },
{
route: "group.manage.interaction",
title: "groups.manage.interaction.title",
},
{
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",
});
}
defaultTabs.push({
route: "group.manage.logs",
title: "groups.manage.logs.title",
});
if (!automatic) {
if (this.siteSettings.enable_smtp) {
defaultTabs.splice(2, 0, {
route: "group.manage.email",
title: "groups.manage.email.title",
});
}
defaultTabs.splice(1, 0, {
route: "group.manage.membership",
title: "groups.manage.membership.title",
});
}
return defaultTabs;
},
});