diff --git a/app/helpers/spree/admin/navigation_helper.rb b/app/helpers/spree/admin/navigation_helper.rb index 3b54aa156a..34e97bd4d9 100644 --- a/app/helpers/spree/admin/navigation_helper.rb +++ b/app/helpers/spree/admin/navigation_helper.rb @@ -329,10 +329,6 @@ def user_actions def products_actions Rails.application.config.spree_backend.actions[:products] end - - def product_actions - Rails.application.config.spree_backend.actions[:product] - end # rubocop:enable Metrics/ModuleLength end end diff --git a/app/models/spree/admin/actions/product_default_actions_builder.rb b/app/models/spree/admin/actions/product_default_actions_builder.rb deleted file mode 100644 index ac22cef658..0000000000 --- a/app/models/spree/admin/actions/product_default_actions_builder.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Spree - module Admin - module Actions - class ProductDefaultActionsBuilder - include Spree::Core::Engine.routes.url_helpers - - def build - root = Root.new - add_external_preview_action(root) - root - end - - private - - def add_external_preview_action(root) - action = - ActionBuilder.new(external_preview_config). - build - - root.add(action) - end - - def external_preview_config - { - icon_name: 'view.svg', - name: 'admin.utilities.preview', - url: ->(_resource) { admin_products_path }, - classes: 'btn-light', - id: 'adminPreviewProduct', - translation_options: { - name: :product - }, - target: :blank, - data: { turbo: false } - } - end - end - end - end -end diff --git a/lib/spree/backend/engine.rb b/lib/spree/backend/engine.rb index 78c7d2c99c..79602d8ed9 100644 --- a/lib/spree/backend/engine.rb +++ b/lib/spree/backend/engine.rb @@ -33,7 +33,6 @@ class Engine < ::Rails::Engine Rails.application.config.spree_backend.actions[:users] = Spree::Admin::Actions::UsersDefaultActionsBuilder.new.build Rails.application.config.spree_backend.actions[:user] = Spree::Admin::Actions::UserDefaultActionsBuilder.new.build Rails.application.config.spree_backend.actions[:products] = Spree::Admin::Actions::ProductsDefaultActionsBuilder.new.build - Rails.application.config.spree_backend.actions[:product] = Spree::Admin::Actions::ProductDefaultActionsBuilder.new.build end end end diff --git a/spec/models/spree/admin/actions/product_default_actions_builder_spec.rb b/spec/models/spree/admin/actions/product_default_actions_builder_spec.rb deleted file mode 100644 index 1c16913427..0000000000 --- a/spec/models/spree/admin/actions/product_default_actions_builder_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -module Spree - module Admin - describe Actions::ProductDefaultActionsBuilder, type: :model do - let(:builder) { described_class.new } - let(:default_actions) do - ['admin.utilities.preview'] - end - - describe '#build' do - subject { builder.build } - - it 'builds default tabs' do - expect(subject.items.map(&:name)).to match(default_actions) - end - end - end - end -end