From ae6416e35749318f891fa041281cbd5e604508dd Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 27 Mar 2023 14:02:18 -0700 Subject: [PATCH] Remove configuration auto enable. (#22625) * Remove configuration auto enable. * i18n * Fix diff tests. --- model/config.go | 10 ---------- server/channels/api4/config.go | 5 ----- server/config/diff_test.go | 18 ------------------ server/i18n/en.json | 4 ---- 4 files changed, 37 deletions(-) diff --git a/model/config.go b/model/config.go index 3e0f60c8c7..6c5306950d 100644 --- a/model/config.go +++ b/model/config.go @@ -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} diff --git a/server/channels/api4/config.go b/server/channels/api4/config.go index e1875e26bc..042636b17e 100644 --- a/server/channels/api4/config.go +++ b/server/channels/api4/config.go @@ -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, diff --git a/server/config/diff_test.go b/server/config/diff_test.go index 15ec6f41f7..bf1a79ab37 100644 --- a/server/config/diff_test.go +++ b/server/config/diff_test.go @@ -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, }, diff --git a/server/i18n/en.json b/server/i18n/en.json index ded7d5c8a6..492fee9d58 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -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."