mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add color properties to config to white label login buttons (#7826)
This commit is contained in:
committed by
Christopher Speller
parent
df09f87def
commit
15cc449758
@@ -165,7 +165,10 @@
|
||||
"EmailBatchingBufferSize": 256,
|
||||
"EmailBatchingInterval": 30,
|
||||
"SkipServerCertificateVerification": false,
|
||||
"EmailNotificationContentsType": "full"
|
||||
"EmailNotificationContentsType": "full",
|
||||
"LoginButtonColor": "",
|
||||
"LoginButtonBorderColor": "",
|
||||
"LoginButtonTextColor": ""
|
||||
},
|
||||
"RateLimitSettings": {
|
||||
"Enable": false,
|
||||
@@ -248,7 +251,10 @@
|
||||
"SkipCertificateVerification": false,
|
||||
"QueryTimeout": 60,
|
||||
"MaxPageSize": 0,
|
||||
"LoginFieldName": ""
|
||||
"LoginFieldName": "",
|
||||
"LoginButtonColor": "",
|
||||
"LoginButtonBorderColor": "",
|
||||
"LoginButtonTextColor": ""
|
||||
},
|
||||
"ComplianceSettings": {
|
||||
"Enable": false,
|
||||
@@ -278,7 +284,10 @@
|
||||
"NicknameAttribute": "",
|
||||
"LocaleAttribute": "",
|
||||
"PositionAttribute": "",
|
||||
"LoginButtonText": "With SAML"
|
||||
"LoginButtonText": "With SAML",
|
||||
"LoginButtonColor": "",
|
||||
"LoginButtonBorderColor": "",
|
||||
"LoginButtonTextColor": ""
|
||||
},
|
||||
"NativeAppSettings": {
|
||||
"AppDownloadLink": "https://about.mattermost.com/downloads/",
|
||||
|
||||
@@ -688,6 +688,9 @@ type EmailSettings struct {
|
||||
EmailBatchingInterval *int
|
||||
SkipServerCertificateVerification *bool
|
||||
EmailNotificationContentsType *string
|
||||
LoginButtonColor *string
|
||||
LoginButtonBorderColor *string
|
||||
LoginButtonTextColor *string
|
||||
}
|
||||
|
||||
func (s *EmailSettings) SetDefaults() {
|
||||
@@ -755,6 +758,18 @@ func (s *EmailSettings) SetDefaults() {
|
||||
if s.EmailNotificationContentsType == nil {
|
||||
s.EmailNotificationContentsType = NewString(EMAIL_NOTIFICATION_CONTENTS_FULL)
|
||||
}
|
||||
|
||||
if s.LoginButtonColor == nil {
|
||||
s.LoginButtonColor = NewString("#0000")
|
||||
}
|
||||
|
||||
if s.LoginButtonBorderColor == nil {
|
||||
s.LoginButtonBorderColor = NewString("#2389D7")
|
||||
}
|
||||
|
||||
if s.LoginButtonTextColor == nil {
|
||||
s.LoginButtonTextColor = NewString("#2389D7")
|
||||
}
|
||||
}
|
||||
|
||||
type RateLimitSettings struct {
|
||||
@@ -1069,6 +1084,10 @@ type LdapSettings struct {
|
||||
|
||||
// Customization
|
||||
LoginFieldName *string
|
||||
|
||||
LoginButtonColor *string
|
||||
LoginButtonBorderColor *string
|
||||
LoginButtonTextColor *string
|
||||
}
|
||||
|
||||
func (s *LdapSettings) SetDefaults() {
|
||||
@@ -1156,6 +1175,18 @@ func (s *LdapSettings) SetDefaults() {
|
||||
if s.LoginFieldName == nil {
|
||||
s.LoginFieldName = NewString(LDAP_SETTINGS_DEFAULT_LOGIN_FIELD_NAME)
|
||||
}
|
||||
|
||||
if s.LoginButtonColor == nil {
|
||||
s.LoginButtonColor = NewString("#0000")
|
||||
}
|
||||
|
||||
if s.LoginButtonBorderColor == nil {
|
||||
s.LoginButtonBorderColor = NewString("#2389D7")
|
||||
}
|
||||
|
||||
if s.LoginButtonTextColor == nil {
|
||||
s.LoginButtonTextColor = NewString("#2389D7")
|
||||
}
|
||||
}
|
||||
|
||||
type ComplianceSettings struct {
|
||||
@@ -1224,6 +1255,10 @@ type SamlSettings struct {
|
||||
PositionAttribute *string
|
||||
|
||||
LoginButtonText *string
|
||||
|
||||
LoginButtonColor *string
|
||||
LoginButtonBorderColor *string
|
||||
LoginButtonTextColor *string
|
||||
}
|
||||
|
||||
func (s *SamlSettings) SetDefaults() {
|
||||
@@ -1298,6 +1333,18 @@ func (s *SamlSettings) SetDefaults() {
|
||||
if s.LocaleAttribute == nil {
|
||||
s.LocaleAttribute = NewString(SAML_SETTINGS_DEFAULT_LOCALE_ATTRIBUTE)
|
||||
}
|
||||
|
||||
if s.LoginButtonColor == nil {
|
||||
s.LoginButtonColor = NewString("#34a28b")
|
||||
}
|
||||
|
||||
if s.LoginButtonBorderColor == nil {
|
||||
s.LoginButtonBorderColor = NewString("#2389D7")
|
||||
}
|
||||
|
||||
if s.LoginButtonTextColor == nil {
|
||||
s.LoginButtonTextColor = NewString("#ffffff")
|
||||
}
|
||||
}
|
||||
|
||||
type NativeAppSettings struct {
|
||||
|
||||
@@ -501,6 +501,10 @@ func getClientConfig(c *model.Config) map[string]string {
|
||||
props["EnableEmailBatching"] = strconv.FormatBool(*c.EmailSettings.EnableEmailBatching)
|
||||
props["EmailNotificationContentsType"] = *c.EmailSettings.EmailNotificationContentsType
|
||||
|
||||
props["EmailLoginButtonColor"] = *c.EmailSettings.LoginButtonColor
|
||||
props["EmailLoginButtonBorderColor"] = *c.EmailSettings.LoginButtonBorderColor
|
||||
props["EmailLoginButtonTextColor"] = *c.EmailSettings.LoginButtonTextColor
|
||||
|
||||
props["EnableSignUpWithGitLab"] = strconv.FormatBool(c.GitLabSettings.Enable)
|
||||
|
||||
props["ShowEmailAddress"] = strconv.FormatBool(c.PrivacySettings.ShowEmailAddress)
|
||||
@@ -562,6 +566,9 @@ func getClientConfig(c *model.Config) map[string]string {
|
||||
props["LdapNicknameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.NicknameAttribute != "")
|
||||
props["LdapFirstNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.FirstNameAttribute != "")
|
||||
props["LdapLastNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.LastNameAttribute != "")
|
||||
props["LdapLoginButtonColor"] = *c.LdapSettings.LoginButtonColor
|
||||
props["LdapLoginButtonBorderColor"] = *c.LdapSettings.LoginButtonBorderColor
|
||||
props["LdapLoginButtonTextColor"] = *c.LdapSettings.LoginButtonTextColor
|
||||
}
|
||||
|
||||
if *License.Features.MFA {
|
||||
@@ -579,6 +586,9 @@ func getClientConfig(c *model.Config) map[string]string {
|
||||
props["SamlFirstNameAttributeSet"] = strconv.FormatBool(*c.SamlSettings.FirstNameAttribute != "")
|
||||
props["SamlLastNameAttributeSet"] = strconv.FormatBool(*c.SamlSettings.LastNameAttribute != "")
|
||||
props["SamlNicknameAttributeSet"] = strconv.FormatBool(*c.SamlSettings.NicknameAttribute != "")
|
||||
props["SamlLoginButtonColor"] = *c.SamlSettings.LoginButtonColor
|
||||
props["SamlLoginButtonBorderColor"] = *c.SamlSettings.LoginButtonBorderColor
|
||||
props["SamlLoginButtonTextColor"] = *c.SamlSettings.LoginButtonTextColor
|
||||
}
|
||||
|
||||
if *License.Features.Cluster {
|
||||
|
||||
Reference in New Issue
Block a user