From 259702a079306a263d22585a6f2be4d6cbfbb0c2 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Wed, 11 Jul 2018 10:34:14 -0700 Subject: [PATCH] Remove Deface Solidus no longer uses Deface, and the implicit dependency on it in this plugin broke our Solidus app. We decided to remove the use of Deface rather than make it a dependency, following Solidus' lead. --- app/overrides/admin_navigation_menu.rb | 6 ------ lib/solidus_paypal_braintree/engine.rb | 11 +++++++++++ .../configurations/_admin_tab.html.erb | 3 --- 3 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 app/overrides/admin_navigation_menu.rb delete mode 100644 lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb diff --git a/app/overrides/admin_navigation_menu.rb b/app/overrides/admin_navigation_menu.rb deleted file mode 100644 index ca2fe726..00000000 --- a/app/overrides/admin_navigation_menu.rb +++ /dev/null @@ -1,6 +0,0 @@ -Deface::Override.new( - virtual_path: "spree/admin/shared/_settings_sub_menu", - name: "solidus_paypal_braintree_admin_navigation_configuration", - insert_bottom: "[data-hook='admin_settings_sub_tabs']", - partial: "solidus_paypal_braintree/configurations/admin_tab" -) diff --git a/lib/solidus_paypal_braintree/engine.rb b/lib/solidus_paypal_braintree/engine.rb index d559cedb..e90551a1 100644 --- a/lib/solidus_paypal_braintree/engine.rb +++ b/lib/solidus_paypal_braintree/engine.rb @@ -48,6 +48,17 @@ def self.activate end paths["app/views"] << "lib/views/backend" + + initializer "solidus_paypal_braintree_admin_menu_item", after: "register_solidus_paypal_braintree_gateway" do |app| + Spree::Backend::Config.configure do |config| + config.menu_items << config.class::MenuItem.new( + [:braintree], + 'cc-paypal', + url: '/solidus_paypal_braintree/configurations/list', + condition: -> { can?(:admin, Spree::PaymentMethod) } + ) + end + end end end end diff --git a/lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb b/lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb deleted file mode 100644 index 1145efc2..00000000 --- a/lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= tab :braintree, match_path: /braintree\/configurations/, - url: solidus_paypal_braintree.list_configurations_path -%>