diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/admin_console/image_settings.jsx | 5 | ||||
-rw-r--r-- | web/react/components/admin_console/user_item.jsx | 4 | ||||
-rw-r--r-- | web/react/components/member_list_item.jsx | 4 | ||||
-rw-r--r-- | web/react/components/member_list_team_item.jsx | 4 | ||||
-rw-r--r-- | web/react/components/more_channels.jsx | 2 | ||||
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 4 | ||||
-rw-r--r-- | web/react/components/posts_view.jsx | 6 | ||||
-rw-r--r-- | web/react/components/search_results.jsx | 30 | ||||
-rw-r--r-- | web/react/components/search_results_item.jsx | 6 | ||||
-rw-r--r-- | web/react/components/signup_user_complete.jsx | 11 | ||||
-rw-r--r-- | web/react/components/user_settings/manage_command_hooks.jsx | 6 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_advanced.jsx | 4 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_display.jsx | 75 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_modal.jsx | 2 |
14 files changed, 92 insertions, 71 deletions
diff --git a/web/react/components/admin_console/image_settings.jsx b/web/react/components/admin_console/image_settings.jsx index 12bf554ea..86f78e093 100644 --- a/web/react/components/admin_console/image_settings.jsx +++ b/web/react/components/admin_console/image_settings.jsx @@ -8,10 +8,6 @@ import crypto from 'crypto'; import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl'; const holders = defineMessages({ - storeDisabled: { - id: 'admin.image.storeDisabled', - defaultMessage: 'Disable File Storage' - }, storeLocal: { id: 'admin.image.storeLocal', defaultMessage: 'Local File System' @@ -242,7 +238,6 @@ class FileSettings extends React.Component { defaultValue={this.props.config.FileSettings.DriverName} onChange={this.handleChange.bind(this, 'DriverName')} > - <option value=''>{formatMessage(holders.storeDisabled)}</option> <option value='local'>{formatMessage(holders.storeLocal)}</option> <option value='amazons3'>{formatMessage(holders.storeAmazonS3)}</option> </select> diff --git a/web/react/components/admin_console/user_item.jsx b/web/react/components/admin_console/user_item.jsx index 02b01b090..0c1a55cc1 100644 --- a/web/react/components/admin_console/user_item.jsx +++ b/web/react/components/admin_console/user_item.jsx @@ -360,8 +360,8 @@ export default class UserItem extends React.Component { height='36' width='36' /> - <span className='member-name'>{Utils.getDisplayName(user)}</span> - <span className='member-email'>{email}</span> + <span className='more-name'>{Utils.getDisplayName(user)}</span> + <span className='more-description'>{email}</span> <div className='dropdown member-drop'> <a href='#' diff --git a/web/react/components/member_list_item.jsx b/web/react/components/member_list_item.jsx index c50ee5c96..41ea58eeb 100644 --- a/web/react/components/member_list_item.jsx +++ b/web/react/components/member_list_item.jsx @@ -124,8 +124,8 @@ export default class MemberListItem extends React.Component { height='36' width='36' /> - <div className='member-name'>{Utils.displayUsername(member.id)}</div> - <div className='member-description'>{member.email}</div> + <div className='more-name'>{Utils.displayUsername(member.id)}</div> + <div className='more-description'>{member.email}</div> </td> <td className='td--action lg'>{invite}</td> </tr> diff --git a/web/react/components/member_list_team_item.jsx b/web/react/components/member_list_team_item.jsx index 6e1006911..30086d1b2 100644 --- a/web/react/components/member_list_team_item.jsx +++ b/web/react/components/member_list_team_item.jsx @@ -208,8 +208,8 @@ export default class MemberListTeamItem extends React.Component { height='36' width='36' /> - <span className='member-name'>{Utils.displayUsername(user.id)}</span> - <span className='member-email'>{email}</span> + <span className='more-name'>{Utils.displayUsername(user.id)}</span> + <span className='more-description'>{email}</span> <div className='dropdown member-drop'> <a href='#' diff --git a/web/react/components/more_channels.jsx b/web/react/components/more_channels.jsx index d12ea4703..d800f93d8 100644 --- a/web/react/components/more_channels.jsx +++ b/web/react/components/more_channels.jsx @@ -114,7 +114,7 @@ export default class MoreChannels extends React.Component { <tr key={channel.id}> <td> <p className='more-name'>{channel.display_name}</p> - <p className='more-purpose'>{channel.purpose}</p> + <p className='more-description'>{channel.purpose}</p> </td> <td className='td--action'> {joinButton} diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index f8a6884d0..3b72b251c 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -57,7 +57,7 @@ class MoreDirectChannels extends React.Component { } componentWillUnmount() { - UserStore.addChangeListener(this.handleUserChange); + UserStore.removeChangeListener(this.handleUserChange); } componentDidUpdate(prevProps) { @@ -318,4 +318,4 @@ MoreDirectChannels.propTypes = { onModalDismissed: React.PropTypes.func }; -export default injectIntl(MoreDirectChannels);
\ No newline at end of file +export default injectIntl(MoreDirectChannels); diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index f108ace2e..ebe19abad 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -94,7 +94,7 @@ export default class PostsView extends React.Component { }); } - this.scrollStopAction.fireAfter(1000); + this.scrollStopAction.fireAfter(2000); } handleScrollStop() { this.setState({ @@ -564,6 +564,8 @@ function ScrollToBottomArrows({isScrolling, atBottom, onClick}) { <div className={className} onClick={onClick} - /> + > + <span dangerouslySetInnerHTML={{__html: Constants.SCROLL_BOTTOM_ICON}} /> + </div> ); } diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx index 9dcc99061..4adc3afe0 100644 --- a/web/react/components/search_results.jsx +++ b/web/react/components/search_results.jsx @@ -1,6 +1,7 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. +import ChannelStore from '../stores/channel_store.jsx'; import SearchStore from '../stores/search_store.jsx'; import UserStore from '../stores/user_store.jsx'; import SearchBox from './search_bar.jsx'; @@ -11,7 +12,22 @@ import SearchResultsItem from './search_results_item.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'mm-intl'; function getStateFromStores() { - return {results: SearchStore.getSearchResults()}; + const results = SearchStore.getSearchResults(); + + const channels = new Map(); + const channelIds = results.order.map((postId) => results.posts[postId].channel_id); + for (const id of channelIds) { + if (channels.has(id)) { + continue; + } + + channels.set(id, ChannelStore.get(id)); + } + + return { + results, + channels + }; } export default class SearchResults extends React.Component { @@ -33,16 +49,22 @@ export default class SearchResults extends React.Component { componentDidMount() { this.mounted = true; SearchStore.addSearchChangeListener(this.onChange); + ChannelStore.addChangeListener(this.onChange); this.resize(); window.addEventListener('resize', this.handleResize); } + shouldComponentUpdate(nextProps, nextState) { + return !Utils.areObjectsEqual(this.props, nextProps) || !Utils.areObjectsEqual(this.state, nextState); + } + componentDidUpdate() { this.resize(); } componentWillUnmount() { SearchStore.removeSearchChangeListener(this.onChange); + ChannelStore.removeChangeListener(this.onChange); this.mounted = false; window.removeEventListener('resize', this.handleResize); } @@ -56,10 +78,7 @@ export default class SearchResults extends React.Component { onChange() { if (this.mounted) { - var newState = getStateFromStores(); - if (!Utils.areObjectsEqual(newState, this.state)) { - this.setState(newState); - } + this.setState(getStateFromStores()); } } @@ -116,6 +135,7 @@ export default class SearchResults extends React.Component { return ( <SearchResultsItem key={post.id} + channel={this.state.channels.get(post.channel_id)} post={post} term={searchTerm} isMentionSearch={this.props.isMentionSearch} diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx index 544ba920a..d3533037f 100644 --- a/web/react/components/search_results_item.jsx +++ b/web/react/components/search_results_item.jsx @@ -1,7 +1,6 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import ChannelStore from '../stores/channel_store.jsx'; import UserStore from '../stores/user_store.jsx'; import UserProfile from './user_profile.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; @@ -37,8 +36,8 @@ export default class SearchResultsItem extends React.Component { } render() { - var channelName = ''; - var channel = ChannelStore.get(this.props.post.channel_id); + var channelName = null; + const channel = this.props.channel; var timestamp = UserStore.getCurrentUser().update_at; if (channel) { @@ -136,6 +135,7 @@ export default class SearchResultsItem extends React.Component { SearchResultsItem.propTypes = { post: React.PropTypes.object, + channel: React.PropTypes.object, isMentionSearch: React.PropTypes.bool, term: React.PropTypes.string }; diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index 672213d1a..b770a2a2c 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -362,6 +362,17 @@ class SignupUserComplete extends React.Component { ); } + if (signupMessage.length === 0 && !emailSignup) { + emailSignup = ( + <div> + <FormattedMessage + id='signup_user_completed.none' + defaultMessage='No user creation method has been enabled. Please contact an administrator for access.' + /> + </div> + ); + } + return ( <div> <form> diff --git a/web/react/components/user_settings/manage_command_hooks.jsx b/web/react/components/user_settings/manage_command_hooks.jsx index d23d2957e..3656424b2 100644 --- a/web/react/components/user_settings/manage_command_hooks.jsx +++ b/web/react/components/user_settings/manage_command_hooks.jsx @@ -271,7 +271,7 @@ export default class ManageCommandCmds extends React.Component { cmds.push( <div key={cmd.id} - className='webcmd__item' + className='webhook__item webcmd__item' > <div className='padding-top x2'> <strong> @@ -400,7 +400,7 @@ export default class ManageCommandCmds extends React.Component { } const existingCmds = ( - <div className='webcmds__container'> + <div className='webhooks__container webcmds__container'> <label className='control-label padding-top x2'> <FormattedMessage id='user.settings.cmds.existing' @@ -408,7 +408,7 @@ export default class ManageCommandCmds extends React.Component { /> </label> <div className='padding-top divider-light'></div> - <div className='webcmds__list'> + <div className='webhooks__list webcmds__list'> {displayCmds} </div> </div> diff --git a/web/react/components/user_settings/user_settings_advanced.jsx b/web/react/components/user_settings/user_settings_advanced.jsx index 5c0757589..e513f81d2 100644 --- a/web/react/components/user_settings/user_settings_advanced.jsx +++ b/web/react/components/user_settings/user_settings_advanced.jsx @@ -47,10 +47,6 @@ const holders = defineMessages({ EMBED_PREVIEW: { id: 'user.settings.advance.embed_preview', defaultMessage: 'Show preview snippet of links below message' - }, - LOC_PREVIEW: { - id: 'user.settings.advance.loc_preview', - defaultMessage: 'Show user language in display settings' } }); diff --git a/web/react/components/user_settings/user_settings_display.jsx b/web/react/components/user_settings/user_settings_display.jsx index 4b11c06fb..5f23a8995 100644 --- a/web/react/components/user_settings/user_settings_display.jsx +++ b/web/react/components/user_settings/user_settings_display.jsx @@ -10,7 +10,6 @@ import PreferenceStore from '../../stores/preference_store.jsx'; import * as Utils from '../../utils/utils.jsx'; import Constants from '../../utils/constants.jsx'; -const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES; import {savePreferences} from '../../utils/client.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; @@ -379,46 +378,44 @@ class UserSettingsDisplay extends React.Component { ); } - if (Utils.isFeatureEnabled(PreReleaseFeatures.LOC_PREVIEW)) { - if (this.props.activeSection === 'languages') { - var inputs = []; - inputs.push( - <ManageLanguages - user={this.props.user} - key='languages-ui' - /> - ); + if (this.props.activeSection === 'languages') { + var inputs = []; + inputs.push( + <ManageLanguages + user={this.props.user} + key='languages-ui' + /> + ); - languagesSection = ( - <SettingItemMax - title={formatMessage(holders.language)} - width='medium' - inputs={inputs} - updateSection={(e) => { - this.updateSection(''); - e.preventDefault(); - }} - /> - ); - } else { - var locale = 'English'; - Utils.languages().forEach((l) => { - if (l.value === this.props.user.locale) { - locale = l.name; - } - }); + languagesSection = ( + <SettingItemMax + title={formatMessage(holders.language)} + width='medium' + inputs={inputs} + updateSection={(e) => { + this.updateSection(''); + e.preventDefault(); + }} + /> + ); + } else { + var locale = 'English'; + Utils.languages().forEach((l) => { + if (l.value === this.props.user.locale) { + locale = l.name; + } + }); - languagesSection = ( - <SettingItemMin - title={formatMessage(holders.language)} - width='medium' - describe={locale} - updateSection={() => { - this.updateSection('languages'); - }} - /> - ); - } + languagesSection = ( + <SettingItemMin + title={formatMessage(holders.language)} + width='medium' + describe={locale} + updateSection={() => { + this.updateSection('languages'); + }} + /> + ); } return ( diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx index e0b72157b..90f28822b 100644 --- a/web/react/components/user_settings/user_settings_modal.jsx +++ b/web/react/components/user_settings/user_settings_modal.jsx @@ -234,7 +234,7 @@ class UserSettingsModal extends React.Component { tabs.push({name: 'developer', uiName: formatMessage(holders.developer), icon: 'glyphicon glyphicon-th'}); } - if (global.window.mm_config.EnableIncomingWebhooks === 'true' || global.window.mm_config.EnableOutgoingWebhooks === 'true') { + if (global.window.mm_config.EnableIncomingWebhooks === 'true' || global.window.mm_config.EnableOutgoingWebhooks === 'true' || global.window.mm_config.EnableCommands === 'true') { tabs.push({name: 'integrations', uiName: formatMessage(holders.integrations), icon: 'glyphicon glyphicon-transfer'}); } tabs.push({name: 'display', uiName: formatMessage(holders.display), icon: 'glyphicon glyphicon-eye-open'}); |