diff --git a/app/assets/javascripts/discourse/app/components/global-notice.js b/app/assets/javascripts/discourse/app/components/global-notice.js index 01c3d59295..7432143273 100644 --- a/app/assets/javascripts/discourse/app/components/global-notice.js +++ b/app/assets/javascripts/discourse/app/components/global-notice.js @@ -121,13 +121,20 @@ export default Component.extend({ ); } - if (disableEmails === "yes" || disableEmails === "non-staff") { + if (disableEmails === "yes") { notices.push( Notice.create({ text: I18n.t("emails_are_disabled"), id: "alert-emails-disabled", }) ); + } else if (disableEmails === "non-staff") { + notices.push( + Notice.create({ + text: I18n.t("emails_are_disabled_non_staff"), + id: "alert-emails-disabled", + }) + ); } if (wizardRequired) { diff --git a/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js b/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js index a4bdd4e8fa..1f9b6edc6b 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js @@ -1,10 +1,12 @@ import { acceptance, exists, + query, updateCurrentUser, } from "discourse/tests/helpers/qunit-helpers"; import { test } from "qunit"; import { visit } from "@ember/test-helpers"; +import I18n from "I18n"; acceptance("Email Disabled Banner", function (needs) { needs.user(); @@ -25,6 +27,11 @@ acceptance("Email Disabled Banner", function (needs) { exists(".alert-emails-disabled"), "alert is displayed when email disabled" ); + assert.strictEqual( + query(".alert-emails-disabled").innerText, + I18n.t("emails_are_disabled"), + "alert uses the correct text" + ); }); test("when non-staff", async function (assert) { @@ -34,6 +41,11 @@ acceptance("Email Disabled Banner", function (needs) { exists(".alert-emails-disabled"), "alert is displayed when email disabled for non-staff" ); + assert.strictEqual( + query(".alert-emails-disabled").innerText, + I18n.t("emails_are_disabled_non_staff"), + "alert uses the correct text" + ); updateCurrentUser({ moderator: true }); await visit("/"); @@ -41,5 +53,10 @@ acceptance("Email Disabled Banner", function (needs) { exists(".alert-emails-disabled"), "alert is displayed to staff when email disabled for non-staff" ); + assert.strictEqual( + query(".alert-emails-disabled").innerText, + I18n.t("emails_are_disabled_non_staff"), + "alert uses the correct text" + ); }); }); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 320cb50c29..009d6f3060 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -182,6 +182,7 @@ en: wizard_required: "Welcome to your new Discourse! Let’s get started with the setup wizard ✨" emails_are_disabled: "All outgoing email has been globally disabled by an administrator. No email notifications of any kind will be sent." + emails_are_disabled_non_staff: "Outgoing email has been disabled for non-staff users." software_update_prompt: message: "We've updated this site, please refresh, or you may experience unexpected behavior."