Merge branch 'master' into MM-45580-notify-admin-delinquency-update-billing
Этот коммит содержится в:
@@ -296,8 +296,9 @@ func (o *Channel) PreSave() {
|
||||
|
||||
o.Name = SanitizeUnicode(o.Name)
|
||||
o.DisplayName = SanitizeUnicode(o.DisplayName)
|
||||
|
||||
o.CreateAt = GetMillis()
|
||||
if o.CreateAt == 0 {
|
||||
o.CreateAt = GetMillis()
|
||||
}
|
||||
o.UpdateAt = o.CreateAt
|
||||
o.ExtraUpdateAt = 0
|
||||
}
|
||||
|
||||
@@ -371,6 +371,7 @@ type ServiceSettings struct {
|
||||
EnableSVGs *bool `access:"site_posts"`
|
||||
EnableLatex *bool `access:"site_posts"`
|
||||
EnableInlineLatex *bool `access:"site_posts"`
|
||||
PostPriority *bool `access:"site_posts"`
|
||||
EnableAPIChannelDeletion *bool
|
||||
EnableLocalMode *bool
|
||||
LocalModeSocketLocation *string // telemetry: none
|
||||
@@ -842,6 +843,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
if s.EnableCustomGroups == nil {
|
||||
s.EnableCustomGroups = NewBool(true)
|
||||
}
|
||||
|
||||
if s.PostPriority == nil {
|
||||
s.PostPriority = NewBool(false)
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterSettings struct {
|
||||
|
||||
@@ -73,6 +73,8 @@ type FeatureFlags struct {
|
||||
BoardsProduct bool
|
||||
|
||||
PlanUpgradeButtonText string
|
||||
|
||||
PostPriority bool
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) SetDefaults() {
|
||||
@@ -100,6 +102,7 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.CallsEnabled = true
|
||||
f.BoardsProduct = false
|
||||
f.PlanUpgradeButtonText = "upgrade"
|
||||
f.PostPriority = false
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) Plugins() map[string]string {
|
||||
|
||||
@@ -364,8 +364,9 @@ func (s *PluginSetting) isValid() error {
|
||||
pluginSettingType == Text ||
|
||||
pluginSettingType == LongText ||
|
||||
pluginSettingType == Number ||
|
||||
pluginSettingType == Username) {
|
||||
return errors.New("should not set Placeholder for setting type not in text, generated or username")
|
||||
pluginSettingType == Username ||
|
||||
pluginSettingType == Custom) {
|
||||
return errors.New("should not set Placeholder for setting type not in text, generated, number, username, or custom")
|
||||
}
|
||||
|
||||
if s.Options != nil {
|
||||
|
||||
@@ -184,6 +184,13 @@ func TestSettingIsValid(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
},
|
||||
"Placeholder is allowed for custom settings": {
|
||||
PluginSetting{
|
||||
Type: "custom",
|
||||
Placeholder: "some Text",
|
||||
},
|
||||
false,
|
||||
},
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
err := test.Setting.isValid()
|
||||
|
||||
Ссылка в новой задаче
Block a user