From 36c74d7b47253249ec83aedacf409a93de1d182f Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 3 Apr 2017 08:42:05 -0400 Subject: [PATCH] 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 --- i18n/en.json | 24 +---- .../admin_console/policy_settings.jsx | 12 +-- .../components/analytics/system_analytics.jsx | 54 +++-------- .../components/analytics/team_analytics.jsx | 2 +- webapp/components/audit_table.jsx | 12 +-- webapp/components/change_url_modal.jsx | 29 ++++-- webapp/components/channel_header.jsx | 40 +------- webapp/components/delete_channel_modal.jsx | 21 +--- .../components/edit_channel_purpose_modal.jsx | 20 +--- .../components/abstract_incoming_webhook.jsx | 2 +- webapp/components/leave_team_modal.jsx | 2 +- webapp/components/more_direct_channels.jsx | 4 +- webapp/components/navbar.jsx | 40 +------- webapp/components/new_channel_flow.jsx | 63 ++++-------- webapp/components/new_channel_modal.jsx | 33 ++----- webapp/components/sidebar.jsx | 10 +- .../suggestion/search_suggestion_list.jsx | 2 +- .../tutorial/tutorial_intro_screens.jsx | 2 +- webapp/i18n/en.json | 97 +++++++++---------- webapp/utils/channel_intro_messages.jsx | 4 +- 20 files changed, 150 insertions(+), 323 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 158fffa920..cd10197ae7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -205,11 +205,11 @@ }, { "id": "api.channel.can_manage_channel.private_restricted_system_admin.app_error", - "translation": "Private Group management and creation is restricted to System Administrators." + "translation": "Private Channel management and creation is restricted to System Administrators." }, { "id": "api.channel.can_manage_channel.private_restricted_team_admin.app_error", - "translation": "Private Group management and creation is restricted to Team and System Administrators." + "translation": "Private Channel management and creation is restricted to Team and System Administrators." }, { "id": "api.channel.can_manage_channel.public_restricted_system_admin.app_error", @@ -329,7 +329,7 @@ }, { "id": "api.channel.leave.last_member.app_error", - "translation": "You're the only member left, try removing the Private Group instead of leaving." + "translation": "You're the only member left, try removing the Private Channel instead of leaving." }, { "id": "api.channel.leave.left", @@ -2297,7 +2297,7 @@ }, { "id": "api.templates.upgrade_30_body.info", - "translation": "

YOUR DUPLICATE ACCOUNTS HAVE BEEN UPDATED

Your Mattermost server is being upgraded to Version 3.0, which lets you use a single account across multiple teams.

You are receiving this email because the upgrade process has detected your account had the same email or username as other accounts on the server.

The following updates have been made:

{{if .EmailChanged }}- The duplicate email of an account on the `/{{.TeamName}}` team was changed to `{{.Email}}`. You will need to use email and password to login, you can use this new email address for login.

{{end}}{{if .UsernameChanged }}- The duplicate username of an account on the team site `/{{.TeamName}}` has been changed to `{{.Username}}` to avoid confusion with other accounts.

{{end}} RECOMMENDED ACTION:

It is recommended that you login to your teams used by your duplicate accounts and add your primary account to the team and any public channels and private groups which you wish to continue using.

This gives your primary account access to all public channel and private group history. You can continue to access the direct message history of your duplicate accounts by logging in with their credentials.

FOR MORE INFORMATION:

For more information on the upgrade to Mattermost 3.0 please see: http://www.mattermost.org/upgrading-to-mattermost-3-0/

" + "translation": "

YOUR DUPLICATE ACCOUNTS HAVE BEEN UPDATED

Your Mattermost server is being upgraded to Version 3.0, which lets you use a single account across multiple teams.

You are receiving this email because the upgrade process has detected your account had the same email or username as other accounts on the server.

The following updates have been made:

{{if .EmailChanged }}- The duplicate email of an account on the `/{{.TeamName}}` team was changed to `{{.Email}}`. You will need to use email and password to login, you can use this new email address for login.

{{end}}{{if .UsernameChanged }}- The duplicate username of an account on the team site `/{{.TeamName}}` has been changed to `{{.Username}}` to avoid confusion with other accounts.

{{end}} RECOMMENDED ACTION:

It is recommended that you login to your teams used by your duplicate accounts and add your primary account to the team and any channels which you wish to continue using.

This gives your primary account access to all channel history. You can continue to access the direct message history of your duplicate accounts by logging in with their credentials.

FOR MORE INFORMATION:

For more information on the upgrade to Mattermost 3.0 please see: http://www.mattermost.org/upgrading-to-mattermost-3-0/

" }, { "id": "api.templates.upgrade_30_subject.info", @@ -3503,22 +3503,6 @@ "id": "error.not_found.title", "translation": "Page not found" }, - { - "id": "leave_team_modal.desc", - "translation": "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?" - }, - { - "id": "leave_team_modal.no", - "translation": "No" - }, - { - "id": "leave_team_modal.title", - "translation": "Leave the team?" - }, - { - "id": "leave_team_modal.yes", - "translation": "Yes" - }, { "id": "manaultesting.get_channel_id.no_found.debug", "translation": "Could not find channel: %v, %v possibilities searched" diff --git a/webapp/components/admin_console/policy_settings.jsx b/webapp/components/admin_console/policy_settings.jsx index c8c145b8d1..13101e828e 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={ } value={this.state.restrictPrivateChannelCreation} @@ -187,7 +187,7 @@ export default class PolicySettings extends AdminSettings { helpText={ } /> @@ -202,7 +202,7 @@ export default class PolicySettings extends AdminSettings { label={ } value={this.state.restrictPrivateChannelManagement} @@ -210,7 +210,7 @@ export default class PolicySettings extends AdminSettings { helpText={ } /> @@ -225,7 +225,7 @@ export default class PolicySettings extends AdminSettings { label={ } value={this.state.restrictPrivateChannelDeletion} @@ -233,7 +233,7 @@ export default class PolicySettings extends AdminSettings { helpText={ ); - 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 135bab4b44..cc179a370c 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={ } icon='fa-globe' diff --git a/webapp/components/audit_table.jsx b/webapp/components/audit_table.jsx index 34e61dbace..e7d366f04f 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 5095176787..fd5cdfd740 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' > -
{this.props.description}
+
+ +
- +
- ); - if (channel.type === Constants.PRIVATE_CHANNEL) { - channelTerm = ( - - ); - } - let popoverListMembers; if (!isDirect) { popoverListMembers = ( @@ -560,10 +545,7 @@ export default class ChannelHeader extends React.Component { > @@ -590,10 +572,7 @@ export default class ChannelHeader extends React.Component { > @@ -612,10 +591,7 @@ export default class ChannelHeader extends React.Component { > @@ -634,10 +610,7 @@ export default class ChannelHeader extends React.Component { > @@ -674,10 +647,7 @@ export default class ChannelHeader extends React.Component { > diff --git a/webapp/components/delete_channel_modal.jsx b/webapp/components/delete_channel_modal.jsx index a6577a4a9b..1893d28d10 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 = ( - - ); - if (this.props.channel.type === Constants.PRIVATE_CHANNEL) { - channelTerm = ( - - ); - } - return (
diff --git a/webapp/components/edit_channel_purpose_modal.jsx b/webapp/components/edit_channel_purpose_modal.jsx index 7ee00babad..ea34cf9690 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 = ( - - ); - if (this.props.channel.type === Constants.PRIVATE_CHANNEL) { - channelType = ( - - ); - } - return (