Skip to content

Commit

Permalink
Merge pull request #5386 from solidusio/elia/admin/bug-fixes
Browse files Browse the repository at this point in the history
[admin] Misc. bugfixes
  • Loading branch information
elia authored Sep 19, 2023
2 parents 74dcc5f + a16647b commit f4c0dc2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</div>
</div>

<div class="<%= toolbar_classes %>" data-<%= stimulus_id %>-target="batchToolbar" aria-role="toolbar" aria-label="<%= t(".batch_actions") %>">
<div class="<%= toolbar_classes %>" data-<%= stimulus_id %>-target="batchToolbar" role="toolbar" aria-label="<%= t(".batch_actions") %>">
<%= form_tag '', id: batch_actions_form_id %>
<% @batch_actions.each do |batch_action| %>
<%= render_batch_action_button(batch_action) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SolidusAdmin::UI::Toggletip::Component < SolidusAdmin::BaseComponent
# @param theme [Symbol] The theme of the toggletip. Defaults to `:light`. See
# `THEMES` for available options.
def initialize(text:, position: :down, theme: :light, **attributes)
@text = text || guide
@text = text
@position = position
@theme = theme
@attributes = attributes
Expand Down
5 changes: 4 additions & 1 deletion admin/app/controllers/solidus_admin/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def update
redirect_to action: :show, status: :see_other
else
flash.now[:error] = @product.errors.full_messages.join(", ")
render action: :show, status: :unprocessable_entity

respond_to do |format|
format.html { render component('products/show').new(product: @product), status: :unprocessable_entity }
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions admin/spec/features/product_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
within('header') { click_button "Save" }

expect(page).to have_content("Just a product (updated)")
fill_in "Name", with: ""
within('header') { click_button "Save" }

expect(page).to have_content("Name can't be blank")
expect(page).to be_axe_clean
end
end

0 comments on commit f4c0dc2

Please sign in to comment.