MM-52818 - create config setting to enable/disable playbooks product (#23508)
* create config setting to enable/disable playbooks product * fix to config name * fix typo * revert changes to package-lock.json * update name of test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3705d7af4d
Коммит
22275fa0f5
@@ -88,6 +88,10 @@ func (s *Server) shouldStart(product string) bool {
|
||||
s.Log().Warn("Skipping Playbooks start: disabled via env var")
|
||||
return false
|
||||
}
|
||||
if !*s.Config().ProductSettings.EnablePlaybooks {
|
||||
s.Log().Warn("Skipping Playbooks start: disabled via configuration")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -144,6 +144,8 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
|
||||
props["AllowSyncedDrafts"] = strconv.FormatBool(*c.ServiceSettings.AllowSyncedDrafts)
|
||||
props["DelayChannelAutocomplete"] = strconv.FormatBool(*c.ExperimentalSettings.DelayChannelAutocomplete)
|
||||
|
||||
props["EnablePlaybooks"] = strconv.FormatBool(*c.ProductSettings.EnablePlaybooks)
|
||||
|
||||
if license != nil {
|
||||
props["ExperimentalEnableAuthenticationTransfer"] = strconv.FormatBool(*c.ServiceSettings.ExperimentalEnableAuthenticationTransfer)
|
||||
|
||||
|
||||
@@ -326,6 +326,20 @@ func TestGetClientConfig(t *testing.T) {
|
||||
"ExperimentalSharedChannels": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Default Playbooks Enabled",
|
||||
&model.Config{
|
||||
ProductSettings: model.ProductSettings{},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: "other",
|
||||
},
|
||||
map[string]string{
|
||||
"EnablePlaybooks": "true",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
||||
@@ -2879,6 +2879,7 @@ func (s *CloudSettings) SetDefaults() {
|
||||
|
||||
type ProductSettings struct {
|
||||
EnablePublicSharedBoards *bool
|
||||
EnablePlaybooks *bool
|
||||
}
|
||||
|
||||
func (s *ProductSettings) SetDefaults(plugins map[string]map[string]any) {
|
||||
@@ -2889,6 +2890,9 @@ func (s *ProductSettings) SetDefaults(plugins map[string]map[string]any) {
|
||||
s.EnablePublicSharedBoards = NewBool(false)
|
||||
}
|
||||
}
|
||||
if s.EnablePlaybooks == nil {
|
||||
s.EnablePlaybooks = NewBool(true)
|
||||
}
|
||||
}
|
||||
|
||||
type PluginState struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user