PLT-4165 removing team name reserved words (#4289)

Этот коммит содержится в:
Corey Hulen
2016-10-21 17:19:28 -07:00
коммит произвёл GitHub
родитель 3885532750
Коммит 486d12e1c3
12 изменённых файлов: 27 добавлений и 113 удалений

Просмотреть файл

@@ -30,7 +30,6 @@ export default class UsersAndTeamsSettings extends AdminSettings {
config.TeamSettings.EnableTeamCreation = this.state.enableTeamCreation;
config.TeamSettings.MaxUsersPerTeam = this.parseIntNonZero(this.state.maxUsersPerTeam, Constants.DEFAULT_MAX_USERS_PER_TEAM);
config.TeamSettings.RestrictCreationToDomains = this.state.restrictCreationToDomains;
config.TeamSettings.RestrictTeamNames = this.state.restrictTeamNames;
config.TeamSettings.RestrictDirectMessage = this.state.restrictDirectMessage;
config.TeamSettings.MaxChannelsPerTeam = this.parseIntNonZero(this.state.maxChannelsPerTeam, Constants.DEFAULT_MAX_CHANNELS_PER_TEAM);
@@ -43,7 +42,6 @@ export default class UsersAndTeamsSettings extends AdminSettings {
enableTeamCreation: config.TeamSettings.EnableTeamCreation,
maxUsersPerTeam: config.TeamSettings.MaxUsersPerTeam,
restrictCreationToDomains: config.TeamSettings.RestrictCreationToDomains,
restrictTeamNames: config.TeamSettings.RestrictTeamNames,
restrictDirectMessage: config.TeamSettings.RestrictDirectMessage,
maxChannelsPerTeam: config.TeamSettings.MaxChannelsPerTeam
};
@@ -151,23 +149,6 @@ export default class UsersAndTeamsSettings extends AdminSettings {
value={this.state.restrictCreationToDomains}
onChange={this.handleChange}
/>
<BooleanSetting
id='restrictTeamNames'
label={
<FormattedMessage
id='admin.team.restrictNameTitle'
defaultMessage='Restrict Team Names: '
/>
}
helpText={
<FormattedMessage
id='admin.team.restrictNameDesc'
defaultMessage='When true, You cannot create a team name with reserved words like www, admin, support, test, channel, etc'
/>
}
value={this.state.restrictTeamNames}
onChange={this.handleChange}
/>
<DropdownSetting
id='restrictDirectMessage'
values={[

Просмотреть файл

@@ -54,12 +54,10 @@ export default class TeamUrl extends React.Component {
return;
}
if (global.window.mm_config.RestrictTeamNames === 'true') {
for (let index = 0; index < Constants.RESERVED_TEAM_NAMES.length; index++) {
if (cleanedName.indexOf(Constants.RESERVED_TEAM_NAMES[index]) === 0) {
this.setState({nameError: Utils.localizeMessage('create_team.team_url.taken', 'URL is taken or contains a reserved word')});
return;
}
for (let index = 0; index < Constants.RESERVED_TEAM_NAMES.length; index++) {
if (cleanedName.indexOf(Constants.RESERVED_TEAM_NAMES[index]) === 0) {
this.setState({nameError: Utils.localizeMessage('create_team.team_url.taken', 'URL is taken or contains a reserved word')});
return;
}
}

Просмотреть файл

@@ -331,23 +331,13 @@ export const Constants = {
SYSTEM_MESSAGE_PROFILE_NAME: 'System',
SYSTEM_MESSAGE_PROFILE_IMAGE: logoImage,
RESERVED_TEAM_NAMES: [
'www',
'web',
'signup',
'login',
'admin',
'support',
'notify',
'test',
'demo',
'mail',
'team',
'channel',
'internal',
'localhost',
'dockerhost',
'stag',
'post',
'cluster',
'api'
'api',
'oauth'
],
RESERVED_USERNAMES: [
'valet',