summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/channel_invite_modal.jsx2
-rw-r--r--web/react/components/edit_channel_modal.jsx7
-rw-r--r--web/react/components/edit_post_modal.jsx7
-rw-r--r--web/react/components/new_channel.jsx4
-rw-r--r--web/react/components/post.jsx5
-rw-r--r--web/react/components/post_info.jsx1
-rw-r--r--web/react/components/post_right.jsx4
-rw-r--r--web/react/components/rename_channel_modal.jsx17
-rw-r--r--web/react/components/team_signup_send_invites_page.jsx17
9 files changed, 46 insertions, 18 deletions
diff --git a/web/react/components/channel_invite_modal.jsx b/web/react/components/channel_invite_modal.jsx
index e446167ec..b70811db1 100644
--- a/web/react/components/channel_invite_modal.jsx
+++ b/web/react/components/channel_invite_modal.jsx
@@ -138,7 +138,7 @@ export default class ChannelInviteModal extends React.Component {
<div className='modal-content'>
<div className='modal-header'>
<button type='button' className='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
- <h4 className='modal-title'>Add New Members to <span className='name'>{this.state.channel_name}</span></h4>
+ <h4 className='modal-title'>Add New Members to <span className='name'>{this.state.channelName}</span></h4>
</div>
<div className='modal-body'>
{inviteError}
diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx
index 1a633b193..76f0c2c4d 100644
--- a/web/react/components/edit_channel_modal.jsx
+++ b/web/react/components/edit_channel_modal.jsx
@@ -50,13 +50,18 @@ module.exports = React.createClass({
render: function() {
var server_error = this.state.server_error ? <div className='form-group has-error'><br/><label className='control-label'>{ this.state.server_error }</label></div> : null;
+ var editTitle = <h4 className='modal-title' ref='title'>Edit Description</h4>;
+ if (this.state.title) {
+ editTitle = <h4 className='modal-title' ref='title'>Edit Description for <span className='name'>{this.state.title}</span></h4>;
+ }
+
return (
<div className="modal fade" ref="modal" id="edit_channel" role="dialog" tabIndex="-1" aria-hidden="true">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">
<button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
- <h4 className="modal-title" ref="title">Edit Description for {this.state.title}</h4>
+ {editTitle}
</div>
<div className="modal-body">
<textarea className="form-control no-resize" rows="6" ref="channelDesc" maxLength="1024" value={this.state.description} onChange={this.handleUserInput}></textarea>
diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx
index 064d3fa94..2d865a45d 100644
--- a/web/react/components/edit_post_modal.jsx
+++ b/web/react/components/edit_post_modal.jsx
@@ -34,6 +34,7 @@ module.exports = React.createClass({
);
$("#edit_post").modal('hide');
+ $(this.state.refocusId).focus();
},
handleEditInput: function(editText) {
this.setState({ editText: editText });
@@ -52,12 +53,12 @@ module.exports = React.createClass({
var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
- self.setState({ editText: "", title: "", channel_id: "", post_id: "", comments: 0 });
+ self.setState({ editText: "", title: "", channel_id: "", post_id: "", comments: 0, refocusId: "" });
});
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) {
var button = e.relatedTarget;
- self.setState({ editText: $(button).attr('data-message'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), post_id: $(button).attr('data-postid'), comments: $(button).attr('data-comments') });
+ self.setState({ editText: $(button).attr('data-message'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), post_id: $(button).attr('data-postid'), comments: $(button).attr('data-comments'), refocusId: $(button).attr('data-refoucsid') });
});
$(this.refs.modal.getDOMNode()).on('shown.bs.modal', function(e) {
@@ -65,7 +66,7 @@ module.exports = React.createClass({
});
},
getInitialState: function() {
- return { editText: "", title: "", post_id: "", channel_id: "", comments: 0 };
+ return { editText: "", title: "", post_id: "", channel_id: "", comments: 0, refocusId: "" };
},
render: function() {
var error = this.state.error ? <div className='form-group has-error'><label className='control-label'>{ this.state.error }</label></div> : null;
diff --git a/web/react/components/new_channel.jsx b/web/react/components/new_channel.jsx
index b00376758..38c9ea76d 100644
--- a/web/react/components/new_channel.jsx
+++ b/web/react/components/new_channel.jsx
@@ -127,12 +127,12 @@ module.exports = React.createClass({
<div className='modal-body'>
<div className={displayNameClass}>
<label className='control-label'>Display Name</label>
- <input onKeyUp={this.displayNameKeyUp} type='text' ref='display_name' className='form-control' placeholder='Enter display name' maxLength='64' />
+ <input onKeyUp={this.displayNameKeyUp} type='text' ref='display_name' className='form-control' placeholder='Enter display name' maxLength='22' />
{displayNameError}
</div>
<div className={nameClass}>
<label className='control-label'>Handle</label>
- <input type='text' className='form-control' ref='channel_name' placeholder="lowercase alphanumeric's only" maxLength='64' />
+ <input type='text' className='form-control' ref='channel_name' placeholder="lowercase alphanumeric's only" maxLength='22' />
{nameError}
</div>
<div className='form-group'>
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index 7bc6a8c01..cc2e37fa8 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -102,7 +102,12 @@ module.exports = React.createClass({
currentUserCss = "current--user";
}
+ var userProfile = UserStore.getProfile(post.user_id);
+
var timestamp = UserStore.getCurrentUser().update_at;
+ if (userProfile) {
+ timestamp = userProfile.update_at;
+ }
return (
<div>
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index c96a04c7c..73e897f62 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -49,6 +49,7 @@ export default class PostInfo extends React.Component {
role='menuitem'
data-toggle='modal'
data-target='#edit_post'
+ data-refoucsid="#post_textbox"
data-title={type}
data-message={post.message}
data-postid={post.id}
diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index c8c51b0c3..ac4c8a6d7 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -93,7 +93,7 @@ RootPost = React.createClass({
<div>
<a href='#' className='dropdown-toggle theme' type='button' data-toggle='dropdown' aria-expanded='false' />
<ul className='dropdown-menu' role='menu'>
- <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li>
+ <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-refoucsid='#reply_textbox' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li>
<li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#delete_post' data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={this.props.commentCount}>Delete</a></li>
</ul>
</div>
@@ -203,7 +203,7 @@ CommentPost = React.createClass({
<div className='dropdown' onClick={function(e){$('.post-list-holder-by-time').scrollTop($('.post-list-holder-by-time').scrollTop() + 50);}}>
<a href='#' className='dropdown-toggle theme' type='button' data-toggle='dropdown' aria-expanded='false' />
<ul className='dropdown-menu' role='menu'>
- <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li>
+ <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-refoucsid='#reply_textbox' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li>
<li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#delete_post' data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={0}>Delete</a></li>
</ul>
</div>
diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx
index 93cb6ef21..2fe6dd96b 100644
--- a/web/react/components/rename_channel_modal.jsx
+++ b/web/react/components/rename_channel_modal.jsx
@@ -125,8 +125,8 @@ module.exports = React.createClass({
</button>
<h4 className="modal-title">Rename Channel</h4>
</div>
- <div className="modal-body">
- <form role="form">
+ <form role="form">
+ <div className="modal-body">
<div className={ this.state.display_name_error ? "form-group has-error" : "form-group" }>
<label className='control-label'>Display Name</label>
<input onKeyUp={this.displayNameKeyUp} onChange={this.onDisplayNameChange} type="text" ref="display_name" className="form-control" placeholder="Enter display name" value={this.state.display_name} maxLength="64" />
@@ -138,16 +138,15 @@ module.exports = React.createClass({
{ name_error }
</div>
{ server_error }
- </form>
- </div>
- <div className="modal-footer">
- <button type="button" className="btn btn-default" data-dismiss="modal">Cancel</button>
- <button onClick={this.handleSubmit} type="button" className="btn btn-primary">Save</button>
- </div>
+ </div>
+ <div className="modal-footer">
+ <button type="button" className="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button onClick={this.handleSubmit} type="submit" className="btn btn-primary">Save</button>
+ </div>
+ </form>
</div>
</div>
</div>
);
}
});
-
diff --git a/web/react/components/team_signup_send_invites_page.jsx b/web/react/components/team_signup_send_invites_page.jsx
index a1e12661e..646a742ba 100644
--- a/web/react/components/team_signup_send_invites_page.jsx
+++ b/web/react/components/team_signup_send_invites_page.jsx
@@ -13,6 +13,7 @@ export default class TeamSignupSendInvitesPage extends React.Component {
this.submitNext = this.submitNext.bind(this);
this.submitAddInvite = this.submitAddInvite.bind(this);
this.submitSkip = this.submitSkip.bind(this);
+ this.keySubmit = this.keySubmit.bind(this);
this.state = {
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
};
@@ -68,12 +69,28 @@ export default class TeamSignupSendInvitesPage extends React.Component {
this.props.state.wizard = 'username';
this.props.updateParent(this.props.state);
}
+ keySubmit(e) {
+ if (e && e.keyCode === 13) {
+ this.submitNext(e)
+ }
+ }
componentWillMount() {
if (!this.state.emailEnabled) {
this.props.state.wizard = 'username';
this.props.updateParent(this.props.state);
}
}
+ componentDidMount() {
+ if (!this.state.emailEnabled) {
+ // Must use keypress not keyup due to event chain of pressing enter
+ $('body').keypress(this.keySubmit);
+ }
+ }
+ componentWillUnmount() {
+ if (!this.state.emailEnabled) {
+ $('body').off('keypress', this.keySubmit);
+ }
+ }
render() {
client.track('signup', 'signup_team_05_send_invites');