diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/admin_console/user_item.jsx | 2 | ||||
-rw-r--r-- | web/react/components/channel_header.jsx | 6 | ||||
-rw-r--r-- | web/react/components/create_comment.jsx | 2 | ||||
-rw-r--r-- | web/react/components/create_post.jsx | 6 | ||||
-rw-r--r-- | web/react/components/member_list_item.jsx | 6 | ||||
-rw-r--r-- | web/react/components/member_list_team_item.jsx | 4 | ||||
-rw-r--r-- | web/react/components/navbar.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_body.jsx | 14 | ||||
-rw-r--r-- | web/react/components/search_results_item.jsx | 7 | ||||
-rw-r--r-- | web/react/components/suggestion/emoticon_provider.jsx | 23 |
10 files changed, 47 insertions, 25 deletions
diff --git a/web/react/components/admin_console/user_item.jsx b/web/react/components/admin_console/user_item.jsx index bd64564c9..ef0b61460 100644 --- a/web/react/components/admin_console/user_item.jsx +++ b/web/react/components/admin_console/user_item.jsx @@ -227,7 +227,6 @@ export default class UserItem extends React.Component { href='#' className='dropdown-toggle theme' type='button' - id='channel_header_dropdown' data-toggle='dropdown' aria-expanded='true' > @@ -237,7 +236,6 @@ export default class UserItem extends React.Component { <ul className='dropdown-menu member-menu' role='menu' - aria-labelledby='channel_header_dropdown' > {makeAdmin} {makeMember} diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index d5a46721e..59ceb038e 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -101,9 +101,9 @@ export default class ChannelHeader extends React.Component { if (user.notify_props && user.notify_props.mention_keys) { const termKeys = UserStore.getCurrentMentionKeys(); - // if (user.notify_props.all === 'true' && termKeys.indexOf('@all') !== -1) { - // termKeys.splice(termKeys.indexOf('@all'), 1); - // } + if (user.notify_props.all === 'true' && termKeys.indexOf('@all') !== -1) { + termKeys.splice(termKeys.indexOf('@all'), 1); + } if (user.notify_props.channel === 'true' && termKeys.indexOf('@channel') !== -1) { termKeys.splice(termKeys.indexOf('@channel'), 1); diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index fac40e895..b0f33eda1 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -362,11 +362,11 @@ export default class CreateComment extends React.Component { onClick={this.handleSubmit} /> {uploadsInProgressText} + {preview} {postError} {serverError} </div> </div> - {preview} </form> ); } diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index f7f63fb92..89e984e27 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -470,13 +470,13 @@ export default class CreatePost extends React.Component { {tutorialTip} </div> <div className={postFooterClassName}> - {postError} - {serverError} - {preview} <MsgTyping channelId={this.state.channelId} parentId='' /> + {preview} + {postError} + {serverError} </div> </div> </form> diff --git a/web/react/components/member_list_item.jsx b/web/react/components/member_list_item.jsx index f7f77f48a..a7273f280 100644 --- a/web/react/components/member_list_item.jsx +++ b/web/react/components/member_list_item.jsx @@ -78,17 +78,15 @@ export default class MemberListItem extends React.Component { href='#' className='dropdown-toggle theme' type='button' - id='channel_header_dropdown' data-toggle='dropdown' aria-expanded='true' > + <span className='fa fa-pencil'></span> <span className='text-capitalize'>{member.roles || 'Member'} </span> - <span className='caret'></span> </a> <ul className='dropdown-menu member-menu' role='menu' - aria-labelledby='channel_header_dropdown' > {makeAdminOption} {handleRemoveOption} @@ -96,7 +94,7 @@ export default class MemberListItem extends React.Component { </div> ); } else { - invite = <div className='member-role text-capitalize'>{member.roles || 'Member'}<span className='caret hidden'></span></div>; + invite = <div className='member-role text-capitalize'><span className='fa fa-pencil hidden'></span>{member.roles || 'Member'}</div>; } return ( diff --git a/web/react/components/member_list_team_item.jsx b/web/react/components/member_list_team_item.jsx index 316fad01a..7967c410d 100644 --- a/web/react/components/member_list_team_item.jsx +++ b/web/react/components/member_list_team_item.jsx @@ -181,17 +181,15 @@ export default class MemberListTeamItem extends React.Component { href='#' className='dropdown-toggle theme' type='button' - id='channel_header_dropdown' data-toggle='dropdown' aria-expanded='true' > + <span className='fa fa-pencil'></span> <span>{currentRoles} </span> - <span className='caret'></span> </a> <ul className='dropdown-menu member-menu' role='menu' - aria-labelledby='channel_header_dropdown' > {makeAdmin} {makeMember} diff --git a/web/react/components/navbar.jsx b/web/react/components/navbar.jsx index 3bdc9efac..ae14fca2f 100644 --- a/web/react/components/navbar.jsx +++ b/web/react/components/navbar.jsx @@ -272,7 +272,6 @@ export default class Navbar extends React.Component { href='#' className='dropdown-toggle theme' type='button' - id='channel_header_dropdown' data-toggle='dropdown' aria-expanded='true' > @@ -282,7 +281,6 @@ export default class Navbar extends React.Component { <ul className='dropdown-menu' role='menu' - aria-labelledby='channel_header_dropdown' > {viewInfoOption} {addMembersOption} diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 296b9e7d7..35a7727e9 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -309,7 +309,15 @@ export default class PostBody extends React.Component { let apostrophe = ''; let name = '...'; if (profile != null) { - if (profile.username.slice(-1) === 's') { + let username = profile.username; + if (parentPost.props && + parentPost.props.from_webhook && + parentPost.props.override_username && + global.window.mm_config.EnablePostUsernameOverride === 'true') { + username = parentPost.props.override_username; + } + + if (username.slice(-1) === 's') { apostrophe = '\''; } else { apostrophe = '\'s'; @@ -317,9 +325,9 @@ export default class PostBody extends React.Component { name = ( <a className='theme' - onClick={Utils.searchForTerm.bind(null, profile.username)} + onClick={Utils.searchForTerm.bind(null, username)} > - {profile.username} + {username} </a> ); } diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx index 1d4983026..cd8359df5 100644 --- a/web/react/components/search_results_item.jsx +++ b/web/react/components/search_results_item.jsx @@ -19,6 +19,11 @@ export default class SearchResultsItem extends React.Component { e.preventDefault(); EventHelpers.emitPostFocusEvent(this.props.post.id); + + if ($(window).width() < 768) { + $('.sidebar--right').removeClass('move--left'); + $('.inner__wrap').removeClass('move--left'); + } } render() { @@ -65,7 +70,7 @@ export default class SearchResultsItem extends React.Component { className='search-item__jump' onClick={this.handleClick} > - {<i className='fa fa-mail-reply'></i>} + {'Jump'} </a> </li> </ul> diff --git a/web/react/components/suggestion/emoticon_provider.jsx b/web/react/components/suggestion/emoticon_provider.jsx index 7dcb86442..fd470cf21 100644 --- a/web/react/components/suggestion/emoticon_provider.jsx +++ b/web/react/components/suggestion/emoticon_provider.jsx @@ -51,23 +51,40 @@ export default class EmoticonProvider { const text = captured[1]; const partialName = captured[2]; - const terms = []; const names = []; for (const emoticon of Emoticons.emoticonMap.keys()) { if (emoticon.indexOf(partialName) !== -1) { - terms.push(':' + emoticon + ':'); names.push(emoticon); - if (terms.length >= MAX_EMOTICON_SUGGESTIONS) { + if (names.length >= MAX_EMOTICON_SUGGESTIONS) { break; } } } + // sort the emoticons so that emoticons starting with the entered text come first + names.sort((a, b) => { + const aPrefix = a.startsWith(partialName); + const bPrefix = b.startsWith(partialName); + + if (aPrefix === bPrefix) { + return a.localeCompare(b); + } else if (aPrefix) { + return -1; + } + + return 1; + }); + + const terms = names.map((name) => ':' + name + ':'); + if (terms.length > 0) { SuggestionStore.setMatchedPretext(suggestionId, text); SuggestionStore.addSuggestions(suggestionId, terms, names, EmoticonSuggestion); + + // force the selection to be cleared since the order of elements may have changed + SuggestionStore.clearSelection(suggestionId); } } } |