Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update backend New Image link for consistency #3786

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/app/views/spree/admin/images/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

<% content_for :page_actions do %>
<% if can?(:create, Spree::Image) %>
<li><%= link_to_with_icon('plus', t('spree.new_image'), new_admin_product_image_url(@product), id: 'new_image_link', class: 'btn btn-primary') %></li>
<li>
<%= link_to t('spree.new_image'), new_admin_product_image_url(@product), id: 'new_image_link', class: 'btn btn-primary' %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you've applied the new_image_link ID to both the li and the a elements. Since IDs should be unique and it's conceivable that someone could be using deface overrides to target this, I think it's best to leave the ID on the a and not also add it to the li.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jarednorman Good catch!

Looking around at other backend views, it seems like in https://github.com/solidusio/solidus/blob/master/backend/app/views/spree/admin/prices/index.html.erb#L5-L7 and https://github.com/solidusio/solidus/blob/master/backend/app/views/spree/admin/variants/index.html.erb#L7-L13, the convention is to put the ID on the li element. I’d suggest that we do the same here for consistency with those other views.

I’ve force-pushed the latest; LMK what you think.

</li>
<% end %>
<% end %>

Expand Down