diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/about_build_modal.jsx | 7 | ||||
-rw-r--r-- | webapp/components/admin_console/log_settings.jsx | 21 | ||||
-rw-r--r-- | webapp/components/create_comment.jsx | 21 | ||||
-rw-r--r-- | webapp/components/filtered_user_list.jsx | 4 | ||||
-rw-r--r-- | webapp/components/password_reset_form.jsx | 4 | ||||
-rw-r--r-- | webapp/components/post_view/components/post_list.jsx | 15 | ||||
-rw-r--r-- | webapp/components/post_view/post_focus_view_controller.jsx | 1 | ||||
-rw-r--r-- | webapp/components/sidebar_right.jsx | 6 | ||||
-rw-r--r-- | webapp/components/suggestion/suggestion_box.jsx | 9 | ||||
-rw-r--r-- | webapp/components/suggestion/suggestion_list.jsx | 1 | ||||
-rw-r--r-- | webapp/components/user_settings/user_settings.jsx | 11 | ||||
-rw-r--r-- | webapp/components/user_settings/user_settings_display.jsx | 9 | ||||
-rw-r--r-- | webapp/components/user_settings/user_settings_general.jsx | 2 | ||||
-rw-r--r-- | webapp/components/user_settings/user_settings_modal.jsx | 14 |
14 files changed, 62 insertions, 63 deletions
diff --git a/webapp/components/about_build_modal.jsx b/webapp/components/about_build_modal.jsx index 2f7b3e781..de0b2d58c 100644 --- a/webapp/components/about_build_modal.jsx +++ b/webapp/components/about_build_modal.jsx @@ -137,6 +137,13 @@ export default class AboutBuildModal extends React.Component { /> {'\u00a0' + config.Version + '\u00a0' + config.BuildNumber} </div> + <div> + <FormattedMessage + id='about.database' + defaultMessage='Database:' + /> + {'\u00a0' + config.SQLDriverName} + </div> </div> {licensee} </div> diff --git a/webapp/components/admin_console/log_settings.jsx b/webapp/components/admin_console/log_settings.jsx index 0a69cbc16..238040b71 100644 --- a/webapp/components/admin_console/log_settings.jsx +++ b/webapp/components/admin_console/log_settings.jsx @@ -26,7 +26,8 @@ export default class LogSettings extends AdminSettings { enableFile: props.config.LogSettings.EnableFile, fileLevel: props.config.LogSettings.FileLevel, fileLocation: props.config.LogSettings.FileLocation, - fileFormat: props.config.LogSettings.FileFormat + fileFormat: props.config.LogSettings.FileFormat, + enableWebhookDebugging: props.config.LogSettings.EnableWebhookDebugging }); } @@ -37,6 +38,7 @@ export default class LogSettings extends AdminSettings { config.LogSettings.FileLevel = this.state.fileLevel; config.LogSettings.FileLocation = this.state.fileLocation; config.LogSettings.FileFormat = this.state.fileFormat; + config.LogSettings.EnableWebhookDebugging = this.state.enableWebhookDebugging; return config; } @@ -166,6 +168,23 @@ export default class LogSettings extends AdminSettings { onChange={this.handleChange} disabled={!this.state.enableFile} /> + <BooleanSetting + id='enableWebhookDebugging' + label={ + <FormattedMessage + id='admin.log.enableWebhookDebugging' + defaultMessage='Enable Webhook Debugging:' + /> + } + helpText={ + <FormattedMessage + id='admin.log.enableWebhookDebuggingDescription' + defaultMessage='You can set this to false to disable the debug logging of all incoming webhook request bodies.' + /> + } + value={this.state.enableWebhookDebugging} + onChange={this.handleChange} + /> </SettingsGroup> ); } diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index a9cf68833..85f8ac864 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -5,8 +5,6 @@ import $ from 'jquery'; import ReactDOM from 'react-dom'; import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; import Client from 'utils/web_client.jsx'; -import * as AsyncClient from 'utils/async_client.jsx'; -import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; import PostDeletedModal from './post_deleted_modal.jsx'; import PostStore from 'stores/post_store.jsx'; @@ -145,24 +143,11 @@ class CreateComment extends React.Component { post.user_id = userId; post.create_at = time; - PostStore.storePendingPost(post); - PostStore.storeCommentDraft(this.props.rootId, null); - + GlobalActions.emitUserCommentedEvent(post); Client.createPost( post, - (data) => { - AsyncClient.getPosts(this.props.channelId); - - const channel = ChannelStore.get(this.props.channelId); - const member = ChannelStore.getMember(this.props.channelId); - member.msg_count = channel.total_msg_count; - member.last_viewed_at = Date.now(); - ChannelStore.setChannelMember(member); - - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_POST, - post: data - }); + () => { + PostStore.removePendingPost(post.channel_id, post.pending_post_id); }, (err) => { if (err.id === 'api.post.create_post.root_id.app_error') { diff --git a/webapp/components/filtered_user_list.jsx b/webapp/components/filtered_user_list.jsx index fca68a81a..181a19c74 100644 --- a/webapp/components/filtered_user_list.jsx +++ b/webapp/components/filtered_user_list.jsx @@ -52,6 +52,10 @@ class FilteredUserList extends React.Component { } } + componentDidMount() { + ReactDOM.findDOMNode(this.refs.filter).focus(); + } + componentDidUpdate(prevProps, prevState) { if (prevState.filter !== this.state.filter) { $(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0); diff --git a/webapp/components/password_reset_form.jsx b/webapp/components/password_reset_form.jsx index 887bc0c8e..eeea265d8 100644 --- a/webapp/components/password_reset_form.jsx +++ b/webapp/components/password_reset_form.jsx @@ -29,7 +29,9 @@ class PasswordResetForm extends React.Component { <FormattedMessage id='password_form.error' defaultMessage='Please enter at least {chars} characters.' - chars={Constants.MIN_PASSWORD_LENGTH} + values={{ + chars: Constants.MIN_PASSWORD_LENGTH + }} /> ) }); diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 28be93544..c23f785d9 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -68,7 +68,7 @@ export default class PostList extends React.Component { const childNodes = this.refs.postlistcontent.childNodes; for (let i = 0; i < childNodes.length; i++) { // If the node is 1/3 down the page - if (childNodes[i].offsetTop > (this.refs.postlist.scrollTop + (this.refs.postlist.offsetHeight / Constants.SCROLL_PAGE_FRACTION))) { + if (childNodes[i].offsetTop >= (this.refs.postlist.scrollTop + (this.refs.postlist.offsetHeight / Constants.SCROLL_PAGE_FRACTION))) { this.jumpToPostNode = childNodes[i]; break; } @@ -137,7 +137,10 @@ export default class PostList extends React.Component { } loadMorePostsTop() { - GlobalActions.emitLoadMorePostsEvent(); + if (this.props.isFocusPost) { + return GlobalActions.emitLoadMorePostsFocusedTopEvent(); + } + return GlobalActions.emitLoadMorePostsEvent(); } loadMorePostsBottom() { @@ -364,9 +367,8 @@ export default class PostList extends React.Component { } } else if (this.refs.postlist.scrollHeight !== this.prevScrollHeight) { window.requestAnimationFrame(() => { - // Only need to jump if we added posts to the top. - if (this.jumpToPostNode && (this.jumpToPostNode.offsetTop !== this.prevOffsetTop)) { - this.refs.postlist.scrollTop += (this.refs.postlist.scrollHeight - this.prevScrollHeight); + if (this.jumpToPostNode) { + this.refs.postlist.scrollTop += (this.jumpToPostNode.offsetTop - this.prevOffsetTop); } }); } @@ -522,5 +524,6 @@ PostList.propTypes = { displayNameType: React.PropTypes.string, displayPostsInCenter: React.PropTypes.bool, compactDisplay: React.PropTypes.bool, - previewsCollapsed: React.PropTypes.string + previewsCollapsed: React.PropTypes.string, + isFocusPost: React.PropTypes.bool }; diff --git a/webapp/components/post_view/post_focus_view_controller.jsx b/webapp/components/post_view/post_focus_view_controller.jsx index 7c1da6566..c70ebb0f5 100644 --- a/webapp/components/post_view/post_focus_view_controller.jsx +++ b/webapp/components/post_view/post_focus_view_controller.jsx @@ -115,6 +115,7 @@ export default class PostFocusView extends React.Component { showMoreMessagesTop={!this.state.atTop} showMoreMessagesBottom={!this.state.atBottom} postsToHighlight={postsToHighlight} + isFocusPost={true} /> ); } diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx index 22ddfc205..9e2fc32dd 100644 --- a/webapp/components/sidebar_right.jsx +++ b/webapp/components/sidebar_right.jsx @@ -10,8 +10,6 @@ import PostStore from 'stores/post_store.jsx'; import UserStore from 'stores/user_store.jsx'; import * as Utils from 'utils/utils.jsx'; -const SIDEBAR_SCROLL_DELAY = 500; - import React from 'react'; export default class SidebarRight extends React.Component { @@ -55,8 +53,8 @@ export default class SidebarRight extends React.Component { const isOpen = this.state.searchVisible || this.state.postRightVisible; const willOpen = nextState.searchVisible || nextState.postRightVisible; - if (!isOpen && willOpen) { - setTimeout(() => PostStore.jumpPostsViewSidebarOpen(), SIDEBAR_SCROLL_DELAY); + if (isOpen !== willOpen) { + PostStore.jumpPostsViewSidebarOpen(); } } doStrangeThings() { diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index 6260e179c..2184b9fab 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -31,7 +31,7 @@ export default class SuggestionBox extends React.Component { } componentDidMount() { - $(document).on('click', this.handleDocumentClick); + $(document).on('click touchstart', this.handleDocumentClick); SuggestionStore.addCompleteWordListener(this.suggestionId, this.handleCompleteWord); SuggestionStore.addPretextChangedListener(this.suggestionId, this.handlePretextChanged); @@ -42,7 +42,7 @@ export default class SuggestionBox extends React.Component { SuggestionStore.removePretextChangedListener(this.suggestionId, this.handlePretextChanged); SuggestionStore.unregisterSuggestionBox(this.suggestionId); - $(document).off('click', this.handleDocumentClick); + $(document).off('click touchstart', this.handleDocumentClick); } getTextbox() { @@ -58,6 +58,11 @@ export default class SuggestionBox extends React.Component { handleDocumentClick(e) { const container = $(ReactDOM.findDOMNode(this)); + if ($('.suggestion-list__content').length) { + if (!($(e.target).hasClass('suggestion-list__content') || $(e.target).parents().hasClass('suggestion-list__content'))) { + $('body').removeClass('modal-open'); + } + } if (!(container.is(e.target) || container.has(e.target).length > 0)) { // we can't just use blur for this because it fires and hides the children before // their click handlers can be called diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx index 134e7a8d4..f1cccf8aa 100644 --- a/webapp/components/suggestion/suggestion_list.jsx +++ b/webapp/components/suggestion/suggestion_list.jsx @@ -51,6 +51,7 @@ export default class SuggestionList extends React.Component { } getContent() { + $('body').addClass('modal-open'); return $(ReactDOM.findDOMNode(this.refs.content)); } diff --git a/webapp/components/user_settings/user_settings.jsx b/webapp/components/user_settings/user_settings.jsx index d89298cfb..cf69a564f 100644 --- a/webapp/components/user_settings/user_settings.jsx +++ b/webapp/components/user_settings/user_settings.jsx @@ -16,7 +16,6 @@ export default class UserSettings extends React.Component { constructor(props) { super(props); - this.getActiveTab = this.getActiveTab.bind(this); this.onListenerChange = this.onListenerChange.bind(this); this.state = {user: UserStore.getCurrentUser()}; @@ -30,10 +29,6 @@ export default class UserSettings extends React.Component { UserStore.removeChangeListener(this.onListenerChange); } - getActiveTab() { - return this.refs.activeTab; - } - onListenerChange() { var user = UserStore.getCurrentUser(); if (!utils.areObjectsEqual(this.state.user, user)) { @@ -46,7 +41,6 @@ export default class UserSettings extends React.Component { return ( <div> <GeneralTab - ref='activeTab' user={this.state.user} activeSection={this.props.activeSection} updateSection={this.props.updateSection} @@ -60,7 +54,6 @@ export default class UserSettings extends React.Component { return ( <div> <SecurityTab - ref='activeTab' user={this.state.user} activeSection={this.props.activeSection} updateSection={this.props.updateSection} @@ -75,7 +68,6 @@ export default class UserSettings extends React.Component { return ( <div> <NotificationsTab - ref='activeTab' user={this.state.user} activeSection={this.props.activeSection} updateSection={this.props.updateSection} @@ -89,7 +81,6 @@ export default class UserSettings extends React.Component { return ( <div> <DeveloperTab - ref='activeTab' activeSection={this.props.activeSection} updateSection={this.props.updateSection} closeModal={this.props.closeModal} @@ -101,7 +92,6 @@ export default class UserSettings extends React.Component { return ( <div> <DisplayTab - ref='activeTab' user={this.state.user} activeSection={this.props.activeSection} updateSection={this.props.updateSection} @@ -117,7 +107,6 @@ export default class UserSettings extends React.Component { return ( <div> <AdvancedTab - ref='activeTab' user={this.state.user} activeSection={this.props.activeSection} updateSection={this.props.updateSection} diff --git a/webapp/components/user_settings/user_settings_display.jsx b/webapp/components/user_settings/user_settings_display.jsx index f7a030e52..1b6ce3343 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -41,12 +41,15 @@ export default class UserSettingsDisplay extends React.Component { this.handleFont = this.handleFont.bind(this); this.updateSection = this.updateSection.bind(this); this.updateState = this.updateState.bind(this); - this.deactivate = this.deactivate.bind(this); this.createCollapseSection = this.createCollapseSection.bind(this); this.state = getDisplayStateFromStores(); } + componentWillUnmount() { + Utils.applyFont(PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', Constants.DEFAULT_FONT)); + } + handleSubmit() { const userId = UserStore.getCurrentId(); @@ -136,10 +139,6 @@ export default class UserSettingsDisplay extends React.Component { } } - deactivate() { - this.updateState(); - } - createCollapseSection() { if (this.props.activeSection === 'collapse') { const collapseFormat = [false, false]; diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index bd1e2829d..e586c9290 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -596,7 +596,7 @@ class UserSettingsGeneralTab extends React.Component { <span> <FormattedMessage id='user.settings.general.field_handled_externally' - defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so though your login provider.' + defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.' /> </span> ); diff --git a/webapp/components/user_settings/user_settings_modal.jsx b/webapp/components/user_settings/user_settings_modal.jsx index 43fb728bd..4ceb85bb8 100644 --- a/webapp/components/user_settings/user_settings_modal.jsx +++ b/webapp/components/user_settings/user_settings_modal.jsx @@ -65,7 +65,6 @@ class UserSettingsModal extends React.Component { this.handleConfirm = this.handleConfirm.bind(this); this.handleCancelConfirmation = this.handleCancelConfirmation.bind(this); - this.deactivateTab = this.deactivateTab.bind(this); this.closeModal = this.closeModal.bind(this); this.collapseModal = this.collapseModal.bind(this); @@ -108,7 +107,6 @@ class UserSettingsModal extends React.Component { return; } - this.deactivateTab(); this.props.onModalDismissed(); return; } @@ -125,8 +123,6 @@ class UserSettingsModal extends React.Component { handleCollapse() { $(ReactDOM.findDOMNode(this.refs.modalBody)).closest('.modal-dialog').removeClass('display--content'); - this.deactivateTab(); - this.setState({ active_tab: '', active_section: '' @@ -167,14 +163,6 @@ class UserSettingsModal extends React.Component { } } - // Called to let settings tab perform cleanup before being closed - deactivateTab() { - const activeTab = this.refs.userSettings.getActiveTab(); - if (activeTab && activeTab.deactivate) { - activeTab.deactivate(); - } - } - // Called by settings tabs when their close button is pressed closeModal() { if (this.requireConfirm) { @@ -197,8 +185,6 @@ class UserSettingsModal extends React.Component { if (!skipConfirm && this.requireConfirm) { this.showConfirmModal(() => this.updateTab(tab, true)); } else { - this.deactivateTab(); - this.setState({ active_tab: tab, active_section: '' |