From 16137308b011146be29f88c3856b154d55d04abf Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 12 May 2020 11:18:19 +0300 Subject: [PATCH] FIX: Show Settings button if plugin has settings (#9728) It used to check if the plugin has an enabled_setting. --- app/assets/javascripts/admin/templates/plugins-index.hbs | 2 +- app/serializers/admin_plugin_serializer.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/templates/plugins-index.hbs b/app/assets/javascripts/admin/templates/plugins-index.hbs index b89b6e6f013..072f7d2141d 100644 --- a/app/assets/javascripts/admin/templates/plugins-index.hbs +++ b/app/assets/javascripts/admin/templates/plugins-index.hbs @@ -47,7 +47,7 @@ {{#if currentUser.admin}} - {{#if plugin.enabled_setting}} + {{#if plugin.has_settings}} {{d-button class="btn-default" action=(route-action "showSettings") actionParam=plugin icon="cog" label="admin.plugins.change_settings_short"}} {{/if}} {{/if}} diff --git a/app/serializers/admin_plugin_serializer.rb b/app/serializers/admin_plugin_serializer.rb index 843ca584087..809773c854a 100644 --- a/app/serializers/admin_plugin_serializer.rb +++ b/app/serializers/admin_plugin_serializer.rb @@ -8,6 +8,7 @@ class AdminPluginSerializer < ApplicationSerializer :admin_route, :enabled, :enabled_setting, + :has_settings, :is_official def id @@ -38,6 +39,10 @@ class AdminPluginSerializer < ApplicationSerializer object.enabled_site_setting end + def has_settings + SiteSetting.plugins.values.include?(id) + end + def include_url? url.present? end