[MM-13744] Enable NPS plugin if prepackaged (#10485)
* Enable NPS plugin if prepackaged * Enable NPS plugin in config.go
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c370d30041
Коммит
dd3c7b2f0e
@@ -2110,6 +2110,10 @@ func (s *PluginSettings) SetDefaults() {
|
|||||||
if s.PluginStates == nil {
|
if s.PluginStates == nil {
|
||||||
s.PluginStates = make(map[string]*PluginState)
|
s.PluginStates = make(map[string]*PluginState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.PluginStates["com.mattermost.nps"] == nil {
|
||||||
|
s.PluginStates["com.mattermost.nps"] = &PluginState{Enable: true}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GlobalRelayMessageExportSettings struct {
|
type GlobalRelayMessageExportSettings struct {
|
||||||
|
|||||||
@@ -127,6 +127,21 @@ func TestConfigDefaultServiceSettingsExperimentalGroupUnreadChannels(t *testing.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConfigDefaultNPSPluginState(t *testing.T) {
|
||||||
|
c1 := Config{}
|
||||||
|
c1.SetDefaults()
|
||||||
|
|
||||||
|
if c1.PluginSettings.PluginStates["com.mattermost.nps"].Enable != true {
|
||||||
|
t.Fatal("PluginSettings.PluginStates[\"com.mattermost.nps\"].Enable should default to true")
|
||||||
|
}
|
||||||
|
|
||||||
|
c1.PluginSettings.PluginStates["com.mattermost.nps"].Enable = false
|
||||||
|
c1.SetDefaults()
|
||||||
|
if c1.PluginSettings.PluginStates["com.mattermost.nps"].Enable != false {
|
||||||
|
t.Fatal("PluginSettings.PluginStates[\"com.mattermost.nps\"].Enable should remain false")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestTeamSettingsIsValidSiteNameEmpty(t *testing.T) {
|
func TestTeamSettingsIsValidSiteNameEmpty(t *testing.T) {
|
||||||
c1 := Config{}
|
c1 := Config{}
|
||||||
c1.SetDefaults()
|
c1.SetDefaults()
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user