summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-03-24 20:43:09 +0000
committerCorey Hulen <corey@hulen.com>2017-03-24 13:43:09 -0700
commit22715a31ed6238eb4f8f0dd8125bf23958345e78 (patch)
tree4e00f3a300f26d8c4c8efe09410a5f629e0d3314 /webapp/components
parent2c0c71d460e749e1cd0c905a663349c3af94bdeb (diff)
downloadchat-22715a31ed6238eb4f8f0dd8125bf23958345e78.tar.gz
chat-22715a31ed6238eb4f8f0dd8125bf23958345e78.tar.bz2
chat-22715a31ed6238eb4f8f0dd8125bf23958345e78.zip
PLT-5879: User email notification settings disabling. (#5837)
When Email Notifications are turned off server wide, don't allow the user to configure their email notification preferences.
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/user_settings/email_notification_setting.jsx34
1 files changed, 33 insertions, 1 deletions
diff --git a/webapp/components/user_settings/email_notification_setting.jsx b/webapp/components/user_settings/email_notification_setting.jsx
index 1e6c5d7f5..6980be0b7 100644
--- a/webapp/components/user_settings/email_notification_setting.jsx
+++ b/webapp/components/user_settings/email_notification_setting.jsx
@@ -57,10 +57,42 @@ export default class EmailNotificationSetting extends React.Component {
}
render() {
+ if (global.window.mm_config.SendEmailNotifications !== 'true' && this.props.activeSection === 'email') {
+ const inputs = [];
+
+ inputs.push(
+ <div
+ key='oauthEmailInfo'
+ className='padding-top'
+ >
+ <FormattedMessage
+ id='user.settings.notifications.email.disabled_long'
+ defaultMessage='Email notifications have been disabled by your System Administrator.'
+ />
+ </div>
+ );
+
+ return (
+ <SettingItemMax
+ title={localizeMessage('user.settings.notifications.emailNotifications', 'Email notifications')}
+ inputs={inputs}
+ server_error={this.state.serverError}
+ updateSection={this.collapse}
+ />
+ );
+ }
+
if (this.props.activeSection !== 'email') {
let description;
- if (this.props.enableEmail) {
+ if (global.window.mm_config.SendEmailNotifications !== 'true') {
+ description = (
+ <FormattedMessage
+ id='user.settings.notifications.email.disabled'
+ defaultMessage='Disabled by System Administrator'
+ />
+ );
+ } else if (this.props.enableEmail) {
switch (this.state.emailInterval) {
case Preferences.INTERVAL_IMMEDIATE:
description = (