summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorS4KH <kh.syerikjan@gmail.com>2016-10-21 20:36:13 +0800
committerChristopher Speller <crspeller@gmail.com>2016-10-21 08:36:13 -0400
commit234958e0076655efd8a58ea4502edce3226418ed (patch)
tree568c2e2f06a6921414e2cded9cb682651768aee8 /webapp
parentd13ba8c55c981978f3b962c6991f478b36bf8a8b (diff)
downloadchat-234958e0076655efd8a58ea4502edce3226418ed.tar.gz
chat-234958e0076655efd8a58ea4502edce3226418ed.tar.bz2
chat-234958e0076655efd8a58ea4502edce3226418ed.zip
HW 4139: Make channel limits configurable in the System Console (#4154)
* Auto Changes * 4139 Made channel limits configurable in the System Console as described in the issue * Removed error message entries from other locales, made maxChannelsPerteam type to pointer * Added * symbol to maxChannelsPerTeam inside isValid function * Update team_test.go * Restored to old test * Checked maximum number channels per team when creating channel * Fixed code to pass api/channel_test.go * Reverted changes on config except MaxChannelsPerTeam * Update channel.go * Ran gofmt -w . * Reverted vendor directoy
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/admin_console/users_and_teams_settings.jsx22
-rw-r--r--webapp/i18n/en.json3
-rw-r--r--webapp/utils/constants.jsx1
3 files changed, 25 insertions, 1 deletions
diff --git a/webapp/components/admin_console/users_and_teams_settings.jsx b/webapp/components/admin_console/users_and_teams_settings.jsx
index b20b66541..60ee70264 100644
--- a/webapp/components/admin_console/users_and_teams_settings.jsx
+++ b/webapp/components/admin_console/users_and_teams_settings.jsx
@@ -32,6 +32,7 @@ export default class UsersAndTeamsSettings extends AdminSettings {
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);
return config;
}
@@ -43,7 +44,8 @@ export default class UsersAndTeamsSettings extends AdminSettings {
maxUsersPerTeam: config.TeamSettings.MaxUsersPerTeam,
restrictCreationToDomains: config.TeamSettings.RestrictCreationToDomains,
restrictTeamNames: config.TeamSettings.RestrictTeamNames,
- restrictDirectMessage: config.TeamSettings.RestrictDirectMessage
+ restrictDirectMessage: config.TeamSettings.RestrictDirectMessage,
+ maxChannelsPerTeam: config.TeamSettings.MaxChannelsPerTeam
};
}
@@ -114,6 +116,24 @@ export default class UsersAndTeamsSettings extends AdminSettings {
onChange={this.handleChange}
/>
<TextSetting
+ id='maxChannelsPerTeam'
+ label={
+ <FormattedMessage
+ id='admin.team.maxChannelsTitle'
+ defaultMessage='Max Channels Per Team:'
+ />
+ }
+ placeholder={Utils.localizeMessage('admin.team.maxChannelsExample', 'Ex "100"')}
+ helpText={
+ <FormattedMessage
+ id='admin.team.maxChannelsDescription'
+ defaultMessage='Maximum total number of channels per team, including both active and deleted channels.'
+ />
+ }
+ value={this.state.maxChannelsPerTeam}
+ onChange={this.handleChange}
+ />
+ <TextSetting
id='restrictCreationToDomains'
label={
<FormattedMessage
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index ae7d7d201..4e83c3264 100644
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -780,6 +780,9 @@
"admin.team.maxUsersDescription": "Maximum total number of users per team, including both active and inactive users.",
"admin.team.maxUsersExample": "E.g.: \"25\"",
"admin.team.maxUsersTitle": "Max Users Per Team:",
+ "admin.team.maxChannelsDescription": "Maximum total number of channels per team, including both active and deleted channels.",
+ "admin.team.maxChannelsExample": "Ex \"100\"",
+ "admin.team.maxChannelsTitle": "Max Channels Per Team:",
"admin.team.noBrandImage": "No brand image uploaded",
"admin.team.openServerDescription": "When true, anyone can signup for a user account on this server without the need to be invited.",
"admin.team.openServerTitle": "Enable Open Server: ",
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 83d64358c..efc0d8482 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -818,6 +818,7 @@ export const Constants = {
WEBRTC_TIME_DELAY: 750,
WEBRTC_CLEAR_ERROR_DELAY: 15000,
DEFAULT_MAX_USERS_PER_TEAM: 50,
+ DEFAULT_MAX_CHANNELS_PER_TEAM: 2000,
MIN_TEAMNAME_LENGTH: 4,
MAX_TEAMNAME_LENGTH: 15,
MIN_USERNAME_LENGTH: 3,