11060: revert 33b947be00563b67ca36475f277ceceaf8c68378

This commit is contained in:
Ahmed Ejaz
2024-04-24 02:44:32 +05:00
committed by Rachel Arnould
parent da34e7b780
commit c12d6ab7f0
4 changed files with 13 additions and 16 deletions

View File

@@ -27,13 +27,12 @@
-# empty
%td.align-right
-# empty
- if producer_options.many?
%td.naked_inputs.align-left
= render(SearchableDropdownComponent.new(form: f,
name: :supplier_id,
options: producer_options,
selected_option: product.supplier_id,
placeholder_value: t('admin.products_v3.filters.search_for_producers')))
%td.naked_inputs.align-left
= render(SearchableDropdownComponent.new(form: f,
name: :supplier_id,
options: producer_options,
selected_option: product.supplier_id,
placeholder_value: t('admin.products_v3.filters.search_for_producers')))
%td.align-left
-# empty
%td.align-left

View File

@@ -55,8 +55,7 @@
%th.align-left.with-input= t('admin.products_page.columns.unit')
%th.align-left.with-input= t('admin.products_page.columns.price')
%th.align-left.with-input= t('admin.products_page.columns.on_hand')
- if producer_options.many?
%th.align-left= t('admin.products_page.columns.producer')
%th.align-left= t('admin.products_page.columns.producer')
%th.align-left= t('admin.products_page.columns.category')
%th.align-left= t('admin.products_page.columns.tax_category')
%th.align-left= t('admin.products_page.columns.inherits_properties')
@@ -72,17 +71,17 @@
- product.variants.each_with_index do |variant, variant_index|
= form.fields_for("products][#{product_index}][variants_attributes][", variant, index: variant_index) do |variant_form|
%tr.condensed{ 'data-controller': "variant" }
= render partial: 'variant_row', locals: { variant:, f: variant_form, producer_options:, category_options:, tax_category_options: }
= render partial: 'variant_row', locals: { variant:, f: variant_form, category_options:, tax_category_options: }
= form.fields_for("products][#{product_index}][variants_attributes][NEW_RECORD", product.variants.build) do |new_variant_form|
%template{ 'data-nested-form-target': "template" }
%tr.condensed{ 'data-controller': "variant" }
= render partial: 'variant_row', locals: { variant: new_variant_form.object, f: new_variant_form, producer_options:, category_options:, tax_category_options: }
= render partial: 'variant_row', locals: { variant: new_variant_form.object, f: new_variant_form, category_options:, tax_category_options: }
%tr{ 'data-nested-form-target': "target" }
%tr.condensed
%td
%td{ colspan: producer_options.many? ? 11 : 10 }
%td{ colspan: 11 }
%button.secondary.condensed.naked.icon-plus{ 'data-action': "nested-form#add",
'aria-label': t('.new_variant') }
=t('.new_variant')

View File

@@ -39,9 +39,8 @@
= f.label :on_demand do
= f.check_box :on_demand, 'data-action': 'change->toggle-control#disableIfPresent change->popout#closeIfChecked'
= t(:on_demand)
- if producer_options.many?
%td.align-left
-# empty producer name
%td.align-left
-# empty producer name
%td.field.naked_inputs
= render(SearchableDropdownComponent.new(form: f,
name: :primary_taxon_id,

View File

@@ -1030,6 +1030,6 @@ describe 'As an enterprise user, I can manage my products', feature: :admin_styl
end
def tax_category_column
@tax_category_column ||= 'td:nth-child(10)'
@tax_category_column ||= '[data-controller="variant"] > td:nth-child(10)'
end
end