Enabled and added help text for settings items
Этот коммит содержится в:
коммит произвёл
nickago
родитель
e1c09605dc
Коммит
28381e1de6
@@ -5,6 +5,7 @@ module.exports = React.createClass({
|
|||||||
render: function() {
|
render: function() {
|
||||||
var clientError = this.props.client_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.client_error }</label></div> : null;
|
var clientError = this.props.client_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.client_error }</label></div> : null;
|
||||||
var server_error = this.props.server_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.server_error }</label></div> : null;
|
var server_error = this.props.server_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.server_error }</label></div> : null;
|
||||||
|
var extraInfo = this.props.extraInfo ? this.props.extraInfo : null;
|
||||||
|
|
||||||
var inputs = this.props.inputs;
|
var inputs = this.props.inputs;
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ module.exports = React.createClass({
|
|||||||
<ul className="setting-list">
|
<ul className="setting-list">
|
||||||
<li className="setting-list-item">
|
<li className="setting-list-item">
|
||||||
{inputs}
|
{inputs}
|
||||||
|
{extraInfo}
|
||||||
</li>
|
</li>
|
||||||
<li className="setting-list-item">
|
<li className="setting-list-item">
|
||||||
<hr />
|
<hr />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
|
var ChannelStore = require('../stores/channel_store.jsx');
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
var UserStore = require('../stores/user_store.jsx');
|
||||||
var SettingItemMin = require('./setting_item_min.jsx');
|
var SettingItemMin = require('./setting_item_min.jsx');
|
||||||
var SettingItemMax = require('./setting_item_max.jsx');
|
var SettingItemMax = require('./setting_item_max.jsx');
|
||||||
@@ -67,7 +68,11 @@ function getNotificationsStateFromStores() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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};
|
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};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class NotificationsTab extends React.Component {
|
export default class NotificationsTab extends React.Component {
|
||||||
@@ -141,10 +146,12 @@ export default class NotificationsTab extends React.Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.addChangeListener(this.onListenerChange);
|
UserStore.addChangeListener(this.onListenerChange);
|
||||||
|
ChannelStore.addChangeListener(this.onListenerChange);
|
||||||
$('#user_settings').on('hidden.bs.modal', this.handleClose);
|
$('#user_settings').on('hidden.bs.modal', this.handleClose);
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
UserStore.removeChangeListener(this.onListenerChange);
|
UserStore.removeChangeListener(this.onListenerChange);
|
||||||
|
ChannelStore.removeChangeListener(this.onListenerChange);
|
||||||
$('#user_settings').off('hidden.bs.modal', this.handleClose);
|
$('#user_settings').off('hidden.bs.modal', this.handleClose);
|
||||||
this.props.updateSection('');
|
this.props.updateSection('');
|
||||||
}
|
}
|
||||||
@@ -265,6 +272,12 @@ export default class NotificationsTab extends React.Component {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 = (
|
desktopSection = (
|
||||||
<SettingItemMax
|
<SettingItemMax
|
||||||
title='Send desktop notifications'
|
title='Send desktop notifications'
|
||||||
@@ -272,6 +285,7 @@ export default class NotificationsTab extends React.Component {
|
|||||||
submit={this.handleSubmit}
|
submit={this.handleSubmit}
|
||||||
server_error={serverError}
|
server_error={serverError}
|
||||||
updateSection={handleUpdateDesktopSection}
|
updateSection={handleUpdateDesktopSection}
|
||||||
|
extraInfo={extraInfo}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -270,4 +270,5 @@ ChannelStore.dispatchToken = AppDispatcher.register(function(payload) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ChannelStore.setMaxListeners(11);
|
||||||
module.exports = ChannelStore;
|
module.exports = ChannelStore;
|
||||||
|
|||||||
@@ -94,6 +94,11 @@
|
|||||||
list-style-type:none;
|
list-style-type:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.setting-list__hint {
|
||||||
|
color: #555;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.mentions-input {
|
.mentions-input {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user