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 -%>