From 97a812f022f3e7baa51f354e8f632bec0683fb6d Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 31 Aug 2023 10:01:01 +1000 Subject: [PATCH] FIX: Hide core plugins from the admin Plugins list (#23328) Most of the core plugins were already hidden, this hides chat, styleguide, and checklist to avoid potential confusion for end users. Also removes respond_to? :hide_plugin, since that API has been in place for a while now. --- plugins/chat/plugin.rb | 1 + plugins/checklist/plugin.rb | 1 + plugins/discourse-details/plugin.rb | 2 +- plugins/discourse-lazy-videos/plugin.rb | 2 +- plugins/discourse-local-dates/plugin.rb | 2 +- plugins/discourse-narrative-bot/plugin.rb | 2 +- plugins/discourse-presence/plugin.rb | 2 +- plugins/styleguide/plugin.rb | 1 + 8 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rb index f1258b2e5af..7beb2d8f812 100644 --- a/plugins/chat/plugin.rb +++ b/plugins/chat/plugin.rb @@ -24,6 +24,7 @@ register_svg_icon "file-image" # route: /admin/plugins/chat add_admin_route "chat.admin.title", "chat" +hide_plugin GlobalSetting.add_default(:allow_unsecure_chat_uploads, false) diff --git a/plugins/checklist/plugin.rb b/plugins/checklist/plugin.rb index 6fff328e765..f447ae47eb5 100644 --- a/plugins/checklist/plugin.rb +++ b/plugins/checklist/plugin.rb @@ -10,3 +10,4 @@ enabled_site_setting :checklist_enabled register_asset "stylesheets/checklist.scss" register_svg_icon "spinner" +hide_plugin diff --git a/plugins/discourse-details/plugin.rb b/plugins/discourse-details/plugin.rb index 6d14a1dba67..2668042db2a 100644 --- a/plugins/discourse-details/plugin.rb +++ b/plugins/discourse-details/plugin.rb @@ -7,7 +7,7 @@ # url: https://github.com/discourse/discourse/tree/main/plugins/discourse-details enabled_site_setting :details_enabled -hide_plugin if self.respond_to?(:hide_plugin) +hide_plugin register_asset "stylesheets/details.scss" diff --git a/plugins/discourse-lazy-videos/plugin.rb b/plugins/discourse-lazy-videos/plugin.rb index 8875cad76af..5f7d291742a 100644 --- a/plugins/discourse-lazy-videos/plugin.rb +++ b/plugins/discourse-lazy-videos/plugin.rb @@ -6,7 +6,7 @@ # authors: Jan Cernik # url: https://github.com/discourse/discourse-lazy-videos -hide_plugin if self.respond_to?(:hide_plugin) +hide_plugin enabled_site_setting :lazy_videos_enabled register_asset "stylesheets/lazy-videos.scss" diff --git a/plugins/discourse-local-dates/plugin.rb b/plugins/discourse-local-dates/plugin.rb index 1c95e754bbe..76fb9885b6e 100644 --- a/plugins/discourse-local-dates/plugin.rb +++ b/plugins/discourse-local-dates/plugin.rb @@ -5,7 +5,7 @@ # version: 0.1 # author: Joffrey Jaffeux -hide_plugin if self.respond_to?(:hide_plugin) +hide_plugin register_asset "stylesheets/common/discourse-local-dates.scss" register_asset "moment.js", :vendored_core_pretty_text diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rb index d1987d9a17a..84d70249ab5 100644 --- a/plugins/discourse-narrative-bot/plugin.rb +++ b/plugins/discourse-narrative-bot/plugin.rb @@ -7,7 +7,7 @@ # url: https://github.com/discourse/discourse/tree/main/plugins/discourse-narrative-bot enabled_site_setting :discourse_narrative_bot_enabled -hide_plugin if self.respond_to?(:hide_plugin) +hide_plugin if Rails.env == "development" # workaround, teach reloader to reload jobs diff --git a/plugins/discourse-presence/plugin.rb b/plugins/discourse-presence/plugin.rb index 42919c143a6..98c15ca3836 100644 --- a/plugins/discourse-presence/plugin.rb +++ b/plugins/discourse-presence/plugin.rb @@ -7,7 +7,7 @@ # url: https://github.com/discourse/discourse/tree/main/plugins/discourse-presence enabled_site_setting :presence_enabled -hide_plugin if self.respond_to?(:hide_plugin) +hide_plugin register_asset "stylesheets/presence.scss" diff --git a/plugins/styleguide/plugin.rb b/plugins/styleguide/plugin.rb index 0611793c0cc..e5ea9dd2503 100644 --- a/plugins/styleguide/plugin.rb +++ b/plugins/styleguide/plugin.rb @@ -7,6 +7,7 @@ register_asset "stylesheets/styleguide.scss" enabled_site_setting :styleguide_enabled +hide_plugin load File.expand_path("../lib/styleguide/engine.rb", __FILE__)