FIX: Do not show Email tab for group settings unless IMAP + SMTP enabled (#10301)

Also hide all the SMTP/IMAP related settings to avoid confusion, as this feature is still not 100% ready to go.
This commit is contained in:
Martin Brennan 2020-07-24 12:00:36 +10:00 committed by GitHub
parent b1cc7825c5
commit 1dd3af20c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 16 deletions

View File

@ -18,10 +18,12 @@ export default Controller.extend({
]; ];
if (!automatic) { if (!automatic) {
if (this.siteSettings.enable_imap && this.siteSettings.enable_smtp) {
defaultTabs.splice(2, 0, { defaultTabs.splice(2, 0, {
route: "group.manage.email", route: "group.manage.email",
title: "groups.manage.email.title" title: "groups.manage.email.title"
}); });
}
defaultTabs.splice(1, 0, { defaultTabs.splice(1, 0, {
route: "group.manage.membership", route: "group.manage.membership",

View File

@ -4,6 +4,12 @@ import I18n from "I18n";
export default DiscourseRoute.extend({ export default DiscourseRoute.extend({
showFooter: true, showFooter: true,
beforeModel() {
if (!this.siteSettings.enable_imap && !this.siteSettings.enable_smtp) {
return this.transitionTo("group.manage.profile");
}
},
titleToken() { titleToken() {
return I18n.t("groups.manage.email.title"); return I18n.t("groups.manage.email.title");
} }

View File

@ -22,8 +22,10 @@
</div> </div>
<div class="control-group"> <div class="control-group">
{{input type="checkbox" name="smtp_ssl" checked=model.smtp_ssl}} <label class="control-group-inline" for="smtp_ssl">
<label class="control-group-inline" for="smtp_ssl">{{i18n "groups.manage.email.credentials.smtp_ssl"}}</label> {{input type="checkbox" name="smtp_ssl" id="smtp_ssl" checked=model.smtp_ssl}}
{{i18n "groups.manage.email.credentials.smtp_ssl"}}
</label>
</div> </div>
<div class="control-group"> <div class="control-group">
@ -37,8 +39,10 @@
</div> </div>
<div class="control-group"> <div class="control-group">
{{input type="checkbox" name="imap_ssl" checked=model.imap_ssl}} <label class="control-group-inline" for="imap_ssl">
<label class="control-group-inline" for="imap_ssl">{{i18n "groups.manage.email.credentials.imap_ssl"}}</label> {{input type="checkbox" name="imap_ssl" checked=model.imap_ssl id="imap_ssl"}}
{{i18n "groups.manage.email.credentials.imap_ssl"}}
</label>
</div> </div>
<div class="control-group"> <div class="control-group">

View File

@ -1029,14 +1029,32 @@ email:
- X-Spam-Flag - X-Spam-Flag
- X-Spam-Status - X-Spam-Status
- X-SES-Spam-Verdict - X-SES-Spam-Verdict
enable_imap: false enable_imap:
enable_imap_write: false default: false
enable_imap_idle: false client: true
enable_smtp: false hidden: true
imap_polling_period_mins: 5 enable_imap_write:
imap_polling_old_emails: 1000 default: false
imap_polling_new_emails: 250 hidden: true
imap_batch_import_email: 100 enable_imap_idle:
default: false
hidden: true
enable_smtp:
default: false
client: true
hidden: true
imap_polling_period_mins:
default: 5
hidden: true
imap_polling_old_emails:
default: 1000
hidden: true
imap_polling_new_emails:
default: 250
hidden: true
imap_batch_import_email:
default: 100
hidden: true
email_prefix: "" email_prefix: ""
email_site_title: "" email_site_title: ""
disable_emails: disable_emails: