diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/admin_console/storage_settings.jsx | 44 | ||||
-rw-r--r-- | webapp/components/create_post.jsx | 3 | ||||
-rw-r--r-- | webapp/components/dot_menu/dot_menu.jsx | 9 | ||||
-rw-r--r-- | webapp/components/edit_channel_header_modal.jsx | 6 | ||||
-rw-r--r-- | webapp/components/post_view/post_body_additional_content.jsx | 1 | ||||
-rw-r--r-- | webapp/components/textbox.jsx | 10 | ||||
-rw-r--r-- | webapp/components/view_image.jsx | 3 |
7 files changed, 48 insertions, 28 deletions
diff --git a/webapp/components/admin_console/storage_settings.jsx b/webapp/components/admin_console/storage_settings.jsx index 89a56c04b..b591758b1 100644 --- a/webapp/components/admin_console/storage_settings.jsx +++ b/webapp/components/admin_console/storage_settings.jsx @@ -68,6 +68,7 @@ export default class StorageSettings extends AdminSettings { } renderSettings() { + let amazonSSEComp; const mobileUploadDownloadSettings = []; if (window.mm_license.IsLicensed === 'true' && window.mm_license.Compliance === 'true') { mobileUploadDownloadSettings.push( @@ -113,6 +114,29 @@ export default class StorageSettings extends AdminSettings { disabled={!this.state.enableFileAttachments} /> ); + + amazonSSEComp = + ( + <BooleanSetting + id='amazonS3SSE' + label={ + <FormattedMessage + id='admin.image.amazonS3SSETitle' + defaultMessage='Enable Server-Side Encryption for Amazon S3:' + /> + } + placeholder={Utils.localizeMessage('admin.image.amazonS3SSEExample', 'Ex "false"')} + helpText={ + <FormattedHTMLMessage + id='admin.image.amazonS3SSEDescription' + defaultMessage='When true, encrypt files in Amazon S3 using server-side encryption with Amazon S3-managed keys. See <a href="https://about.mattermost.com/default-server-side-encryption" target="_blank">documentation</a> to learn more.' + /> + } + value={this.state.amazonS3SSE} + onChange={this.handleChange} + disabled={this.state.driverName !== DRIVER_S3} + /> + ); } return ( @@ -254,25 +278,7 @@ export default class StorageSettings extends AdminSettings { onChange={this.handleChange} disabled={this.state.driverName !== DRIVER_S3} /> - <BooleanSetting - id='AmazonSSE' - label={ - <FormattedMessage - id='admin.image.AmazonSSETitle' - defaultMessage='Enable Server-Side Encryption for Amazon S3:' - /> - } - placeholder={Utils.localizeMessage('admin.image.AmazonSSEExample', 'Ex "false"')} - helpText={ - <FormattedMessage - id='admin.image.AmazonSSEDescription' - defaultMessage='When true, encrypt files in Amazon S3 using server-side encryption with Amazon S3-managed keys. See <a href="https://about.mattermost.com/default-server-side-encryption" target="_blank">documentation</a> to learn more.' - /> - } - value={this.state.AmazonSSE} - onChange={this.handleChange} - disabled={this.state.driverName !== DRIVER_S3} - /> + {amazonSSEComp} <BooleanSetting id='enableFileAttachments' label={ diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index 55d6884ac..b57eb2f17 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -14,6 +14,7 @@ import * as EmojiPicker from 'components/emoji_picker/emoji_picker.jsx'; import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; import * as Utils from 'utils/utils.jsx'; +import * as PostUtils from 'utils/post_utils.jsx'; import * as UserAgent from 'utils/user_agent.jsx'; import * as ChannelActions from 'actions/channel_actions.jsx'; import * as PostActions from 'actions/post_actions.jsx'; @@ -224,7 +225,7 @@ export default class CreatePost extends React.Component { const members = stats.member_count - 1; const updateChannel = ChannelStore.getCurrent(); - if ((this.state.message.includes('@all') || this.state.message.includes('@channel')) && members >= Constants.NOTIFY_ALL_MEMBERS) { + if ((PostUtils.containsAtMention(this.state.message, '@all') || PostUtils.containsAtMention(this.state.message, '@channel')) && members >= Constants.NOTIFY_ALL_MEMBERS) { this.setState({totalMembers: members}); this.showNotifyAllModal(); return; diff --git a/webapp/components/dot_menu/dot_menu.jsx b/webapp/components/dot_menu/dot_menu.jsx index a2cbb9b48..6a64981d0 100644 --- a/webapp/components/dot_menu/dot_menu.jsx +++ b/webapp/components/dot_menu/dot_menu.jsx @@ -71,6 +71,15 @@ export default class DotMenu extends Component { $('#' + this.props.idPrefix + '_dropdown' + this.props.post.id).on('hidden.bs.dropdown', () => this.props.handleDropdownOpened(false)); } + componentWillReceiveProps(nextProps) { + if (nextProps.post !== this.props.post) { + this.state = { + canDelete: PostUtils.canDeletePost(nextProps.post), + canEdit: PostUtils.canEditPost(nextProps.post, this.editDisableAction) + }; + } + } + componentWillUnmount() { this.editDisableAction.cancel(); } diff --git a/webapp/components/edit_channel_header_modal.jsx b/webapp/components/edit_channel_header_modal.jsx index ef1f68b70..b993fb93c 100644 --- a/webapp/components/edit_channel_header_modal.jsx +++ b/webapp/components/edit_channel_header_modal.jsx @@ -85,15 +85,14 @@ class EditChannelHeaderModal extends React.Component { this.props.channel.id, this.state.header, () => { - this.setState({serverError: ''}); + this.setState({serverError: '', submitted: false}); this.onHide(); }, (err) => { if (err.id === 'api.context.invalid_param.app_error') { this.setState({serverError: this.props.intl.formatMessage(holders.error)}); - } else { - this.setState({serverError: err.message}); } + this.setState({submitted: false}); } ); } @@ -189,6 +188,7 @@ class EditChannelHeaderModal extends React.Component { handlePostError={this.handlePostError} id='edit_textbox' ref='editChannelHeaderTextbox' + characterLimit={1024} /> <br/> {serverError} diff --git a/webapp/components/post_view/post_body_additional_content.jsx b/webapp/components/post_view/post_body_additional_content.jsx index 1d900018a..bf01374fe 100644 --- a/webapp/components/post_view/post_body_additional_content.jsx +++ b/webapp/components/post_view/post_body_additional_content.jsx @@ -78,6 +78,7 @@ export default class PostBodyAdditionalContent extends React.PureComponent { return ( <PostAttachmentList attachments={attachments} + key={this.props.post.id} /> ); } diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 3e62d98bc..cf1d054cf 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -38,13 +38,15 @@ export default class Textbox extends React.Component { suggestionListStyle: PropTypes.string, emojiEnabled: PropTypes.bool, isRHS: PropTypes.bool, - popoverMentionKeyClick: React.PropTypes.bool + popoverMentionKeyClick: React.PropTypes.bool, + characterLimit: React.PropTypes.number }; static defaultProps = { supportsCommands: true, isRHS: false, - popoverMentionKeyClick: false + popoverMentionKeyClick: false, + characterLimit: Constants.CHARACTER_LIMIT }; constructor(props) { @@ -93,14 +95,14 @@ export default class Textbox extends React.Component { checkMessageLength = (message) => { if (this.props.handlePostError) { - if (message.length > Constants.CHARACTER_LIMIT) { + if (message.length > this.props.characterLimit) { const errorMessage = ( <FormattedMessage id='create_post.error_message' defaultMessage='Your message is too long. Character count: {length}/{limit}' values={{ length: message.length, - limit: Constants.CHARACTER_LIMIT + limit: this.props.characterLimit }} />); this.props.handlePostError(errorMessage); diff --git a/webapp/components/view_image.jsx b/webapp/components/view_image.jsx index 4350711fc..7872867f3 100644 --- a/webapp/components/view_image.jsx +++ b/webapp/components/view_image.jsx @@ -11,7 +11,8 @@ import * as GlobalActions from 'actions/global_actions.jsx'; import * as FileUtils from 'utils/file_utils'; import * as Utils from 'utils/utils.jsx'; -import {KeyCodes} from 'utils/constants.jsx'; +import Constants from 'utils/constants.jsx'; +const KeyCodes = Constants.KeyCodes; import {getFileUrl, getFilePreviewUrl} from 'mattermost-redux/utils/file_utils'; |