mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Remove configuration auto enable. (#22625)
* Remove configuration auto enable. * i18n * Fix diff tests.
This commit is contained in:
committed by
GitHub
parent
0140e94d77
commit
ae6416e357
@@ -2867,21 +2867,11 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) {
|
||||
s.PluginStates[PluginIdNPS] = &PluginState{Enable: ls.EnableDiagnostics == nil || *ls.EnableDiagnostics}
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdPlaybooks] == nil {
|
||||
// Enable the playbooks plugin by default
|
||||
s.PluginStates[PluginIdPlaybooks] = &PluginState{Enable: true}
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdChannelExport] == nil && BuildEnterpriseReady == "true" {
|
||||
// Enable the channel export plugin by default
|
||||
s.PluginStates[PluginIdChannelExport] = &PluginState{Enable: true}
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdFocalboard] == nil {
|
||||
// Enable the focalboard plugin by default
|
||||
s.PluginStates[PluginIdFocalboard] = &PluginState{Enable: true}
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdApps] == nil {
|
||||
// Enable the Apps plugin by default
|
||||
s.PluginStates[PluginIdApps] = &PluginState{Enable: true}
|
||||
|
||||
@@ -157,11 +157,6 @@ func updateConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
*cfg.PluginSettings.MarketplaceURL = *appCfg.PluginSettings.MarketplaceURL
|
||||
}
|
||||
|
||||
if cfg.PluginSettings.PluginStates[model.PluginIdFocalboard].Enable && cfg.FeatureFlags.BoardsProduct {
|
||||
c.Err = model.NewAppError("EnablePlugin", "app.plugin.product_mode.app_error", map[string]any{"Name": model.PluginIdFocalboard}, "", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// There are some settings that cannot be changed in a cloud env
|
||||
if c.App.Channels().License().IsCloud() {
|
||||
// Both of them cannot be nil since cfg.SetDefaults is called earlier for cfg,
|
||||
|
||||
@@ -807,12 +807,6 @@ func TestDiff(t *testing.T) {
|
||||
"com.mattermost.nps": {
|
||||
Enable: !defaultConfigGen().PluginSettings.PluginStates["com.mattermost.nps"].Enable,
|
||||
},
|
||||
"focalboard": {
|
||||
Enable: true,
|
||||
},
|
||||
"playbooks": {
|
||||
Enable: true,
|
||||
},
|
||||
"com.mattermost.apps": {
|
||||
Enable: true,
|
||||
},
|
||||
@@ -845,12 +839,6 @@ func TestDiff(t *testing.T) {
|
||||
"com.mattermost.newplugin": {
|
||||
Enable: true,
|
||||
},
|
||||
"focalboard": {
|
||||
Enable: true,
|
||||
},
|
||||
"playbooks": {
|
||||
Enable: true,
|
||||
},
|
||||
"com.mattermost.apps": {
|
||||
Enable: true,
|
||||
},
|
||||
@@ -875,12 +863,6 @@ func TestDiff(t *testing.T) {
|
||||
Path: "PluginSettings.PluginStates",
|
||||
BaseVal: defaultConfigGen().PluginSettings.PluginStates,
|
||||
ActualVal: map[string]*model.PluginState{
|
||||
"focalboard": {
|
||||
Enable: true,
|
||||
},
|
||||
"playbooks": {
|
||||
Enable: true,
|
||||
},
|
||||
"com.mattermost.apps": {
|
||||
Enable: true,
|
||||
},
|
||||
|
||||
@@ -6043,10 +6043,6 @@
|
||||
"id": "app.plugin.not_installed.app_error",
|
||||
"translation": "Plugin is not installed."
|
||||
},
|
||||
{
|
||||
"id": "app.plugin.product_mode.app_error",
|
||||
"translation": "Plugin {{.Name}} cannot be enabled in product mode."
|
||||
},
|
||||
{
|
||||
"id": "app.plugin.remove.app_error",
|
||||
"translation": "Unable to delete plugin."
|
||||
|
||||
Reference in New Issue
Block a user