diff --git a/server/channels/api4/plugin_test.go b/server/channels/api4/plugin_test.go index 7f5067a2a8..d61129afd3 100644 --- a/server/channels/api4/plugin_test.go +++ b/server/channels/api4/plugin_test.go @@ -462,8 +462,6 @@ func TestDisableOnRemove(t *testing.T) { } func TestGetMarketplacePlugins(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t) defer th.TearDown() @@ -685,8 +683,6 @@ func TestGetMarketplacePlugins(t *testing.T) { } func TestGetInstalledMarketplacePlugins(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") samplePlugins := []*model.MarketplacePlugin{ { @@ -831,8 +827,6 @@ func TestGetInstalledMarketplacePlugins(t *testing.T) { } func TestSearchGetMarketplacePlugins(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") samplePlugins := []*model.MarketplacePlugin{ { @@ -959,8 +953,6 @@ func TestSearchGetMarketplacePlugins(t *testing.T) { } func TestGetLocalPluginInMarketplace(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t) defer th.TearDown() @@ -1123,8 +1115,6 @@ func TestGetLocalPluginInMarketplace(t *testing.T) { } func TestGetRemotePluginInMarketplace(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t) defer th.TearDown() @@ -1181,69 +1171,7 @@ func TestGetRemotePluginInMarketplace(t *testing.T) { require.NoError(t, err) } -func TestRemoteMarketplaceDisabledByStreamlinedMarketplaceFlag(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "true") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") - - th := Setup(t) - defer th.TearDown() - - marketplacePlugins := []*model.MarketplacePlugin{ - { - BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ - HomepageURL: "https://example.com/mattermost/mattermost-plugin-nps", - IconData: "https://example.com/icon.svg", - DownloadURL: "www.github.com/example", - Manifest: &model.Manifest{ - Id: "marketplace.test", - Name: "marketplacetest", - Description: "a marketplace plugin", - Version: "0.1.2", - MinServerVersion: "", - }, - }, - InstalledVersion: "", - }, - } - - testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - res.WriteHeader(http.StatusOK) - json, err := json.Marshal([]*model.MarketplacePlugin{marketplacePlugins[0]}) - require.NoError(t, err) - res.Write(json) - })) - defer testServer.Close() - - th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.PluginSettings.Enable = true - *cfg.PluginSettings.EnableMarketplace = true - *cfg.PluginSettings.EnableRemoteMarketplace = true - *cfg.PluginSettings.EnableUploads = true - *cfg.PluginSettings.MarketplaceURL = testServer.URL - }) - - prepackagePlugin := &plugin.PrepackagedPlugin{ - Manifest: &model.Manifest{ - Version: "0.0.1", - Id: "prepackaged.test", - }, - } - - env := th.App.GetPluginsEnvironment() - env.SetPrepackagedPlugins([]*plugin.PrepackagedPlugin{prepackagePlugin}, nil) - - // No marketplace plugins returned - plugins, _, err := th.SystemAdminClient.GetMarketplacePlugins(context.Background(), &model.MarketplacePluginFilter{}) - require.NoError(t, err) - - // Only returns the prepackaged plugins - require.Len(t, plugins, 1) - require.Equal(t, prepackagePlugin.Manifest, plugins[0].Manifest) -} - func TestGetPrepackagedPluginInMarketplace(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t) defer th.TearDown() @@ -1376,8 +1304,6 @@ func TestGetPrepackagedPluginInMarketplace(t *testing.T) { } func TestInstallMarketplacePlugin(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t).InitBasic() defer th.TearDown() @@ -1729,8 +1655,6 @@ func TestInstallMarketplacePlugin(t *testing.T) { } func TestInstallMarketplacePluginPrepackagedDisabled(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") path, _ := fileutils.FindDir("tests") diff --git a/server/channels/api4/system_test.go b/server/channels/api4/system_test.go index c571c6f59f..affcdd4e41 100644 --- a/server/channels/api4/system_test.go +++ b/server/channels/api4/system_test.go @@ -855,8 +855,6 @@ func TestPushNotificationAck(t *testing.T) { } func TestCompleteOnboarding(t *testing.T) { - os.Setenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE", "false") - defer os.Unsetenv("MM_FEATUREFLAGS_STREAMLINEDMARKETPLACE") th := Setup(t) defer th.TearDown() diff --git a/server/channels/app/plugin.go b/server/channels/app/plugin.go index 69bca16d83..1b7039bdb1 100644 --- a/server/channels/app/plugin.go +++ b/server/channels/app/plugin.go @@ -552,7 +552,7 @@ func (a *App) GetPlugins() (*model.PluginsResponse, *model.AppError) { func (a *App) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) { plugins := map[string]*model.MarketplacePlugin{} - if *a.Config().PluginSettings.EnableRemoteMarketplace && !a.Config().FeatureFlags.StreamlinedMarketplace && !filter.LocalOnly { + if *a.Config().PluginSettings.EnableRemoteMarketplace && !filter.LocalOnly { p, appErr := a.getRemotePlugins() if appErr != nil { return nil, appErr diff --git a/server/channels/app/plugin_install.go b/server/channels/app/plugin_install.go index 74e3bee21b..f27e109e1e 100644 --- a/server/channels/app/plugin_install.go +++ b/server/channels/app/plugin_install.go @@ -289,7 +289,7 @@ func (ch *Channels) InstallMarketplacePlugin(request *model.InstallMarketplacePl signatureFile = bytes.NewReader(prepackagedPlugin.Signature) } - if *ch.cfgSvc.Config().PluginSettings.EnableRemoteMarketplace && !ch.cfgSvc.Config().FeatureFlags.StreamlinedMarketplace { + if *ch.cfgSvc.Config().PluginSettings.EnableRemoteMarketplace { var plugin *model.BaseMarketplacePlugin plugin, appErr = ch.getRemoteMarketplacePlugin(request.Id, request.Version) // The plugin might only be prepackaged and not on the Marketplace. diff --git a/webapp/channels/src/components/plugin_marketplace/__snapshots__/marketplace_modal.test.tsx.snap b/webapp/channels/src/components/plugin_marketplace/__snapshots__/marketplace_modal.test.tsx.snap index a52754423a..22aa01b335 100644 --- a/webapp/channels/src/components/plugin_marketplace/__snapshots__/marketplace_modal.test.tsx.snap +++ b/webapp/channels/src/components/plugin_marketplace/__snapshots__/marketplace_modal.test.tsx.snap @@ -76,16 +76,8 @@ exports[`components/marketplace/ doesn't show web marketplace banner in FeatureF
-
@@ -169,49 +161,8 @@ exports[`components/marketplace/ hides search, shows web marketplace banner in F
-
diff --git a/webapp/channels/src/components/plugin_marketplace/marketplace_modal.tsx b/webapp/channels/src/components/plugin_marketplace/marketplace_modal.tsx index b369f6cfce..a6bf0b9878 100644 --- a/webapp/channels/src/components/plugin_marketplace/marketplace_modal.tsx +++ b/webapp/channels/src/components/plugin_marketplace/marketplace_modal.tsx @@ -251,13 +251,17 @@ const MarketplaceModal = ({ > {isStreamlinedMarketplaceEnabled ? ( <> - + {loading ? ( + + ) : ( + + )} ) : (