Merge pull request #7342 from luisramos0/dead_code

[Rails 5.2] Delete dead code in variants list page, this is old spree logic
This commit is contained in:
Andy Brett
2021-04-08 10:47:02 -07:00
committed by GitHub
3 changed files with 5 additions and 20 deletions

View File

@@ -289,12 +289,6 @@ module Spree
}.inject(:or)
end
def empty_option_values?
options.empty? || options.any? do |opt|
opt.option_type.option_values.empty?
end
end
def property(property_name)
return nil unless prop = properties.find_by(name: property_name)

View File

@@ -30,17 +30,9 @@
= link_to_with_icon('icon-edit', Spree.t(:edit), edit_object_url(variant, @url_filters), no_text: true) unless variant.deleted?
= link_to_delete(variant, { url: object_url(variant, @url_filters), no_text: true }) unless variant.deleted?
- if @product.empty_option_values?
%p.first_add_option_types.no-objects-found
= t('.to_add_variants_you_must_first_define')
= link_to t('.option_types'), admin_product_url(@product)
= t('.and')
= link_to t('.option_values'), admin_option_types_url
- content_for :page_actions do
%ul.inline-menu
%li#new_var_link
= link_to_with_icon('icon-plus', t('.new_variant'), new_admin_product_variant_url(@product, @url_filters), class: 'button')
- else
- content_for :page_actions do
%ul.inline-menu
%li#new_var_link
= link_to_with_icon('icon-plus', t('.new_variant'), new_admin_product_variant_url(@product, @url_filters), class: 'button')
%li= link_to_with_icon('icon-filter', @deleted.blank? ? t('.show_deleted') : t('.show_active'), admin_product_variants_url(@product, @url_filters.merge(deleted: @deleted.blank? ? "on" : "off")), class: 'button')
%li= link_to_with_icon('icon-filter', @deleted.blank? ? t('.show_deleted') : t('.show_active'), admin_product_variants_url(@product, @url_filters.merge(deleted: @deleted.blank? ? "on" : "off")), class: 'button')

View File

@@ -3680,7 +3680,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using
price: "Price"
options: "Options"
no_results: "No results"
to_add_variants_you_must_first_define: "To add variants, you must first define"
option_types: "Option Types"
option_values: "Option Values"
and: "and"