[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
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
fb57b3dd53
Коммит
eea64f8049
@@ -39,6 +39,10 @@ const (
|
||||
DIRECT_MESSAGE_ANY = "any"
|
||||
DIRECT_MESSAGE_TEAM = "team"
|
||||
|
||||
SHOW_USERNAME = "username"
|
||||
SHOW_NICKNAME_FULLNAME = "nickname_full_name"
|
||||
SHOW_FULLNAME = "full_name"
|
||||
|
||||
PERMISSIONS_ALL = "all"
|
||||
PERMISSIONS_CHANNEL_ADMIN = "channel_admin"
|
||||
PERMISSIONS_TEAM_ADMIN = "team_admin"
|
||||
@@ -322,6 +326,7 @@ type TeamSettings struct {
|
||||
UserStatusAwayTimeout *int64
|
||||
MaxChannelsPerTeam *int64
|
||||
MaxNotificationsPerChannel *int64
|
||||
TeammateNameDisplay *string
|
||||
}
|
||||
|
||||
type LdapSettings struct {
|
||||
@@ -702,6 +707,11 @@ func (o *Config) SetDefaults() {
|
||||
*o.TeamSettings.MaxNotificationsPerChannel = 1000
|
||||
}
|
||||
|
||||
if o.TeamSettings.TeammateNameDisplay == nil {
|
||||
o.TeamSettings.TeammateNameDisplay = new(string)
|
||||
*o.TeamSettings.TeammateNameDisplay = SHOW_FULLNAME
|
||||
}
|
||||
|
||||
if o.EmailSettings.EnableSignInWithEmail == nil {
|
||||
o.EmailSettings.EnableSignInWithEmail = new(bool)
|
||||
|
||||
@@ -1394,6 +1404,10 @@ func (o *Config) IsValid() *AppError {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.restrict_direct_message.app_error", nil, "")
|
||||
}
|
||||
|
||||
if !(*o.TeamSettings.TeammateNameDisplay == SHOW_FULLNAME || *o.TeamSettings.TeammateNameDisplay == SHOW_NICKNAME_FULLNAME || *o.TeamSettings.TeammateNameDisplay == SHOW_USERNAME) {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.teammate_name_display.app_error", nil, "")
|
||||
}
|
||||
|
||||
if len(o.SqlSettings.AtRestEncryptKey) < 32 {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.encrypt_sql.app_error", nil, "")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user