Upgrading ESLint and adding some more rules. Refactoring to meet these new rules
Этот коммит содержится в:
@@ -34,27 +34,27 @@ export default class CommandList extends React.Component {
|
||||
|
||||
return (
|
||||
<div
|
||||
className='modal fade'
|
||||
ref='modal'
|
||||
id='channel_info'
|
||||
tabIndex='-1'
|
||||
role='dialog'
|
||||
aria-hidden='true'
|
||||
className='modal fade'
|
||||
ref='modal'
|
||||
id='channel_info'
|
||||
tabIndex='-1'
|
||||
role='dialog'
|
||||
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'
|
||||
type='button'
|
||||
className='close'
|
||||
data-dismiss='modal'
|
||||
aria-label='Close'
|
||||
>
|
||||
<span aria-hidden='true'>×</span>
|
||||
</button>
|
||||
<h4
|
||||
className='modal-title'
|
||||
id='myModalLabel'
|
||||
className='modal-title'
|
||||
id='myModalLabel'
|
||||
>
|
||||
<span className='name'>{channel.display_name}</span>
|
||||
</h4>
|
||||
@@ -75,9 +75,9 @@ export default class CommandList extends React.Component {
|
||||
</div>
|
||||
<div className='modal-footer'>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
data-dismiss='modal'
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
data-dismiss='modal'
|
||||
>Close</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -146,8 +146,8 @@ export default class ChannelInviteModal extends React.Component {
|
||||
aria-hidden='true'
|
||||
>
|
||||
<div
|
||||
className='modal-dialog'
|
||||
role='document'
|
||||
className='modal-dialog'
|
||||
role='document'
|
||||
>
|
||||
<div className='modal-content'>
|
||||
<div className='modal-header'>
|
||||
|
||||
@@ -296,7 +296,8 @@ export default class CreatePost extends React.Component {
|
||||
<FilePreview
|
||||
files={this.state.previews}
|
||||
onRemove={this.removePreview}
|
||||
uploadsInProgress={this.state.uploadsInProgress} />
|
||||
uploadsInProgress={this.state.uploadsInProgress}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -321,7 +322,8 @@ export default class CreatePost extends React.Component {
|
||||
createMessage='Write a message...'
|
||||
channelId={this.state.channelId}
|
||||
id='post_textbox'
|
||||
ref='textbox' />
|
||||
ref='textbox'
|
||||
/>
|
||||
<FileUpload
|
||||
ref='fileUpload'
|
||||
getFileCount={this.getFileCount}
|
||||
@@ -329,7 +331,8 @@ export default class CreatePost extends React.Component {
|
||||
onFileUpload={this.handleFileUploadComplete}
|
||||
onUploadError={this.handleUploadError}
|
||||
postType='post'
|
||||
channelId='' />
|
||||
channelId=''
|
||||
/>
|
||||
</div>
|
||||
<div className={postFooterClassName}>
|
||||
{postError}
|
||||
|
||||
@@ -88,7 +88,8 @@ export default class EditPostModal extends React.Component {
|
||||
id='edit_post'
|
||||
role='dialog'
|
||||
tabIndex='-1'
|
||||
aria-hidden='true' >
|
||||
aria-hidden='true'
|
||||
>
|
||||
<div className='modal-dialog modal-push-down'>
|
||||
<div className='modal-content'>
|
||||
<div className='modal-header'>
|
||||
@@ -97,7 +98,8 @@ export default class EditPostModal extends React.Component {
|
||||
className='close'
|
||||
data-dismiss='modal'
|
||||
aria-label='Close'
|
||||
onClick={this.handleEditClose}>
|
||||
onClick={this.handleEditClose}
|
||||
>
|
||||
<span aria-hidden='true'>×</span>
|
||||
</button>
|
||||
<h4 className='modal-title'>Edit {this.state.title}</h4>
|
||||
@@ -110,20 +112,22 @@ export default class EditPostModal extends React.Component {
|
||||
createMessage='Edit the post...'
|
||||
id='edit_textbox'
|
||||
ref='editbox'
|
||||
/>
|
||||
/>
|
||||
{error}
|
||||
</div>
|
||||
<div className='modal-footer'>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
data-dismiss='modal' >
|
||||
data-dismiss='modal'
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-primary'
|
||||
onClick={this.handleEdit}>
|
||||
onClick={this.handleEdit}
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -24,12 +24,14 @@ export default class EmailVerify extends React.Component {
|
||||
} else {
|
||||
title = config.SiteName + ' Email Not Verified';
|
||||
body = <p>Please verify your email address. Check your inbox for an email.</p>;
|
||||
resend = (<button
|
||||
onClick={this.handleResend}
|
||||
className='btn btn-primary'
|
||||
>
|
||||
Resend Email
|
||||
</button>);
|
||||
resend = (
|
||||
<button
|
||||
onClick={this.handleResend}
|
||||
className='btn btn-primary'
|
||||
>
|
||||
Resend Email
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -69,7 +69,8 @@ export default class ErrorBar extends React.Component {
|
||||
<a
|
||||
href='#'
|
||||
className='error-bar__close'
|
||||
onClick={this.handleClose}>
|
||||
onClick={this.handleClose}
|
||||
>
|
||||
×
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -101,10 +101,13 @@ export default class FileAttachment extends React.Component {
|
||||
|
||||
var thumbnail;
|
||||
if (type === 'image') {
|
||||
thumbnail = (<div
|
||||
ref={filename}
|
||||
className='post__load'
|
||||
style={{backgroundImage: 'url(/static/images/load.gif)'}} />);
|
||||
thumbnail = (
|
||||
<div
|
||||
ref={filename}
|
||||
className='post__load'
|
||||
style={{backgroundImage: 'url(/static/images/load.gif)'}}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
thumbnail = <div className={'file-icon ' + utils.getIconClassName(type)}/>;
|
||||
}
|
||||
@@ -135,20 +138,23 @@ export default class FileAttachment extends React.Component {
|
||||
return (
|
||||
<div
|
||||
className='post-image__column'
|
||||
key={filename}>
|
||||
key={filename}
|
||||
>
|
||||
<a className='post-image__thumbnail'
|
||||
href='#'
|
||||
onClick={this.props.handleImageClick}
|
||||
data-img-id={this.props.index}
|
||||
data-toggle='modal'
|
||||
data-target={'#' + this.props.modalId} >
|
||||
data-target={'#' + this.props.modalId}
|
||||
>
|
||||
{thumbnail}
|
||||
</a>
|
||||
<div className='post-image__details'>
|
||||
<div
|
||||
data-toggle='tooltip'
|
||||
title={filenameString}
|
||||
className='post-image__name' >
|
||||
className='post-image__name'
|
||||
>
|
||||
{trimmedFilename}
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -28,7 +28,8 @@ export default class FileAttachmentList extends React.Component {
|
||||
filename={filenames[i]}
|
||||
index={i}
|
||||
modalId={modalId}
|
||||
handleImageClick={this.handleImageClick} />
|
||||
handleImageClick={this.handleImageClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,7 +43,8 @@ export default class FileAttachmentList extends React.Component {
|
||||
userId={this.props.userId}
|
||||
modalId={modalId}
|
||||
startId={this.state.startImgId}
|
||||
filenames={filenames} />
|
||||
filenames={filenames}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,10 @@ export default class FindTeam extends React.Component {
|
||||
</div>
|
||||
<button
|
||||
className='btn btn-md btn-primary'
|
||||
type='submit'>Send</button>
|
||||
type='submit'
|
||||
>
|
||||
Send
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -23,14 +23,16 @@ export default class MemberList extends React.Component {
|
||||
return (
|
||||
<div className='member-list-holder'>
|
||||
{members.map(function mymembers(member) {
|
||||
return (<MemberListItem
|
||||
key={member.id}
|
||||
member={member}
|
||||
isAdmin={this.props.isAdmin}
|
||||
handleInvite={this.props.handleInvite}
|
||||
handleRemove={this.props.handleRemove}
|
||||
handleMakeAdmin={this.props.handleMakeAdmin}
|
||||
/>);
|
||||
return (
|
||||
<MemberListItem
|
||||
key={member.id}
|
||||
member={member}
|
||||
isAdmin={this.props.isAdmin}
|
||||
handleInvite={this.props.handleInvite}
|
||||
handleRemove={this.props.handleRemove}
|
||||
handleMakeAdmin={this.props.handleMakeAdmin}
|
||||
/>
|
||||
);
|
||||
}, this)}
|
||||
{message}
|
||||
</div>
|
||||
|
||||
@@ -36,8 +36,10 @@ export default class MemberListItem extends React.Component {
|
||||
invite = (
|
||||
<a
|
||||
onClick={this.handleInvite}
|
||||
className='btn btn-sm btn-primary member-invite'>
|
||||
<i className='glyphicon glyphicon-envelope'/> Add
|
||||
className='btn btn-sm btn-primary member-invite'
|
||||
>
|
||||
<i className='glyphicon glyphicon-envelope'/>
|
||||
{' Add'}
|
||||
</a>
|
||||
);
|
||||
} else if (isAdmin && !isMemberAdmin && (member.id !== UserStore.getCurrentId())) {
|
||||
@@ -50,7 +52,9 @@ export default class MemberListItem extends React.Component {
|
||||
<a
|
||||
href=''
|
||||
role='menuitem'
|
||||
onClick={self.handleMakeAdmin}>Make Admin
|
||||
onClick={self.handleMakeAdmin}
|
||||
>
|
||||
Make Admin
|
||||
</a>
|
||||
</li>);
|
||||
}
|
||||
@@ -62,7 +66,9 @@ export default class MemberListItem extends React.Component {
|
||||
<a
|
||||
href=''
|
||||
role='menuitem'
|
||||
onClick={self.handleRemove}>Remove Member
|
||||
onClick={self.handleRemove}
|
||||
>
|
||||
Remove Member
|
||||
</a>
|
||||
</li>);
|
||||
}
|
||||
@@ -75,14 +81,16 @@ export default class MemberListItem extends React.Component {
|
||||
type='button'
|
||||
id='channel_header_dropdown'
|
||||
data-toggle='dropdown'
|
||||
aria-expanded='true' >
|
||||
aria-expanded='true'
|
||||
>
|
||||
<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'>
|
||||
aria-labelledby='channel_header_dropdown'
|
||||
>
|
||||
{makeAdminOption}
|
||||
{handleRemoveOption}
|
||||
</ul>
|
||||
@@ -98,7 +106,8 @@ export default class MemberListItem extends React.Component {
|
||||
className='post-profile-img pull-left'
|
||||
src={'/api/v1/users/' + member.id + '/image?time=' + timestamp}
|
||||
height='36'
|
||||
width='36' />
|
||||
width='36'
|
||||
/>
|
||||
<span className='member-name'>{member.username}</span>
|
||||
<span className='member-email'>{member.email}</span>
|
||||
{invite}
|
||||
|
||||
@@ -19,11 +19,14 @@ export default class Mention extends React.Component {
|
||||
if (this.props.id === 'allmention' || this.props.id === 'channelmention') {
|
||||
icon = <span><i className='mention-img fa fa-users fa-2x'></i></span>;
|
||||
} else if (this.props.id != null) {
|
||||
icon = (<span><img
|
||||
className='mention-img'
|
||||
src={'/api/v1/users/' + this.props.id + '/image?time=' + timestamp}
|
||||
/>
|
||||
</span>);
|
||||
icon = (
|
||||
<span>
|
||||
<img
|
||||
className='mention-img'
|
||||
src={'/api/v1/users/' + this.props.id + '/image?time=' + timestamp}
|
||||
/>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
icon = <span><i className='mention-img fa fa-users fa-2x'></i></span>;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,8 @@ export default class MentionList extends React.Component {
|
||||
listId={index}
|
||||
isFocused={isFocused}
|
||||
handleMouseEnter={this.handleMouseEnter.bind(this, index)}
|
||||
handleClick={this.handleClick} />
|
||||
handleClick={this.handleClick}
|
||||
/>
|
||||
);
|
||||
index++;
|
||||
}
|
||||
@@ -240,11 +241,13 @@ export default class MentionList extends React.Component {
|
||||
return (
|
||||
<div
|
||||
className='mentions--top'
|
||||
style={style}>
|
||||
style={style}
|
||||
>
|
||||
<div
|
||||
ref='mentionlist'
|
||||
className='mentions-box'
|
||||
id='mentionsbox'>
|
||||
id='mentionsbox'
|
||||
>
|
||||
{mentions}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,15 +86,21 @@ export default class MoreChannels extends React.Component {
|
||||
{channels.map(function cMap(channel, index) {
|
||||
var joinButton;
|
||||
if (self.state.joiningChannel === index) {
|
||||
joinButton = (<img
|
||||
className='join-channel-loading-gif'
|
||||
src='/static/images/load.gif'
|
||||
/>);
|
||||
joinButton = (
|
||||
<img
|
||||
className='join-channel-loading-gif'
|
||||
src='/static/images/load.gif'
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
joinButton = (<button
|
||||
onClick={self.handleJoin.bind(self, channel, index)}
|
||||
className='btn btn-primary'>Join
|
||||
</button>);
|
||||
joinButton = (
|
||||
<button
|
||||
onClick={self.handleJoin.bind(self, channel, index)}
|
||||
className='btn btn-primary'
|
||||
>
|
||||
Join
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -152,7 +158,9 @@ export default class MoreChannels extends React.Component {
|
||||
data-channeltype={this.state.channelType}
|
||||
type='button'
|
||||
className='btn btn-primary channel-create-btn'
|
||||
onClick={this.handleNewChannel}>Create New Channel
|
||||
onClick={this.handleNewChannel}
|
||||
>
|
||||
Create New Channel
|
||||
</button>
|
||||
</div>
|
||||
<div className='modal-body'>
|
||||
|
||||
@@ -61,15 +61,17 @@ export default class NavbarDropdown extends React.Component {
|
||||
if (currentUser != null) {
|
||||
isAdmin = currentUser.roles.indexOf('admin') > -1;
|
||||
|
||||
inviteLink = (<li>
|
||||
<a
|
||||
href='#'
|
||||
data-toggle='modal'
|
||||
data-target='#invite_member'
|
||||
>
|
||||
Invite New Member
|
||||
</a>
|
||||
</li>);
|
||||
inviteLink = (
|
||||
<li>
|
||||
<a
|
||||
href='#'
|
||||
data-toggle='modal'
|
||||
data-target='#invite_member'
|
||||
>
|
||||
Invite New Member
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
|
||||
if (this.props.teamType === 'O') {
|
||||
teamLink = (
|
||||
@@ -89,15 +91,17 @@ export default class NavbarDropdown extends React.Component {
|
||||
}
|
||||
|
||||
if (isAdmin) {
|
||||
manageLink = (<li>
|
||||
<a
|
||||
href='#'
|
||||
data-toggle='modal'
|
||||
data-target='#team_members'
|
||||
>
|
||||
Manage Team
|
||||
</a>
|
||||
</li>);
|
||||
manageLink = (
|
||||
<li>
|
||||
<a
|
||||
href='#'
|
||||
data-toggle='modal'
|
||||
data-target='#team_members'
|
||||
>
|
||||
Manage Team
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
teamSettings = (<li>
|
||||
<a
|
||||
href='#'
|
||||
@@ -111,11 +115,13 @@ export default class NavbarDropdown extends React.Component {
|
||||
|
||||
var teams = [];
|
||||
|
||||
teams.push(<li
|
||||
className='divider'
|
||||
key='div'
|
||||
>
|
||||
</li>);
|
||||
teams.push(
|
||||
<li
|
||||
className='divider'
|
||||
key='div'
|
||||
>
|
||||
</li>
|
||||
);
|
||||
if (this.state.teams.length > 1 && this.state.currentTeam) {
|
||||
var curTeamName = this.state.currentTeam.name;
|
||||
this.state.teams.forEach(function listTeams(teamName) {
|
||||
|
||||
@@ -134,14 +134,16 @@ export default class NewChannelModal extends React.Component {
|
||||
ref='modal'
|
||||
tabIndex='-1'
|
||||
role='dialog'
|
||||
aria-hidden='true'>
|
||||
aria-hidden='true'
|
||||
>
|
||||
<div className='modal-dialog'>
|
||||
<div className='modal-content'>
|
||||
<div className='modal-header'>
|
||||
<button
|
||||
type='button'
|
||||
className='close'
|
||||
data-dismiss='modal'>
|
||||
data-dismiss='modal'
|
||||
>
|
||||
<span aria-hidden='true'>×</span>
|
||||
<span className='sr-only'>Cancel</span>
|
||||
</button>
|
||||
@@ -157,7 +159,8 @@ export default class NewChannelModal extends React.Component {
|
||||
ref='display_name'
|
||||
className='form-control'
|
||||
placeholder='Enter display name'
|
||||
maxLength='22' />
|
||||
maxLength='22'
|
||||
/>
|
||||
{displayNameError}
|
||||
</div>
|
||||
<div className={nameClass}>
|
||||
@@ -167,7 +170,8 @@ export default class NewChannelModal extends React.Component {
|
||||
className='form-control'
|
||||
ref='channel_name'
|
||||
placeholder="lowercase alphanumeric's only"
|
||||
maxLength='22' />
|
||||
maxLength='22'
|
||||
/>
|
||||
{nameError}
|
||||
</div>
|
||||
<div className='form-group'>
|
||||
@@ -177,7 +181,8 @@ export default class NewChannelModal extends React.Component {
|
||||
ref='channel_desc'
|
||||
rows='3'
|
||||
placeholder='Description'
|
||||
maxLength='1024' />
|
||||
maxLength='1024'
|
||||
/>
|
||||
</div>
|
||||
{serverError}
|
||||
</div>
|
||||
@@ -185,13 +190,15 @@ export default class NewChannelModal extends React.Component {
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
data-dismiss='modal' >
|
||||
data-dismiss='modal'
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
onClick={this.handleSubmit}
|
||||
type='submit'
|
||||
className='btn btn-primary' >
|
||||
className='btn btn-primary'
|
||||
>
|
||||
Create New {channelTerm}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,8 @@ export default class Post extends React.Component {
|
||||
className='post-profile-img'
|
||||
src={'/api/v1/users/' + post.user_id + '/image?time=' + timestamp}
|
||||
height='36'
|
||||
width='36' />
|
||||
width='36'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -152,7 +153,8 @@ export default class Post extends React.Component {
|
||||
<div>
|
||||
<div
|
||||
id={post.id}
|
||||
className={'post ' + sameUserClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss} >
|
||||
className={'post ' + sameUserClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss}
|
||||
>
|
||||
{profilePic}
|
||||
<div className='post__content'>
|
||||
<PostHeader
|
||||
@@ -161,21 +163,24 @@ export default class Post extends React.Component {
|
||||
sameRoot={this.props.sameRoot}
|
||||
commentCount={commentCount}
|
||||
handleCommentClick={this.handleCommentClick}
|
||||
isLastComment={this.props.isLastComment} />
|
||||
isLastComment={this.props.isLastComment}
|
||||
/>
|
||||
<PostBody
|
||||
post={post}
|
||||
sameRoot={this.props.sameRoot}
|
||||
parentPost={parentPost}
|
||||
posts={posts}
|
||||
handleCommentClick={this.handleCommentClick}
|
||||
retryPost={this.retryPost} />
|
||||
retryPost={this.retryPost}
|
||||
/>
|
||||
<PostInfo
|
||||
ref='info'
|
||||
post={post}
|
||||
sameRoot={this.props.sameRoot}
|
||||
commentCount={commentCount}
|
||||
handleCommentClick={this.handleCommentClick}
|
||||
allowReply='true' />
|
||||
allowReply='true'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -559,7 +559,7 @@ export default class PostList extends React.Component {
|
||||
>
|
||||
<hr
|
||||
className='separator__hr'
|
||||
/>
|
||||
/>
|
||||
<div className='separator__text'>New Messages</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -161,7 +161,8 @@ export default class RhsComment extends React.Component {
|
||||
filenames={post.filenames}
|
||||
modalId={'rhs_comment_view_image_modal_' + post.id}
|
||||
channelId={post.channel_id}
|
||||
userId={post.user_id} />
|
||||
userId={post.user_id}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,8 @@ export default class RhsRootPost extends React.Component {
|
||||
filenames={post.filenames}
|
||||
modalId={'rhs_view_image_modal_' + post.id}
|
||||
channelId={post.channel_id}
|
||||
userId={post.user_id} />
|
||||
userId={post.user_id}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,8 +173,7 @@ export default class RhsThread extends React.Component {
|
||||
|
||||
return (
|
||||
<div className='post-right__container'>
|
||||
<FileUploadOverlay
|
||||
overlayType='right' />
|
||||
<FileUploadOverlay overlayType='right' />
|
||||
<div className='search-bar__container sidebar--right__search-header'>{searchForm}</div>
|
||||
<div className='sidebar-right__body'>
|
||||
<RhsHeaderPost
|
||||
|
||||
@@ -116,19 +116,22 @@ export default class SearchBar extends React.Component {
|
||||
<div>
|
||||
<div
|
||||
className='sidebar__collapse'
|
||||
onClick={this.handleClose} >
|
||||
onClick={this.handleClose}
|
||||
>
|
||||
<span className='fa fa-angle-left'></span>
|
||||
</div>
|
||||
<span
|
||||
className='search__clear'
|
||||
onClick={this.clearFocus}>
|
||||
onClick={this.clearFocus}
|
||||
>
|
||||
Cancel
|
||||
</span>
|
||||
<form
|
||||
role='form'
|
||||
className='search__form relative-div'
|
||||
onSubmit={this.handleSubmit}>
|
||||
<span className='glyphicon glyphicon-search sidebar__search-icon'></span>
|
||||
onSubmit={this.handleSubmit}
|
||||
>
|
||||
<span className='glyphicon glyphicon-search sidebar__search-icon' />
|
||||
<input
|
||||
type='text'
|
||||
ref='search'
|
||||
@@ -136,7 +139,8 @@ export default class SearchBar extends React.Component {
|
||||
placeholder='Search'
|
||||
value={this.state.searchTerm}
|
||||
onFocus={this.handleUserFocus}
|
||||
onChange={this.handleUserInput} />
|
||||
onChange={this.handleUserInput}
|
||||
/>
|
||||
{isSearching}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -20,11 +20,15 @@ export default class SettingItemMax extends React.Component {
|
||||
|
||||
var submit = '';
|
||||
if (this.props.submit) {
|
||||
submit = (<a
|
||||
className='btn btn-sm btn-primary'
|
||||
href='#'
|
||||
onClick={this.props.submit}>
|
||||
Submit</a>);
|
||||
submit = (
|
||||
<a
|
||||
className='btn btn-sm btn-primary'
|
||||
href='#'
|
||||
onClick={this.props.submit}
|
||||
>
|
||||
Submit
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
var inputs = this.props.inputs;
|
||||
@@ -46,7 +50,8 @@ export default class SettingItemMax extends React.Component {
|
||||
<a
|
||||
className='btn btn-sm theme'
|
||||
href='#'
|
||||
onClick={this.props.updateSection} >
|
||||
onClick={this.props.updateSection}
|
||||
>
|
||||
Cancel
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -98,12 +98,13 @@ export default class SettingPicture extends React.Component {
|
||||
<li className='setting-list-item'>
|
||||
{serverError}
|
||||
{clientError}
|
||||
<span className='btn btn-sm btn-primary btn-file sel-btn'
|
||||
>Select<input
|
||||
ref='input'
|
||||
accept='.jpg,.png,.bmp'
|
||||
type='file'
|
||||
onChange={this.props.pictureChange}
|
||||
<span className='btn btn-sm btn-primary btn-file sel-btn'>
|
||||
Select
|
||||
<input
|
||||
ref='input'
|
||||
accept='.jpg,.png,.bmp'
|
||||
type='file'
|
||||
onChange={this.props.pictureChange}
|
||||
/>
|
||||
</span>
|
||||
{confirmButton}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
export default class SettingsUpload extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -70,14 +69,19 @@ export default class SettingsUpload extends React.Component {
|
||||
<li className='col-xs-offset-3 col-xs-8'>
|
||||
<ul className='setting-list'>
|
||||
<li className='setting-list-item'>
|
||||
<span className='btn btn-sm btn-primary btn-file sel-btn'>Select file<input
|
||||
ref='uploadinput'
|
||||
accept={this.props.fileTypesAccepted}
|
||||
type='file'
|
||||
onChange={this.onFileSelect}/></span>
|
||||
<span className='btn btn-sm btn-primary btn-file sel-btn'>
|
||||
Select file
|
||||
<input
|
||||
ref='uploadinput'
|
||||
accept={this.props.fileTypesAccepted}
|
||||
type='file'
|
||||
onChange={this.onFileSelect}
|
||||
/>
|
||||
</span>
|
||||
<a
|
||||
className={'btn btn-sm btn-primary'}
|
||||
onClick={this.doSubmit}>
|
||||
onClick={this.doSubmit}
|
||||
>
|
||||
Import
|
||||
</a>
|
||||
<div className='file-status file-name hide'></div>
|
||||
|
||||
@@ -29,10 +29,12 @@ export default class SidebarHeader extends React.Component {
|
||||
}
|
||||
|
||||
if (me.last_picture_update) {
|
||||
profilePicture = (<img
|
||||
className='user__picture'
|
||||
src={'/api/v1/users/' + me.id + '/image?time=' + me.update_at}
|
||||
/>);
|
||||
profilePicture = (
|
||||
<img
|
||||
className='user__picture'
|
||||
src={'/api/v1/users/' + me.id + '/image?time=' + me.update_at}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -71,10 +71,12 @@ export default class SidebarRight extends React.Component {
|
||||
if (this.state.search_visible) {
|
||||
content = <SearchResults isMentionSearch={this.state.is_mention_search} />;
|
||||
} else if (this.state.post_right_visible) {
|
||||
content = (<RhsThread
|
||||
fromSearch={this.state.from_search}
|
||||
isMentionSearch={this.state.is_mention_search}
|
||||
/>);
|
||||
content = (
|
||||
<RhsThread
|
||||
fromSearch={this.state.from_search}
|
||||
isMentionSearch={this.state.is_mention_search}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -68,7 +68,8 @@ export default class SidebarRightMenu extends React.Component {
|
||||
href='#'
|
||||
data-toggle='modal'
|
||||
data-target='#team_members'
|
||||
><i className='glyphicon glyphicon-wrench'></i>Manage Team</a>
|
||||
>
|
||||
<i className='glyphicon glyphicon-wrench'></i>Manage Team</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,52 +44,66 @@ export default class SignupTeamComplete extends React.Component {
|
||||
}
|
||||
render() {
|
||||
if (this.state.wizard === 'welcome') {
|
||||
return (<WelcomePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<WelcomePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'team_display_name') {
|
||||
return (<TeamDisplayNamePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<TeamDisplayNamePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'team_url') {
|
||||
return (<TeamURLPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<TeamURLPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'allowed_domains') {
|
||||
return (<AllowedDomainsPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<AllowedDomainsPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'send_invites') {
|
||||
return (<SendInivtesPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<SendInivtesPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'username') {
|
||||
return (<UsernamePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<UsernamePage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.state.wizard === 'password') {
|
||||
return (<PasswordPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>);
|
||||
return (
|
||||
<PasswordPage
|
||||
state={this.state}
|
||||
updateParent={this.updateParent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (<div>You've already completed the signup process for this invitation or this invitation has expired.</div>);
|
||||
|
||||
@@ -46,7 +46,8 @@ export default class TeamImportTab extends React.Component {
|
||||
title='Import from Slack'
|
||||
submit={this.doImportSlack}
|
||||
helpText={uploadHelpText}
|
||||
fileTypesAccepted='.zip'/>
|
||||
fileTypesAccepted='.zip'
|
||||
/>
|
||||
);
|
||||
|
||||
var messageSection;
|
||||
@@ -62,14 +63,30 @@ export default class TeamImportTab extends React.Component {
|
||||
break;
|
||||
case 'done':
|
||||
messageSection = (
|
||||
<p className='confirm-import alert alert-success'><i className='fa fa-check'></i> Import successful: <a href={this.state.link}
|
||||
download='MattermostImportSummary.txt'>View Summary</a></p>
|
||||
);
|
||||
<p className='confirm-import alert alert-success'>
|
||||
<i className='fa fa-check' />
|
||||
{' Import successful: '}
|
||||
<a
|
||||
href={this.state.link}
|
||||
download='MattermostImportSummary.txt'
|
||||
>
|
||||
{'View Summary'}
|
||||
</a>
|
||||
</p>
|
||||
);
|
||||
break;
|
||||
case 'fail':
|
||||
messageSection = (
|
||||
<p className='confirm-import alert alert-warning'><i className='fa fa-warning'></i> Import failure: <a href={this.state.link}
|
||||
download='MattermostImportSummary.txt'>View Summary</a></p>
|
||||
<p className='confirm-import alert alert-warning'>
|
||||
<i className='fa fa-warning' />
|
||||
{' Import failure: '}
|
||||
<a
|
||||
href={this.state.link}
|
||||
download='MattermostImportSummary.txt'
|
||||
>
|
||||
{'View Summary'}
|
||||
</a>
|
||||
</p>
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class ChooseAuthPage extends React.Component {
|
||||
this.props.updatePage('service', Constants.GITLAB_SERVICE);
|
||||
}.bind(this)
|
||||
}
|
||||
>
|
||||
>
|
||||
<span className='icon' />
|
||||
<span>Create new {strings.Team} with GitLab Account</span>
|
||||
</a>
|
||||
@@ -40,7 +40,7 @@ export default class ChooseAuthPage extends React.Component {
|
||||
this.props.updatePage('email', '');
|
||||
}.bind(this)
|
||||
}
|
||||
>
|
||||
>
|
||||
<span className='fa fa-envelope' />
|
||||
<span>Create new {strings.Team} with email address</span>
|
||||
</a>
|
||||
|
||||
@@ -52,8 +52,8 @@ export default class TeamSignupDisplayNamePage extends React.Component {
|
||||
<form>
|
||||
<img
|
||||
className='signup-team-logo'
|
||||
src='/static/images/logo.png' />
|
||||
|
||||
src='/static/images/logo.png'
|
||||
/>
|
||||
<h2>{utils.toTitleCase(strings.Team) + ' Name'}</h2>
|
||||
<div className={nameDivClass}>
|
||||
<div className='row'>
|
||||
@@ -66,22 +66,27 @@ export default class TeamSignupDisplayNamePage extends React.Component {
|
||||
maxLength='128'
|
||||
defaultValue={this.props.state.team.display_name}
|
||||
autoFocus={true}
|
||||
onFocus={this.handleFocus} />
|
||||
onFocus={this.handleFocus}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{nameError}
|
||||
</div>
|
||||
<div>{'Name your ' + strings.Team + ' in any language. Your ' + strings.Team + ' name shows in menus and headings.'}</div>
|
||||
<div>
|
||||
{'Name your ' + strings.Team + ' in any language. Your ' + strings.Team + ' name shows in menus and headings.'}
|
||||
</div>
|
||||
<button
|
||||
type='submit'
|
||||
className='btn btn-primary margin--extra'
|
||||
onClick={this.submitNext} >
|
||||
onClick={this.submitNext}
|
||||
>
|
||||
Next<i className='glyphicon glyphicon-chevron-right'></i>
|
||||
</button>
|
||||
<div className='margin--extra'>
|
||||
<a
|
||||
href='#'
|
||||
onClick={this.submitBack}>
|
||||
onClick={this.submitBack}
|
||||
>
|
||||
Back to previous step
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -307,7 +307,8 @@ export default class ViewImageModal extends React.Component {
|
||||
ref='previewArrowLeft'
|
||||
className='modal-prev-bar'
|
||||
href='#'
|
||||
onClick={this.handlePrev}>
|
||||
onClick={this.handlePrev}
|
||||
>
|
||||
<i className='image-control image-prev'/>
|
||||
</a>
|
||||
);
|
||||
@@ -317,7 +318,8 @@ export default class ViewImageModal extends React.Component {
|
||||
ref='previewArrowRight'
|
||||
className='modal-next-bar'
|
||||
href='#'
|
||||
onClick={this.handleNext}>
|
||||
onClick={this.handleNext}
|
||||
>
|
||||
<i className='image-control image-next'/>
|
||||
</a>
|
||||
);
|
||||
@@ -351,7 +353,7 @@ export default class ViewImageModal extends React.Component {
|
||||
ref='imageFooter'
|
||||
className='modal-button-bar'
|
||||
>
|
||||
<span className='pull-left text'>{'File ' + (this.state.imgId + 1) + ' of ' + this.props.filenames.length}</span>
|
||||
<span className='pull-left text'>{'File ' + (this.state.imgId + 1) + ' of ' + this.props.filenames.length}</span>
|
||||
<div className='image-links'>
|
||||
{publicLink}
|
||||
<a
|
||||
|
||||
Ссылка в новой задаче
Block a user