Skip to content

Commit

Permalink
Add text for the admin product/index image column header
Browse files Browse the repository at this point in the history
This improves accessibility naming the column that holds images.
  • Loading branch information
elia committed Jul 19, 2023
1 parent 0550665 commit d140b24
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
columns: [
{
class_name: "w-[72px]",
header: "",
header: tag.span('aria-label': t('.product_image'), role: 'text'),
data: -> { image_column(_1) },
},
{ header: :name, data: -> { name_column(_1) } },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
en:
product_image: 'Image'
status:
available: 'Available'
discontinued: 'Discontinued'
Expand Down
4 changes: 1 addition & 3 deletions admin/app/components/solidus_admin/ui/table/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def render_header_cell(cell)
# Allow component instances as cell content
cell = cell.render_in(self) if cell.respond_to?(:render_in)

cell_tag = cell.blank? ? :td : :th

content_tag(cell_tag, cell, class: %{
content_tag(:th, cell, class: %{
border-b
border-gray-100
px-4
Expand Down

0 comments on commit d140b24

Please sign in to comment.