Skip to content

Commit

Permalink
Fix store_credits
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdonarski committed Oct 26, 2023
1 parent fd14291 commit 692b3f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/helpers/spree/admin/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ def images_actions
def prices_actions
Rails.application.config.spree_backend.actions[:prices]
end

def store_credits
Rails.application.config.spree_backend.actions[:store_credits]
end
# rubocop:enable Metrics/ModuleLength
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/store_credits/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<% end %>

<% content_for :page_actions do %>
<% images_actions.items.each do |action| %>
<% store_credits.items.each do |action| %>
<% next unless action.available?(current_ability) %>
<%= button_link_to(
action.text,
action.url(@product),
action.url(@user),
class: action.classes,
icon: action.icon_name
) %>
Expand Down
1 change: 1 addition & 0 deletions lib/spree/backend/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Engine < ::Rails::Engine
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.include?(:images) ? (Rails.application.config.spree_backend.actions[:images].items << Spree::Admin::Actions::ImagesDefaultActionsBuilder.new.build.items).flatten! : Rails.application.config.spree_backend.actions[:images] = Spree::Admin::Actions::ImagesDefaultActionsBuilder.new.build
Rails.application.config.spree_backend.actions[:store_credits] = Spree::Admin::Actions::StoreCreditsDefaultActionsBuilder.new.build
end
end
end
Expand Down

0 comments on commit 692b3f6

Please sign in to comment.