MM-47884: Migrate config state from focalboard plugin (#21490)

Instead of blindly setting the initial flag value
to false, we set it to the original plugin setting.

https://mattermost.atlassian.net/browse/MM-47884

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-10-25 23:29:16 +05:30
коммит произвёл GitHub
родитель a648ced221
Коммит ee3fae80bc

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

@@ -2751,9 +2751,13 @@ type ProductSettings struct {
EnablePublicSharedBoards *bool
}
func (s *ProductSettings) SetDefaults() {
func (s *ProductSettings) SetDefaults(plugins map[string]map[string]any) {
if s.EnablePublicSharedBoards == nil {
s.EnablePublicSharedBoards = NewBool(false)
if p, ok := plugins[PluginIdFocalboard]; ok {
s.EnablePublicSharedBoards = NewBool(p["enablepublicsharedboards"].(bool))
} else {
s.EnablePublicSharedBoards = NewBool(false)
}
}
}
@@ -3246,7 +3250,7 @@ func (o *Config) SetDefaults() {
o.ThemeSettings.SetDefaults()
o.ClusterSettings.SetDefaults()
o.PluginSettings.SetDefaults(o.LogSettings)
o.ProductSettings.SetDefaults()
o.ProductSettings.SetDefaults(o.PluginSettings.Plugins)
o.AnalyticsSettings.SetDefaults()
o.ComplianceSettings.SetDefaults()
o.LocalizationSettings.SetDefaults()