Merge branch 'master' into MM-45580-notify-admin-delinquency-update-billing

Этот коммит содержится в:
Mattermod
2022-09-13 14:35:21 +03:00
коммит произвёл GitHub
родитель fb3b2a4f47 7fff071fee
Коммит 99c9957fcf
47 изменённых файлов: 731 добавлений и 257 удалений

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

@@ -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()