diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/claim/claim_account.jsx | 6 | ||||
-rw-r--r-- | web/react/components/claim/email_to_sso.jsx | 111 | ||||
-rw-r--r-- | web/react/components/claim/sso_to_email.jsx | 116 | ||||
-rw-r--r-- | web/react/components/create_comment.jsx | 2 | ||||
-rw-r--r-- | web/react/components/create_post.jsx | 2 | ||||
-rw-r--r-- | web/react/components/file_upload.jsx | 3 | ||||
-rw-r--r-- | web/react/components/post_info.jsx | 32 | ||||
-rw-r--r-- | web/react/components/rhs_comment.jsx | 32 | ||||
-rw-r--r-- | web/react/components/rhs_root_post.jsx | 46 |
9 files changed, 179 insertions, 171 deletions
diff --git a/web/react/components/claim/claim_account.jsx b/web/react/components/claim/claim_account.jsx index 87026b762..5b3b584ee 100644 --- a/web/react/components/claim/claim_account.jsx +++ b/web/react/components/claim/claim_account.jsx @@ -43,11 +43,7 @@ export default class ClaimAccount extends React.Component { ); } - return ( - <div> - {content} - </div> - ); + return content; } } diff --git a/web/react/components/claim/email_to_sso.jsx b/web/react/components/claim/email_to_sso.jsx index 3d4b9e91f..87e86697c 100644 --- a/web/react/components/claim/email_to_sso.jsx +++ b/web/react/components/claim/email_to_sso.jsx @@ -70,62 +70,69 @@ class EmailToSSO extends React.Component { const uiType = Utils.toTitleCase(this.props.type) + ' SSO'; return ( - <div className='col-sm-12'> - <div className='signup-team__container'> - <h3> + <div> + <h3> + <FormattedMessage + id='claim.email_to_sso.title' + defaultMessage='Switch Email/Password Account to {uiType}' + values={{ + uiType: uiType + }} + /> + </h3> + <form onSubmit={this.submit}> + <p> <FormattedMessage - id='claim.email_to_sso.title' - defaultMessage='Switch Email/Password Account to {uiType}' + id='claim.email_to_sso.ssoType' + defaultMessage='Upon claiming your account, you will only be able to login with {type} SSO. You must already have a valid {type} account' + values={{ + type: Utils.toTitleCase(this.props.type) + }} + /> + </p> + <p> + <FormattedMessage + id='claim.email_to_sso.ssoNote' + defaultMessage='You must already have a valid {type} account' + values={{ + type: Utils.toTitleCase(this.props.type) + }} + /> + </p> + <p> + <FormattedMessage + id='claim.email_to_sso.enterPwd' + defaultMessage='Enter the password for your {team} {site} account' + values={{ + team: this.props.teamDisplayName, + site: global.window.mm_config.SiteName + }} + /> + </p> + <div className={formClass}> + <input + type='password' + className='form-control' + name='password' + ref='password' + placeholder={this.props.intl.formatMessage(holders.pwd)} + spellCheck='false' + /> + </div> + {error} + <button + type='submit' + className='btn btn-primary' + > + <FormattedMessage + id='claim.email_to_sso.switchTo' + defaultMessage='Switch account to {uiType}' values={{ uiType: uiType }} /> - </h3> - <form onSubmit={this.submit}> - <p> - <FormattedMessage - id='claim.email_to_sso.ssoType' - defaultMessage='Upon claiming your account, you will only be able to login with {type} SSO' - values={{ - type: Utils.toTitleCase(this.props.type) - }} - /> - </p> - <p> - <FormattedMessage - id='claim.email_to_sso.enterPwd' - defaultMessage='Enter the password for your {team} {site} account' - values={{ - team: this.props.teamDisplayName, - site: global.window.mm_config.SiteName - }} - /> - </p> - <div className={formClass}> - <input - type='password' - className='form-control' - name='password' - ref='password' - placeholder={this.props.intl.formatMessage(holders.pwd)} - spellCheck='false' - /> - </div> - {error} - <button - type='submit' - className='btn btn-primary' - > - <FormattedMessage - id='claim.email_to_sso.switchTo' - defaultMessage='Switch account to {uiType}' - values={{ - uiType: uiType - }} - /> - </button> - </form> - </div> + </button> + </form> </div> ); } @@ -141,4 +148,4 @@ EmailToSSO.propTypes = { teamDisplayName: React.PropTypes.string.isRequired }; -export default injectIntl(EmailToSSO);
\ No newline at end of file +export default injectIntl(EmailToSSO); diff --git a/web/react/components/claim/sso_to_email.jsx b/web/react/components/claim/sso_to_email.jsx index 73ff13cc9..74137082a 100644 --- a/web/react/components/claim/sso_to_email.jsx +++ b/web/react/components/claim/sso_to_email.jsx @@ -86,69 +86,67 @@ class SSOToEmail extends React.Component { const uiType = Utils.toTitleCase(this.props.currentType) + ' SSO'; return ( - <div className='col-sm-12'> - <div className='signup-team__container'> - <h3> + <div> + <h3> + <FormattedMessage + id='claim.sso_to_email.title' + defaultMessage='Switch {type} Account to Email' + values={{ + type: uiType + }} + /> + </h3> + <form onSubmit={this.submit}> + <p> <FormattedMessage - id='claim.sso_to_email.title' - defaultMessage='Switch {type} Account to Email' + id='claim.sso_to_email.description' + defaultMessage='Upon changing your account type, you will only be able to login with your email and password.' + /> + </p> + <p> + <FormattedMessage + id='claim.sso_to_email_newPwd' + defaultMessage='Enter a new password for your {team} {site} account' + values={{ + team: this.props.teamDisplayName, + site: global.window.mm_config.SiteName + }} + /> + </p> + <div className={formClass}> + <input + type='password' + className='form-control' + name='password' + ref='password' + placeholder={formatMessage(holders.newPwd)} + spellCheck='false' + /> + </div> + <div className={formClass}> + <input + type='password' + className='form-control' + name='passwordconfirm' + ref='passwordconfirm' + placeholder={formatMessage(holders.confirm)} + spellCheck='false' + /> + </div> + {error} + <button + type='submit' + className='btn btn-primary' + > + <FormattedMessage + id='claim.sso_to_email.switchTo' + defaultMessage='Switch {type} to email and password' values={{ type: uiType }} /> - </h3> - <form onSubmit={this.submit}> - <p> - <FormattedMessage - id='claim.sso_to_email.description' - defaultMessage='Upon changing your account type, you will only be able to login with your email and password.' - /> - </p> - <p> - <FormattedMessage - id='claim.sso_to_email_newPwd' - defaultMessage='Enter a new password for your {team} {site} account' - values={{ - team: this.props.teamDisplayName, - site: global.window.mm_config.SiteName - }} - /> - </p> - <div className={formClass}> - <input - type='password' - className='form-control' - name='password' - ref='password' - placeholder={formatMessage(holders.newPwd)} - spellCheck='false' - /> - </div> - <div className={formClass}> - <input - type='password' - className='form-control' - name='passwordconfirm' - ref='passwordconfirm' - placeholder={formatMessage(holders.confirm)} - spellCheck='false' - /> - </div> - {error} - <button - type='submit' - className='btn btn-primary' - > - <FormattedMessage - id='claim.sso_to_email.switchTo' - defaultMessage='Switch {type} to email and password' - values={{ - type: uiType - }} - /> - </button> - </form> - </div> + </button> + </form> </div> ); } @@ -164,4 +162,4 @@ SSOToEmail.propTypes = { teamDisplayName: React.PropTypes.string.isRequired }; -export default injectIntl(SSOToEmail);
\ No newline at end of file +export default injectIntl(SSOToEmail); diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 5f8f76fab..24e0ff6e9 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -294,7 +294,7 @@ class CreateComment extends React.Component { if (index !== -1) { uploadsInProgress.splice(index, 1); - this.refs.fileUpload.cancelUpload(id); + this.refs.fileUpload.getWrappedInstance().cancelUpload(id); } } else { previews.splice(index, 1); diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 5d90d03d2..48b6594a1 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -288,7 +288,7 @@ class CreatePost extends React.Component { if (index !== -1) { uploadsInProgress.splice(index, 1); - this.refs.fileUpload.cancelUpload(id); + this.refs.fileUpload.getWrappedInstance().cancelUpload(id); } } else { previews.splice(index, 1); diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx index f5c32c825..0454fe510 100644 --- a/web/react/components/file_upload.jsx +++ b/web/react/components/file_upload.jsx @@ -34,6 +34,7 @@ class FileUpload extends React.Component { this.uploadFiles = this.uploadFiles.bind(this); this.handleChange = this.handleChange.bind(this); this.handleDrop = this.handleDrop.bind(this); + this.cancelUpload = this.cancelUpload.bind(this); this.state = { requests: {} @@ -331,4 +332,4 @@ FileUpload.propTypes = { postType: React.PropTypes.string }; -export default injectIntl(FileUpload); +export default injectIntl(FileUpload, {withRef: true}); diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index d1d516816..ffac6eaef 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -65,22 +65,24 @@ export default class PostInfo extends React.Component { ); } - dropdownContents.push( - <li - key='copyLink' - role='presentation' - > - <a - href='#' - onClick={this.handlePermalink} + if (!Utils.isMobile()) { + dropdownContents.push( + <li + key='copyLink' + role='presentation' > - <FormattedMessage - id='post_info.permalink' - defaultMessage='Permalink' - /> - </a> - </li> - ); + <a + href='#' + onClick={this.handlePermalink} + > + <FormattedMessage + id='post_info.permalink' + defaultMessage='Permalink' + /> + </a> + </li> + ); + } if (isOwner || isAdmin) { dropdownContents.push( diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx index 0d15c8599..201a4c569 100644 --- a/web/react/components/rhs_comment.jsx +++ b/web/react/components/rhs_comment.jsx @@ -97,22 +97,24 @@ class RhsComment extends React.Component { var dropdownContents = []; - dropdownContents.push( - <li - key='rhs-root-permalink' - role='presentation' - > - <a - href='#' - onClick={this.handlePermalink} + if (!Utils.isMobile()) { + dropdownContents.push( + <li + key='rhs-root-permalink' + role='presentation' > - <FormattedMessage - id='rhs_comment.permalink' - defaultMessage='Permalink' - /> - </a> - </li> - ); + <a + href='#' + onClick={this.handlePermalink} + > + <FormattedMessage + id='rhs_comment.permalink' + defaultMessage='Permalink' + /> + </a> + </li> + ); + } if (isOwner) { dropdownContents.push( diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx index 54f2e8262..adf66da85 100644 --- a/web/react/components/rhs_root_post.jsx +++ b/web/react/components/rhs_root_post.jsx @@ -5,7 +5,7 @@ import ChannelStore from '../stores/channel_store.jsx'; import UserProfile from './user_profile.jsx'; import UserStore from '../stores/user_store.jsx'; import * as TextFormatting from '../utils/text_formatting.jsx'; -import * as utils from '../utils/utils.jsx'; +import * as Utils from '../utils/utils.jsx'; import * as Emoji from '../utils/emoticons.jsx'; import FileAttachmentList from './file_attachment_list.jsx'; import twemoji from 'twemoji'; @@ -40,7 +40,7 @@ export default class RhsRootPost extends React.Component { this.parseEmojis(); } shouldComponentUpdate(nextProps) { - if (!utils.areObjectsEqual(nextProps.post, this.props.post)) { + if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) { return true; } @@ -53,7 +53,7 @@ export default class RhsRootPost extends React.Component { var post = this.props.post; var currentUser = UserStore.getCurrentUser(); var isOwner = currentUser.id === post.user_id; - var isAdmin = utils.isAdmin(currentUser.roles); + var isAdmin = Utils.isAdmin(currentUser.roles); var timestamp = UserStore.getProfile(post.user_id).update_at; var channel = ChannelStore.get(post.channel_id); @@ -68,7 +68,7 @@ export default class RhsRootPost extends React.Component { } var systemMessageClass = ''; - if (utils.isSystemMessage(post)) { + if (Utils.isSystemMessage(post)) { systemMessageClass = 'post--system'; } @@ -88,22 +88,24 @@ export default class RhsRootPost extends React.Component { var dropdownContents = []; - dropdownContents.push( - <li - key='rhs-root-permalink' - role='presentation' - > - <a - href='#' - onClick={this.handlePermalink} + if (!Utils.isMobile()) { + dropdownContents.push( + <li + key='rhs-root-permalink' + role='presentation' > - <FormattedMessage - id='rhs_root.permalink' - defaultMessage='Permalink' - /> - </a> - </li> - ); + <a + href='#' + onClick={this.handlePermalink} + > + <FormattedMessage + id='rhs_root.permalink' + defaultMessage='Permalink' + /> + </a> + </li> + ); + } if (isOwner) { dropdownContents.push( @@ -198,7 +200,7 @@ export default class RhsRootPost extends React.Component { } botIndicator = <li className='col col__name bot-indicator'>{'BOT'}</li>; - } else if (utils.isSystemMessage(post)) { + } else if (Utils.isSystemMessage(post)) { userProfile = ( <UserProfile userId={''} @@ -209,12 +211,12 @@ export default class RhsRootPost extends React.Component { ); } - let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex(); + let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + Utils.getSessionIndex(); if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') { if (post.props.override_icon_url) { src = post.props.override_icon_url; } - } else if (utils.isSystemMessage(post)) { + } else if (Utils.isSystemMessage(post)) { src = Constants.SYSTEM_MESSAGE_PROFILE_IMAGE; } |