diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-04-03 08:42:05 -0400 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-04-03 13:42:05 +0100 |
commit | 36c74d7b47253249ec83aedacf409a93de1d182f (patch) | |
tree | d603e715c19b7d6173f430b7bc929ba3a57f45d7 /webapp/components | |
parent | 06e09a05530699be1319a339d027eb508bf24617 (diff) | |
download | chat-36c74d7b47253249ec83aedacf409a93de1d182f.tar.gz chat-36c74d7b47253249ec83aedacf409a93de1d182f.tar.bz2 chat-36c74d7b47253249ec83aedacf409a93de1d182f.zip |
PLT-5873 Renamed private groups to private channels (#5924)
* PLT-5873 Renamed private groups to private channels in web app
* PLT-5873 Renamed private groups to private channels in server
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/admin_console/policy_settings.jsx | 12 | ||||
-rw-r--r-- | webapp/components/analytics/system_analytics.jsx | 54 | ||||
-rw-r--r-- | webapp/components/analytics/team_analytics.jsx | 2 | ||||
-rw-r--r-- | webapp/components/audit_table.jsx | 12 | ||||
-rw-r--r-- | webapp/components/change_url_modal.jsx | 29 | ||||
-rw-r--r-- | webapp/components/channel_header.jsx | 40 | ||||
-rw-r--r-- | webapp/components/delete_channel_modal.jsx | 21 | ||||
-rw-r--r-- | webapp/components/edit_channel_purpose_modal.jsx | 20 | ||||
-rw-r--r-- | webapp/components/integrations/components/abstract_incoming_webhook.jsx | 2 | ||||
-rw-r--r-- | webapp/components/leave_team_modal.jsx | 2 | ||||
-rw-r--r-- | webapp/components/more_direct_channels.jsx | 4 | ||||
-rw-r--r-- | webapp/components/navbar.jsx | 40 | ||||
-rw-r--r-- | webapp/components/new_channel_flow.jsx | 63 | ||||
-rw-r--r-- | webapp/components/new_channel_modal.jsx | 33 | ||||
-rw-r--r-- | webapp/components/sidebar.jsx | 10 | ||||
-rw-r--r-- | webapp/components/suggestion/search_suggestion_list.jsx | 2 | ||||
-rw-r--r-- | webapp/components/tutorial/tutorial_intro_screens.jsx | 2 |
17 files changed, 100 insertions, 248 deletions
diff --git a/webapp/components/admin_console/policy_settings.jsx b/webapp/components/admin_console/policy_settings.jsx index c8c145b8d..13101e828 100644 --- a/webapp/components/admin_console/policy_settings.jsx +++ b/webapp/components/admin_console/policy_settings.jsx @@ -179,7 +179,7 @@ export default class PolicySettings extends AdminSettings { label={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelCreationTitle' - defaultMessage='Enable private group creation for:' + defaultMessage='Enable private channel creation for:' /> } value={this.state.restrictPrivateChannelCreation} @@ -187,7 +187,7 @@ export default class PolicySettings extends AdminSettings { helpText={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelCreationDescription' - defaultMessage='Set policy on who can create private groups.' + defaultMessage='Set policy on who can create private channels.' /> } /> @@ -202,7 +202,7 @@ export default class PolicySettings extends AdminSettings { label={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelManagementTitle' - defaultMessage='Enable private group renaming for:' + defaultMessage='Enable private channel renaming for:' /> } value={this.state.restrictPrivateChannelManagement} @@ -210,7 +210,7 @@ export default class PolicySettings extends AdminSettings { helpText={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelManagementDescription' - defaultMessage='Set policy on who can rename and set the header or purpose for private groups.' + defaultMessage='Set policy on who can rename and set the header or purpose for private channels.' /> } /> @@ -225,7 +225,7 @@ export default class PolicySettings extends AdminSettings { label={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelDeletionTitle' - defaultMessage='Enable private group deletion for:' + defaultMessage='Enable private channel deletion for:' /> } value={this.state.restrictPrivateChannelDeletion} @@ -233,7 +233,7 @@ export default class PolicySettings extends AdminSettings { helpText={ <FormattedMessage id='admin.general.policy.restrictPrivateChannelDeletionDescription' - defaultMessage='Set policy on who can delete private groups. Deleted groups can be recovered from the database using a {commandLineToolLink}.' + defaultMessage='Set policy on who can delete private channels. Deleted channels can be recovered from the database using a {commandLineToolLink}.' values={{ commandLineToolLink: ( <a diff --git a/webapp/components/analytics/system_analytics.jsx b/webapp/components/analytics/system_analytics.jsx index bd09b8b0b..b7a10f43b 100644 --- a/webapp/components/analytics/system_analytics.jsx +++ b/webapp/components/analytics/system_analytics.jsx @@ -12,34 +12,11 @@ import * as AsyncClient from 'utils/async_client.jsx'; import Constants from 'utils/constants.jsx'; const StatTypes = Constants.StatTypes; -import {injectIntl, intlShape, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl'; - -const holders = defineMessages({ - analyticsPublicChannels: { - id: 'analytics.system.publicChannels', - defaultMessage: 'Public Channels' - }, - analyticsPrivateGroups: { - id: 'analytics.system.privateGroups', - defaultMessage: 'Private Groups' - }, - analyticsFilePosts: { - id: 'analytics.system.totalFilePosts', - defaultMessage: 'Posts with Files' - }, - analyticsHashtagPosts: { - id: 'analytics.system.totalHashtagPosts', - defaultMessage: 'Posts with Hashtags' - }, - analyticsTextPosts: { - id: 'analytics.system.textPosts', - defaultMessage: 'Posts with Text-only' - } -}); +import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; import React from 'react'; -class SystemAnalytics extends React.Component { +export default class SystemAnalytics extends React.Component { constructor(props) { super(props); @@ -249,8 +226,8 @@ class SystemAnalytics extends React.Component { </div> ); - const channelTypeData = formatChannelDoughtnutData(stats[StatTypes.TOTAL_PUBLIC_CHANNELS], stats[StatTypes.TOTAL_PRIVATE_GROUPS], this.props.intl); - const postTypeData = formatPostDoughtnutData(stats[StatTypes.TOTAL_FILE_POSTS], stats[StatTypes.TOTAL_HASHTAG_POSTS], stats[StatTypes.TOTAL_POSTS], this.props.intl); + const channelTypeData = formatChannelDoughtnutData(stats[StatTypes.TOTAL_PUBLIC_CHANNELS], stats[StatTypes.TOTAL_PRIVATE_GROUPS]); + const postTypeData = formatPostDoughtnutData(stats[StatTypes.TOTAL_FILE_POSTS], stats[StatTypes.TOTAL_HASHTAG_POSTS], stats[StatTypes.TOTAL_POSTS]); let postTypeGraph; if (stats[StatTypes.TOTAL_POSTS] !== -1) { @@ -430,16 +407,12 @@ class SystemAnalytics extends React.Component { } } -SystemAnalytics.propTypes = { - intl: intlShape.isRequired -}; - -export default injectIntl(SystemAnalytics); - -export function formatChannelDoughtnutData(totalPublic, totalPrivate, intl) { - const {formatMessage} = intl; +export function formatChannelDoughtnutData(totalPublic, totalPrivate) { const channelTypeData = { - labels: [formatMessage(holders.analyticsPublicChannels), formatMessage(holders.analyticsPrivateGroups)], + labels: [ + Utils.localizeMessage('analytics.system.publicChannels', 'Public Channels'), + Utils.localizeMessage('analytics.system.privateGroups', 'Private Channels') + ], datasets: [{ data: [totalPublic, totalPrivate], backgroundColor: ['#46BFBD', '#FDB45C'], @@ -450,10 +423,13 @@ export function formatChannelDoughtnutData(totalPublic, totalPrivate, intl) { return channelTypeData; } -export function formatPostDoughtnutData(filePosts, hashtagPosts, totalPosts, intl) { - const {formatMessage} = intl; +export function formatPostDoughtnutData(filePosts, hashtagPosts, totalPosts) { const postTypeData = { - labels: [formatMessage(holders.analyticsFilePosts), formatMessage(holders.analyticsHashtagPosts), formatMessage(holders.analyticsTextPosts)], + labels: [ + Utils.localizeMessage('analytics.system.totalFilePosts', 'Posts with Files'), + Utils.localizeMessage('analytics.system.totalHashtagPosts', 'Posts with Hashtags'), + Utils.localizeMessage('analytics.system.textPosts', 'Posts with Text-only') + ], datasets: [{ data: [filePosts, hashtagPosts, (totalPosts - filePosts - hashtagPosts)], backgroundColor: ['#46BFBD', '#F7464A', '#FDB45C'], diff --git a/webapp/components/analytics/team_analytics.jsx b/webapp/components/analytics/team_analytics.jsx index 135bab4b4..cc179a370 100644 --- a/webapp/components/analytics/team_analytics.jsx +++ b/webapp/components/analytics/team_analytics.jsx @@ -270,7 +270,7 @@ export default class TeamAnalytics extends React.Component { title={ <FormattedMessage id='analytics.team.privateGroups' - defaultMessage='Private Groups' + defaultMessage='Private Channels' /> } icon='fa-globe' diff --git a/webapp/components/audit_table.jsx b/webapp/components/audit_table.jsx index 34e61dbac..e7d366f04 100644 --- a/webapp/components/audit_table.jsx +++ b/webapp/components/audit_table.jsx @@ -14,7 +14,7 @@ const holders = defineMessages({ }, channelCreated: { id: 'audit_table.channelCreated', - defaultMessage: 'Created the {channelName} channel/group' + defaultMessage: 'Created the {channelName} channel' }, establishedDM: { id: 'audit_table.establishedDM', @@ -22,23 +22,23 @@ const holders = defineMessages({ }, nameUpdated: { id: 'audit_table.nameUpdated', - defaultMessage: 'Updated the {channelName} channel/group name' + defaultMessage: 'Updated the {channelName} channel name' }, headerUpdated: { id: 'audit_table.headerUpdated', - defaultMessage: 'Updated the {channelName} channel/group header' + defaultMessage: 'Updated the {channelName} channel header' }, channelDeleted: { id: 'audit_table.channelDeleted', - defaultMessage: 'Deleted the channel/group with the URL {url}' + defaultMessage: 'Deleted the channel with the URL {url}' }, userAdded: { id: 'audit_table.userAdded', - defaultMessage: 'Added {username} to the {channelName} channel/group' + defaultMessage: 'Added {username} to the {channelName} channel' }, userRemoved: { id: 'audit_table.userRemoved', - defaultMessage: 'Removed {username} to the {channelName} channel/group' + defaultMessage: 'Removed {username} to the {channelName} channel' }, attemptedRegisterApp: { id: 'audit_table.attemptedRegisterApp', diff --git a/webapp/components/change_url_modal.jsx b/webapp/components/change_url_modal.jsx index 509517678..fd5cdfd74 100644 --- a/webapp/components/change_url_modal.jsx +++ b/webapp/components/change_url_modal.jsx @@ -25,6 +25,7 @@ export default class ChangeUrlModal extends React.Component { userEdit: false }; } + componentWillReceiveProps(nextProps) { // This check prevents the url being deleted when we re-render // because of user status check @@ -34,15 +35,18 @@ export default class ChangeUrlModal extends React.Component { }); } } + componentDidUpdate(prevProps) { if (this.props.show === true && prevProps.show === false) { ReactDOM.findDOMNode(this.refs.urlinput).select(); } } + onURLChanged(e) { const url = e.target.value.trim(); this.setState({currentURL: url.replace(/[^A-Za-z0-9-_]/g, '').toLowerCase(), userEdit: true}); } + getURLError(url) { let error = []; //eslint-disable-line prefer-const if (url.length < 2) { @@ -101,6 +105,7 @@ export default class ChangeUrlModal extends React.Component { } return error; } + doSubmit(e) { e.preventDefault(); @@ -113,10 +118,12 @@ export default class ChangeUrlModal extends React.Component { this.setState({urlError: '', userEdit: false}); this.props.onModalSubmit(url); } + doCancel() { this.setState({urlError: '', userEdit: false}); this.props.onModalDismissed(); } + render() { let urlClass = 'input-group input-group--limit'; let error = null; @@ -155,9 +162,19 @@ export default class ChangeUrlModal extends React.Component { className='form-horizontal' > <Modal.Body> - <div className='modal-intro'>{this.props.description}</div> + <div className='modal-intro'> + <FormattedMessage + id='channel_flow.changeUrlDescription' + defaultMessage='Some characters are now allowed in URLs and may be removed.' + /> + </div> <div className='form-group'> - <label className='col-sm-2 form__label control-label'>{this.props.urlLabel}</label> + <label className='col-sm-2 form__label control-label'> + <FormattedMessage + id='change_url.urlLabel' + defaultMessage='Channel URL' + /> + </label> <div className='col-sm-10'> <div className={urlClass}> <OverlayTrigger @@ -211,8 +228,6 @@ export default class ChangeUrlModal extends React.Component { ChangeUrlModal.defaultProps = { show: false, title: 'Change URL', - desciption: '', - urlLabel: 'URL', submitButtonText: 'Save', currentURL: '', serverError: null @@ -220,10 +235,8 @@ ChangeUrlModal.defaultProps = { ChangeUrlModal.propTypes = { show: React.PropTypes.bool.isRequired, - title: React.PropTypes.string, - description: React.PropTypes.string, - urlLabel: React.PropTypes.string, - submitButtonText: React.PropTypes.string, + title: React.PropTypes.node, + submitButtonText: React.PropTypes.node, currentURL: React.PropTypes.string, serverError: React.PropTypes.node, onModalSubmit: React.PropTypes.func.isRequired, diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx index 6ce56ab4e..9c9876419 100644 --- a/webapp/components/channel_header.jsx +++ b/webapp/components/channel_header.jsx @@ -349,21 +349,6 @@ export default class ChannelHeader extends React.Component { channelTitle = ChannelUtils.buildGroupChannelName(channel.id); } - let channelTerm = ( - <FormattedMessage - id='channel_header.channel' - defaultMessage='Channel' - /> - ); - if (channel.type === Constants.PRIVATE_CHANNEL) { - channelTerm = ( - <FormattedMessage - id='channel_header.group' - defaultMessage='Group' - /> - ); - } - let popoverListMembers; if (!isDirect) { popoverListMembers = ( @@ -560,10 +545,7 @@ export default class ChannelHeader extends React.Component { > <FormattedMessage id='channel_header.delete' - defaultMessage='Delete {term}' - values={{ - term: (channelTerm) - }} + defaultMessage='Delete Channel' /> </ToggleModalButton> </li> @@ -590,10 +572,7 @@ export default class ChannelHeader extends React.Component { > <FormattedMessage id='channel_header.setHeader' - defaultMessage='Edit {term} Header' - values={{ - term: (channelTerm) - }} + defaultMessage='Edit Channel Header' /> </ToggleModalButton> </li> @@ -612,10 +591,7 @@ export default class ChannelHeader extends React.Component { > <FormattedMessage id='channel_header.setPurpose' - defaultMessage='Edit {term} Purpose' - values={{ - term: (channelTerm) - }} + defaultMessage='Edit Channel Purpose' /> </a> </li> @@ -634,10 +610,7 @@ export default class ChannelHeader extends React.Component { > <FormattedMessage id='channel_header.rename' - defaultMessage='Rename {term}' - values={{ - term: (channelTerm) - }} + defaultMessage='Rename Channel' /> </a> </li> @@ -674,10 +647,7 @@ export default class ChannelHeader extends React.Component { > <FormattedMessage id='channel_header.leave' - defaultMessage='Leave {term}' - values={{ - term: (channelTerm) - }} + defaultMessage='Leave Channel' /> </a> </li> diff --git a/webapp/components/delete_channel_modal.jsx b/webapp/components/delete_channel_modal.jsx index a6577a4a9..1893d28d1 100644 --- a/webapp/components/delete_channel_modal.jsx +++ b/webapp/components/delete_channel_modal.jsx @@ -3,7 +3,6 @@ import {Modal} from 'react-bootstrap'; import TeamStore from 'stores/team_store.jsx'; -import Constants from 'utils/constants.jsx'; import {FormattedMessage} from 'react-intl'; @@ -37,21 +36,6 @@ export default class DeleteChannelModal extends React.Component { } render() { - let channelTerm = ( - <FormattedMessage - id='delete_channel.channel' - defaultMessage='channel' - /> - ); - if (this.props.channel.type === Constants.PRIVATE_CHANNEL) { - channelTerm = ( - <FormattedMessage - id='delete_channel.group' - defaultMessage='group' - /> - ); - } - return ( <Modal show={this.state.show} @@ -70,10 +54,9 @@ export default class DeleteChannelModal extends React.Component { <div className='alert alert-danger'> <FormattedMessage id='delete_channel.question' - defaultMessage='This will delete the channel from the team and make its contents inaccessible for all users. Are you sure you wish to delete the {display_name} {term}?' + defaultMessage='This will delete the channel from the team and make its contents inaccessible for all users. Are you sure you wish to delete the {display_name} channel?' values={{ - display_name: this.props.channel.display_name, - term: (channelTerm) + display_name: this.props.channel.display_name }} /> </div> diff --git a/webapp/components/edit_channel_purpose_modal.jsx b/webapp/components/edit_channel_purpose_modal.jsx index 7ee00baba..ea34cf969 100644 --- a/webapp/components/edit_channel_purpose_modal.jsx +++ b/webapp/components/edit_channel_purpose_modal.jsx @@ -110,21 +110,6 @@ export default class EditChannelPurposeModal extends React.Component { ); } - let channelType = ( - <FormattedMessage - id='edit_channel_purpose_modal.channel' - defaultMessage='Channel' - /> - ); - if (this.props.channel.type === Constants.PRIVATE_CHANNEL) { - channelType = ( - <FormattedMessage - id='edit_channel_purpose_modal.group' - defaultMessage='Group' - /> - ); - } - return ( <Modal className='modal-edit-channel-purpose' @@ -142,10 +127,7 @@ export default class EditChannelPurposeModal extends React.Component { <p> <FormattedMessage id='edit_channel_purpose_modal.body' - defaultMessage='Describe how this {type} should be used. This text appears in the channel list in the "More..." menu and helps others decide whether to join.' - values={{ - type: (channelType) - }} + defaultMessage='Describe how this channel should be used. This text appears in the channel list in the "More..." menu and helps others decide whether to join.' /> </p> <textarea diff --git a/webapp/components/integrations/components/abstract_incoming_webhook.jsx b/webapp/components/integrations/components/abstract_incoming_webhook.jsx index eda545bb1..15e39e54b 100644 --- a/webapp/components/integrations/components/abstract_incoming_webhook.jsx +++ b/webapp/components/integrations/components/abstract_incoming_webhook.jsx @@ -203,7 +203,7 @@ export default class AbstractIncomingWebhook extends React.Component { <div className='form__help'> <FormattedMessage id='add_incoming_webhook.channel.help' - defaultMessage='Public channel or private group that receives the webhook payloads. You must belong to the private group when setting up the webhook.' + defaultMessage='Public or private channel that receives the webhook payloads. You must belong to the private channel when setting up the webhook.' /> </div> </div> diff --git a/webapp/components/leave_team_modal.jsx b/webapp/components/leave_team_modal.jsx index f8f5675c7..69504ef4d 100644 --- a/webapp/components/leave_team_modal.jsx +++ b/webapp/components/leave_team_modal.jsx @@ -81,7 +81,7 @@ class LeaveTeamModal extends React.Component { <Modal.Body> <FormattedMessage id='leave_team_modal.desc' - defaultMessage='You will be removed from all public channels and private groups. If the team is private you will not be able to rejoin the team. Are you sure?' + defaultMessage='You will be removed from all public and private channels. If the team is private you will not be able to rejoin the team. Are you sure?' /> </Modal.Body> <Modal.Footer> diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx index c4a3a3526..4d5016907 100644 --- a/webapp/components/more_direct_channels.jsx +++ b/webapp/components/more_direct_channels.jsx @@ -266,14 +266,14 @@ export default class MoreDirectChannels extends React.Component { note = ( <FormattedMessage id='more_direct_channels.new_convo_note.full' - defaultMessage='You’ve reached the maximum number of people for this conversation. Consider creating a private group instead.' + defaultMessage='You’ve reached the maximum number of people for this conversation. Consider creating a private channel instead.' /> ); } else { note = ( <FormattedMessage id='more_direct_channels.new_convo_note' - defaultMessage='This will start a new conversation. If you’re adding a lot of people, consider creating a private group instead.' + defaultMessage='This will start a new conversation. If you’re adding a lot of people, consider creating a private channel instead.' /> ); } diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 28d8fae05..62fb61d97 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -241,21 +241,6 @@ export default class Navbar extends React.Component { createDropdown(channel, channelTitle, isAdmin, isSystemAdmin, isChannelAdmin, isDirect, isGroup, popoverContent) { if (channel) { - let channelTerm = ( - <FormattedMessage - id='channel_header.channel' - defaultMessage='Channel' - /> - ); - if (channel.type === Constants.PRIVATE_CHANNEL) { - channelTerm = ( - <FormattedMessage - id='channel_header.group' - defaultMessage='Group' - /> - ); - } - let viewInfoOption; let viewPinnedPostsOption; let addMembersOption; @@ -449,10 +434,7 @@ export default class Navbar extends React.Component { > <FormattedMessage id='channel_header.setHeader' - defaultMessage='Set {term} Header...' - values={{ - term: (channelTerm) - }} + defaultMessage='Edit Channel Header' /> </a> </li> @@ -467,10 +449,7 @@ export default class Navbar extends React.Component { > <FormattedMessage id='channel_header.setPurpose' - defaultMessage='Set {term} Purpose...' - values={{ - term: (channelTerm) - }} + defaultMessage='Edit Channel Purpose' /> </a> </li> @@ -485,10 +464,7 @@ export default class Navbar extends React.Component { > <FormattedMessage id='channel_header.rename' - defaultMessage='Rename {term}...' - values={{ - term: (channelTerm) - }} + defaultMessage='Rename Channel' /> </a> </li> @@ -506,10 +482,7 @@ export default class Navbar extends React.Component { > <FormattedMessage id='channel_header.delete' - defaultMessage='Delete {term}...' - values={{ - term: (channelTerm) - }} + defaultMessage='Delete Channel' /> </ToggleModalButton> </li> @@ -528,10 +501,7 @@ export default class Navbar extends React.Component { > <FormattedMessage id='channel_header.leave' - defaultMessage='Leave {term}' - values={{ - term: (channelTerm) - }} + defaultMessage='Leave Channel' /> </a> </li> diff --git a/webapp/components/new_channel_flow.jsx b/webapp/components/new_channel_flow.jsx index eb67c9cba..55e47b149 100644 --- a/webapp/components/new_channel_flow.jsx +++ b/webapp/components/new_channel_flow.jsx @@ -9,43 +9,17 @@ import {cleanUpUrlable} from 'utils/url.jsx'; import NewChannelModal from './new_channel_modal.jsx'; import ChangeURLModal from './change_url_modal.jsx'; -import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'react-intl'; +import {FormattedMessage} from 'react-intl'; import {createChannel} from 'actions/channel_actions.jsx'; import {browserHistory} from 'react-router/es6'; const SHOW_NEW_CHANNEL = 1; const SHOW_EDIT_URL = 2; const SHOW_EDIT_URL_THEN_COMPLETE = 3; -const messages = defineMessages({ - channel: { - id: 'channel_flow.channel', - defaultMessage: 'Channel' - }, - group: { - id: 'channel_flow.group', - defaultMessage: 'Group' - }, - change: { - id: 'channel_flow.changeUrlTitle', - defaultMessage: 'Change {term} URL' - }, - set: { - id: 'channel_flow.set_url_title', - defaultMessage: 'Set {term} URL' - }, - create: { - id: 'channel_flow.create', - defaultMessage: 'Create {term}' - }, - changeUrlDescription: { - id: 'channel_flow.changeUrlDescription', - defaultMessage: 'Some characters are not allowed in URLs and may be removed.' - } -}); import React from 'react'; -class NewChannelFlow extends React.Component { +export default class NewChannelFlow extends React.Component { constructor(props) { super(props); @@ -182,9 +156,6 @@ class NewChannelFlow extends React.Component { let changeURLTitle = ''; let changeURLSubmitButtonText = ''; - let channelTerm = ''; - - const {formatMessage} = this.props.intl; // Only listen to flow state if we are being shown if (this.props.show) { @@ -192,21 +163,34 @@ class NewChannelFlow extends React.Component { case SHOW_NEW_CHANNEL: if (this.state.channelType === 'O') { showChannelModal = true; - channelTerm = formatMessage(messages.channel); } else { showGroupModal = true; - channelTerm = formatMessage(messages.group); } break; case SHOW_EDIT_URL: showChangeURLModal = true; - changeURLTitle = formatMessage(messages.change, {term: channelTerm}); - changeURLSubmitButtonText = formatMessage(messages.change, {term: channelTerm}); + changeURLTitle = ( + <FormattedMessage + id='channel_flow.changeUrlTitle' + defaultMessage='Change Channel URL' + /> + ); + changeURLSubmitButtonText = changeURLTitle; break; case SHOW_EDIT_URL_THEN_COMPLETE: showChangeURLModal = true; - changeURLTitle = formatMessage(messages.set, {term: channelTerm}); - changeURLSubmitButtonText = formatMessage(messages.create, {term: channelTerm}); + changeURLTitle = ( + <FormattedMessage + id='channel_flow.set_url_title' + defaultMessage='Set Channel URL' + /> + ); + changeURLSubmitButtonText = ( + <FormattedMessage + id='channel_flow.create' + defaultMessage='Create Channel' + /> + ); break; } } @@ -239,8 +223,6 @@ class NewChannelFlow extends React.Component { <ChangeURLModal show={showChangeURLModal} title={changeURLTitle} - description={formatMessage(messages.changeUrlDescription)} - urlLabel={channelTerm + ' URL'} submitButtonText={changeURLSubmitButtonText} currentURL={this.state.channelName} serverError={this.state.serverError} @@ -259,10 +241,7 @@ NewChannelFlow.defaultProps = { }; NewChannelFlow.propTypes = { - intl: intlShape.isRequired, show: React.PropTypes.bool.isRequired, channelType: React.PropTypes.string.isRequired, onModalDismissed: React.PropTypes.func.isRequired }; - -export default injectIntl(NewChannelFlow); diff --git a/webapp/components/new_channel_modal.jsx b/webapp/components/new_channel_modal.jsx index f16b4596f..b515d5469 100644 --- a/webapp/components/new_channel_modal.jsx +++ b/webapp/components/new_channel_modal.jsx @@ -135,7 +135,7 @@ export default class NewChannelModal extends React.Component { > <FormattedMessage id='channel_modal.privateGroup2' - defaultMessage='Create a private group' + defaultMessage='Create a private channel' /> </a> ); @@ -151,33 +151,20 @@ export default class NewChannelModal extends React.Component { createPrivateChannelLink = null; } - var channelTerm = ''; var channelSwitchText = ''; switch (this.props.channelType) { case 'P': - channelTerm = ( - <FormattedMessage - id='channel_modal.group' - defaultMessage='Group' - /> - ); channelSwitchText = ( <div className='modal-intro'> <FormattedMessage id='channel_modal.privateGroup1' - defaultMessage='Create a new private group with restricted membership. ' + defaultMessage='Create a new private channel with restricted membership. ' /> {createPublicChannelLink} </div> ); break; case 'O': - channelTerm = ( - <FormattedMessage - id='channel_modal.channel' - defaultMessage='Channel' - /> - ); channelSwitchText = ( <div className='modal-intro'> <FormattedMessage @@ -205,9 +192,8 @@ export default class NewChannelModal extends React.Component { <Modal.Title> <FormattedMessage id='channel_modal.modalTitle' - defaultMessage='New ' + defaultMessage='New Channel' /> - {channelTerm} </Modal.Title> </Modal.Header> <form @@ -282,10 +268,7 @@ export default class NewChannelModal extends React.Component { <p className='input__help'> <FormattedMessage id='channel_modal.descriptionHelp' - defaultMessage='Describe how this {term} should be used.' - values={{ - term: (channelTerm) - }} + defaultMessage='Describe how this channel should be used.' /> </p> </div> @@ -319,10 +302,7 @@ export default class NewChannelModal extends React.Component { <p className='input__help'> <FormattedMessage id='channel_modal.headerHelp' - defaultMessage='Set text that will appear in the header of the {term} beside the {term} name. For example, include frequently used links by typing [Link Title](http://example.com).' - values={{ - term: (channelTerm) - }} + defaultMessage='Set text that will appear in the header of the channel beside the channel name. For example, include frequently used links by typing [Link Title](http://example.com).' /> </p> {serverError} @@ -348,9 +328,8 @@ export default class NewChannelModal extends React.Component { > <FormattedMessage id='channel_modal.createNew' - defaultMessage='Create New ' + defaultMessage='Create New Channel' /> - {channelTerm} </button> </Modal.Footer> </form> diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 940f0b0a6..76ac81c6e 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -446,7 +446,7 @@ export default class Sidebar extends React.Component { <div> <FormattedHTMLMessage id='sidebar.tutorialScreen1' - defaultMessage='<h4>Channels</h4><p><strong>Channels</strong> organize conversations across different topics. They’re open to everyone on your team. To send private communications use <strong>Direct Messages</strong> for a single person or <strong>Private Groups</strong> for multiple people.</p>' + defaultMessage='<h4>Channels</h4><p><strong>Channels</strong> organize conversations across different topics. They’re open to everyone on your team. To send private communications use <strong>Direct Messages</strong> for a single person or <strong>Private Channels</strong> for multiple people.</p>' /> </div> ); @@ -473,7 +473,7 @@ export default class Sidebar extends React.Component { id='sidebar.tutorialScreen3' defaultMessage='<h4>Creating and Joining Channels</h4> <p>Click <strong>"More..."</strong> to create a new channel or join an existing one.</p> - <p>You can also create a new channel or private group by clicking the <strong>"+" symbol</strong> next to the channel or private group header.</p>' + <p>You can also create a new public or private channel by clicking the <strong>"+" symbol</strong> next to the public or private channel header.</p>' /> </div> ); @@ -700,7 +700,7 @@ export default class Sidebar extends React.Component { <Tooltip id='new-channel-tooltip' > <FormattedMessage id='sidebar.createChannel' - defaultMessage='Create new channel' + defaultMessage='Create new public channel' /> </Tooltip> ); @@ -708,7 +708,7 @@ export default class Sidebar extends React.Component { <Tooltip id='new-group-tooltip'> <FormattedMessage id='sidebar.createGroup' - defaultMessage='Create new group' + defaultMessage='Create new private channel' /> </Tooltip> ); @@ -872,7 +872,7 @@ export default class Sidebar extends React.Component { <h4> <FormattedMessage id='sidebar.pg' - defaultMessage='Private Groups' + defaultMessage='Private Channels' /> {createPrivateChannelIcon} </h4> diff --git a/webapp/components/suggestion/search_suggestion_list.jsx b/webapp/components/suggestion/search_suggestion_list.jsx index 99262109a..ee7a77366 100644 --- a/webapp/components/suggestion/search_suggestion_list.jsx +++ b/webapp/components/suggestion/search_suggestion_list.jsx @@ -33,7 +33,7 @@ export default class SearchSuggestionList extends SuggestionList { text = ( <FormattedMessage id='suggestion.search.private' - defaultMessage='Private Groups' + defaultMessage='Private Channels' /> ); } diff --git a/webapp/components/tutorial/tutorial_intro_screens.jsx b/webapp/components/tutorial/tutorial_intro_screens.jsx index c266191b8..5197696c4 100644 --- a/webapp/components/tutorial/tutorial_intro_screens.jsx +++ b/webapp/components/tutorial/tutorial_intro_screens.jsx @@ -162,7 +162,7 @@ export default class TutorialIntroScreens extends React.Component { <FormattedHTMLMessage id='tutorial_intro.screenTwo' defaultMessage='<h3>How Mattermost works:</h3> - <p>Communication happens in public discussion channels, private groups and direct messages.</p> + <p>Communication happens in public discussion channels, private channels and direct messages.</p> <p>Everything is archived and searchable from any web-enabled desktop, laptop or phone.</p>' /> {appDownloadLink} |