[PLT-5864] Move teammate name display setting to the System Console (#6681)

* move teammate name display setting to the system console

* update all the likes of TeammateNameDisplay names

* fix gofmt error

* rebase and fix conflict
Этот коммит содержится в:
Saturnino Abril
2017-06-30 16:06:59 +08:00
коммит произвёл George Goldberg
родитель fb57b3dd53
Коммит eea64f8049
17 изменённых файлов: 102 добавлений и 227 удалений

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

@@ -31,6 +31,7 @@ export default class UsersAndTeamsSettings extends AdminSettings {
config.TeamSettings.MaxUsersPerTeam = this.parseIntNonZero(this.state.maxUsersPerTeam, Constants.DEFAULT_MAX_USERS_PER_TEAM);
config.TeamSettings.RestrictCreationToDomains = this.state.restrictCreationToDomains;
config.TeamSettings.RestrictDirectMessage = this.state.restrictDirectMessage;
config.TeamSettings.TeammateNameDisplay = this.state.teammateNameDisplay;
config.TeamSettings.MaxChannelsPerTeam = this.parseIntNonZero(this.state.maxChannelsPerTeam, Constants.DEFAULT_MAX_CHANNELS_PER_TEAM);
config.TeamSettings.MaxNotificationsPerChannel = this.parseIntNonZero(this.state.maxNotificationsPerChannel, Constants.DEFAULT_MAX_NOTIFICATIONS_PER_CHANNEL);
@@ -44,6 +45,7 @@ export default class UsersAndTeamsSettings extends AdminSettings {
maxUsersPerTeam: config.TeamSettings.MaxUsersPerTeam,
restrictCreationToDomains: config.TeamSettings.RestrictCreationToDomains,
restrictDirectMessage: config.TeamSettings.RestrictDirectMessage,
teammateNameDisplay: config.TeamSettings.TeammateNameDisplay,
maxChannelsPerTeam: config.TeamSettings.MaxChannelsPerTeam,
maxNotificationsPerChannel: config.TeamSettings.MaxNotificationsPerChannel
};
@@ -188,6 +190,28 @@ export default class UsersAndTeamsSettings extends AdminSettings {
value={this.state.restrictDirectMessage}
onChange={this.handleChange}
/>
<DropdownSetting
id='teammateNameDisplay'
values={[
{value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_USERNAME, text: Utils.localizeMessage('admin.team.showUsername', 'Show username')},
{value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_NICKNAME_FULLNAME, text: Utils.localizeMessage('admin.team.showNickname', 'Show nickname if one exists, otherwise show first and last name')},
{value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_FULLNAME, text: Utils.localizeMessage('admin.team.showFullname', 'Show first and last name (default)')}
]}
label={
<FormattedMessage
id='admin.team.teammateNameDisplay'
defaultMessage='Teammate Name Display:'
/>
}
helpText={
<FormattedHTMLMessage
id='admin.team.teammateNameDisplayDesc'
defaultMessage="Set how to display users' names in posts and the Direct Messages list."
/>
}
value={this.state.teammateNameDisplay}
onChange={this.handleChange}
/>
</SettingsGroup>
);
}