FIX: Show group Email settings if just SMTP enabled (#13362)

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.

diff --git a/app/assets/javascripts/discourse/app/controllers/group-manage.js b/app/assets/javascripts/discourse/app/controllers/group-manage.js
index de7cea1..3d4e684 100644
--- a/app/assets/javascripts/discourse/app/controllers/group-manage.js
+++ b/app/assets/javascripts/discourse/app/controllers/group-manage.js
@@ -29,7 +29,7 @@ export default Controller.extend({
     });
 
     if (!automatic) {
-      if (this.siteSettings.enable_imap && this.siteSettings.enable_smtp) {
+      if (this.siteSettings.enable_smtp) {
         defaultTabs.splice(2, 0, {
           route: "group.manage.email",
           title: "groups.manage.email.title",
diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js
index cbfbe08..409393c 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js
@@ -9,6 +9,10 @@ acceptance("Managing Group Email Settings - SMTP Disabled", function (needs) {
 
   test("When SiteSetting.enable_smtp is false", async function (assert) {
     await visit("/g/discourse/manage/email");
+    assert.notOk(
+      queryAll(".user-secondary-navigation").text().includes("Email"),
+      "email link is not shown in the sidebar"
+    );
     assert.equal(
       currentRouteName(),
       "group.manage.profile",
@@ -25,6 +29,10 @@ acceptance(
 
     test("When SiteSetting.enable_smtp is true but SiteSetting.enable_imap is false", async function (assert) {
       await visit("/g/discourse/manage/email");
+      assert.ok(
+        queryAll(".user-secondary-navigation").text().includes("Email"),
+        "email link is shown in the sidebar"
+      );
       assert.equal(
         currentRouteName(),
         "group.manage.email",
@@ -60,6 +68,10 @@ acceptance(
     test("enabling SMTP, testing, and saving", async function (assert) {
       await visit("/g/discourse/manage/email");
       assert.ok(
+        queryAll(".user-secondary-navigation").text().includes("Email"),
+        "email link is shown in the sidebar"
+      );
+      assert.ok(
         exists("#enable_imap:disabled"),
         "IMAP is disabled until SMTP settings are valid"
       );

GitHub sha: af15bf13503a619f66f8187901c75240bb909617

This commit appears in #13362 which was approved by nbianca. It was merged by martin.