summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2017-02-27 17:55:12 -0300
committerGitHub <noreply@github.com>2017-02-27 17:55:12 -0300
commitf07571d79de1c00529136cd74c075ddfc4784b41 (patch)
treefe67b9879fe6e09d65bf36260b77185e7f2c6704 /webapp/components/user_settings
parent48f97a5a2a0754bfc0e639db7cce03943e990e32 (diff)
downloadchat-f07571d79de1c00529136cd74c075ddfc4784b41.tar.gz
chat-f07571d79de1c00529136cd74c075ddfc4784b41.tar.bz2
chat-f07571d79de1c00529136cd74c075ddfc4784b41.zip
PLT-3193 Add channel notification preferences for push notifications (#5512)
* PLT-3193 Add channel notification preferences for push and email notifications * Fixing UI * Removing email as preferences from the UI for now * move to action * fix client test
Diffstat (limited to 'webapp/components/user_settings')
-rw-r--r--webapp/components/user_settings/email_notification_setting.jsx26
1 files changed, 11 insertions, 15 deletions
diff --git a/webapp/components/user_settings/email_notification_setting.jsx b/webapp/components/user_settings/email_notification_setting.jsx
index a8319de29..457512507 100644
--- a/webapp/components/user_settings/email_notification_setting.jsx
+++ b/webapp/components/user_settings/email_notification_setting.jsx
@@ -13,10 +13,6 @@ import SettingItemMax from 'components/setting_item_max.jsx';
import {Preferences} from 'utils/constants.jsx';
-const INTERVAL_IMMEDIATE = 30; // "immediate" is a 30 second interval
-const INTERVAL_FIFTEEN_MINUTES = 15 * 60;
-const INTERVAL_HOUR = 60 * 60;
-
export default class EmailNotificationSetting extends React.Component {
static propTypes = {
activeSection: React.PropTypes.string.isRequired,
@@ -36,7 +32,7 @@ export default class EmailNotificationSetting extends React.Component {
this.collapse = this.collapse.bind(this);
this.state = {
- emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, INTERVAL_IMMEDIATE)
+ emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_IMMEDIATE)
};
}
@@ -66,7 +62,7 @@ export default class EmailNotificationSetting extends React.Component {
if (this.props.enableEmail) {
switch (this.state.emailInterval) {
- case INTERVAL_IMMEDIATE:
+ case Preferences.INTERVAL_IMMEDIATE:
description = (
<FormattedMessage
id='user.settings.notifications.email.immediately'
@@ -74,7 +70,7 @@ export default class EmailNotificationSetting extends React.Component {
/>
);
break;
- case INTERVAL_HOUR:
+ case Preferences.INTERVAL_HOUR:
description = (
<FormattedMessage
id='user.settings.notifications.email.everyHour'
@@ -119,13 +115,13 @@ export default class EmailNotificationSetting extends React.Component {
<input
type='radio'
name='emailNotifications'
- checked={this.props.enableEmail && this.state.emailInterval === INTERVAL_FIFTEEN_MINUTES}
- onChange={this.handleChange.bind(this, 'true', INTERVAL_FIFTEEN_MINUTES)}
+ checked={this.props.enableEmail && this.state.emailInterval === Preferences.INTERVAL_FIFTEEN_MINUTES}
+ onChange={this.handleChange.bind(this, 'true', Preferences.INTERVAL_FIFTEEN_MINUTES)}
/>
<FormattedMessage
id='user.settings.notifications.email.everyXMinutes'
defaultMessage='Every {count} minutes'
- values={{count: INTERVAL_FIFTEEN_MINUTES / 60}}
+ values={{count: Preferences.INTERVAL_FIFTEEN_MINUTES / 60}}
/>
</label>
</div>
@@ -134,8 +130,8 @@ export default class EmailNotificationSetting extends React.Component {
<input
type='radio'
name='emailNotifications'
- checked={this.props.enableEmail && this.state.emailInterval === INTERVAL_HOUR}
- onChange={this.handleChange.bind(this, 'true', INTERVAL_HOUR)}
+ checked={this.props.enableEmail && this.state.emailInterval === Preferences.INTERVAL_HOUR}
+ onChange={this.handleChange.bind(this, 'true', Preferences.INTERVAL_HOUR)}
/>
<FormattedMessage
id='user.settings.notifications.email.everyHour'
@@ -170,8 +166,8 @@ export default class EmailNotificationSetting extends React.Component {
<input
type='radio'
name='emailNotifications'
- checked={this.props.enableEmail && this.state.emailInterval === INTERVAL_IMMEDIATE}
- onChange={this.handleChange.bind(this, 'true', INTERVAL_IMMEDIATE)}
+ checked={this.props.enableEmail && this.state.emailInterval === Preferences.INTERVAL_IMMEDIATE}
+ onChange={this.handleChange.bind(this, 'true', Preferences.INTERVAL_IMMEDIATE)}
/>
<FormattedMessage
id='user.settings.notifications.email.immediately'
@@ -186,7 +182,7 @@ export default class EmailNotificationSetting extends React.Component {
type='radio'
name='emailNotifications'
checked={!this.props.enableEmail}
- onChange={this.handleChange.bind(this, 'false', INTERVAL_IMMEDIATE)}
+ onChange={this.handleChange.bind(this, 'false', Preferences.INTERVAL_IMMEDIATE)}
/>
<FormattedMessage
id='user.settings.notifications.email.never'