summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-03 15:30:32 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-03 15:30:32 -0400
commit2a62b00d76f4de921fbebc321f0c0debd30d41d6 (patch)
treec9446d661f4d0f63bcd42ca0b4ee0606cfc4722b /web
parente69e2db6b4724517a39c57e3689dec82608581ee (diff)
parent32eab0e7045889af5d567e9db1a847eb65f517d1 (diff)
downloadchat-2a62b00d76f4de921fbebc321f0c0debd30d41d6.tar.gz
chat-2a62b00d76f4de921fbebc321f0c0debd30d41d6.tar.bz2
chat-2a62b00d76f4de921fbebc321f0c0debd30d41d6.zip
Merge pull request #587 from nickago/MM-1899
MM-1899 Added help text to channel notifications
Diffstat (limited to 'web')
-rw-r--r--web/react/components/channel_notifications.jsx8
-rw-r--r--web/react/components/setting_item_max.jsx2
-rw-r--r--web/react/components/user_settings_notifications.jsx14
3 files changed, 10 insertions, 14 deletions
diff --git a/web/react/components/channel_notifications.jsx b/web/react/components/channel_notifications.jsx
index 173646597..83067240d 100644
--- a/web/react/components/channel_notifications.jsx
+++ b/web/react/components/channel_notifications.jsx
@@ -162,6 +162,13 @@ export default class ChannelNotifications extends React.Component {
e.preventDefault();
}.bind(this);
+ let curChannel = ChannelStore.get(this.state.channelId);
+ let extraInfo = (<span>These settings will override the global notification settings</span>);
+
+ if (curChannel && curChannel.display_name) {
+ extraInfo = (<span>These settings will override the global notification settings for the <b>{curChannel.display_name}</b> channel</span>);
+ }
+
return (
<SettingItemMax
title='Send desktop notifications'
@@ -169,6 +176,7 @@ export default class ChannelNotifications extends React.Component {
submit={this.handleUpdate}
server_error={serverError}
updateSection={handleUpdateSection}
+ extraInfo={extraInfo}
/>
);
}
diff --git a/web/react/components/setting_item_max.jsx b/web/react/components/setting_item_max.jsx
index e67e458af..996b63873 100644
--- a/web/react/components/setting_item_max.jsx
+++ b/web/react/components/setting_item_max.jsx
@@ -15,7 +15,7 @@ export default class SettingItemMax extends React.Component {
var extraInfo = null;
if (this.props.extraInfo) {
- extraInfo = this.props.extraInfo;
+ extraInfo = (<div className='setting-list__hint'>{this.props.extraInfo}</div>);
}
var submit = '';
diff --git a/web/react/components/user_settings_notifications.jsx b/web/react/components/user_settings_notifications.jsx
index 5fe6bbb4e..33db1a332 100644
--- a/web/react/components/user_settings_notifications.jsx
+++ b/web/react/components/user_settings_notifications.jsx
@@ -1,7 +1,6 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
-var ChannelStore = require('../stores/channel_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var SettingItemMin = require('./setting_item_min.jsx');
var SettingItemMax = require('./setting_item_max.jsx');
@@ -69,11 +68,9 @@ function getNotificationsStateFromStores() {
}
}
- var curChannel = ChannelStore.getCurrent().display_name;
-
return {notifyLevel: desktop, enableEmail: email, soundNeeded: soundNeeded, enableSound: sound,
usernameKey: usernameKey, mentionKey: mentionKey, customKeys: customKeys, customKeysChecked: customKeys.length > 0,
- firstNameKey: firstNameKey, allKey: allKey, channelKey: channelKey, curChannel: curChannel};
+ firstNameKey: firstNameKey, allKey: allKey, channelKey: channelKey};
}
export default class NotificationsTab extends React.Component {
@@ -147,12 +144,10 @@ export default class NotificationsTab extends React.Component {
}
componentDidMount() {
UserStore.addChangeListener(this.onListenerChange);
- ChannelStore.addChangeListener(this.onListenerChange);
$('#user_settings').on('hidden.bs.modal', this.handleClose);
}
componentWillUnmount() {
UserStore.removeChangeListener(this.onListenerChange);
- ChannelStore.removeChangeListener(this.onListenerChange);
$('#user_settings').off('hidden.bs.modal', this.handleClose);
this.props.updateSection('');
}
@@ -271,12 +266,6 @@ export default class NotificationsTab extends React.Component {
e.preventDefault();
}.bind(this);
- let extraInfo = (
- <div className='setting-list__hint'>
- These settings will override the global notification settings for the <b>{this.state.curChannel}</b> channel
- </div>
- );
-
desktopSection = (
<SettingItemMax
title='Send desktop notifications'
@@ -284,7 +273,6 @@ export default class NotificationsTab extends React.Component {
submit={this.handleSubmit}
server_error={serverError}
updateSection={handleUpdateDesktopSection}
- extraInfo={extraInfo}
/>
);
} else {