mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Merge pull request #10137 from ijdershem/idersh/issue-9834-pt2
[OFN-9834-PT2] Fix new product form error label styling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
= f.field_container :primary_taxon do
|
||||
= f.label :primary_taxon_id, t('.product_category')
|
||||
= f.label :primary_taxon, t('.product_category')
|
||||
%span.required *
|
||||
%br
|
||||
= f.collection_select(:primary_taxon_id, Spree::Taxon.order(:name), :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
.sixteen.columns.alpha
|
||||
.eight.columns.alpha
|
||||
= f.field_container :variant_unit do
|
||||
= f.label :variant_unit_with_scale, t(".units")
|
||||
= f.label :variant_unit, t(".units")
|
||||
%span.required *
|
||||
%select{id: 'product_variant_unit_with_scale', 'ng-model' => 'product.variant_unit_with_scale', 'ng-options' => 'unit[1] as unit[0] for unit in variant_unit_options', "data-controller": "tom-select","data-tom-select-options-value": '{"allowEmptyOption":false}', class: "primary"}
|
||||
%option{'value' => '', 'ng-hide' => "hasUnit(product)"}
|
||||
@@ -32,9 +32,9 @@
|
||||
= f.error_message_on :variant_unit
|
||||
.two.columns
|
||||
= f.field_container :unit_value do
|
||||
= f.label :unit_value_with_description, t(".value"), 'ng-disabled' => "!hasUnit(product)"
|
||||
= f.label :unit_value, t(".value"), 'ng-disabled' => "!hasUnit(product)"
|
||||
%span.required *
|
||||
%input.fullwidth{ id: 'product_unit_value_with_description', 'ng-model' => 'product.master.unit_value_with_description', :type => 'text', placeholder: "eg. 2", 'ng-disabled' => "!hasUnit(product)" }
|
||||
%input.fullwidth{ id: 'product_unit_value', 'ng-model' => 'product.master.unit_value_with_description', :type => 'text', placeholder: "eg. 2", 'ng-disabled' => "!hasUnit(product)" }
|
||||
%input{ type: 'hidden', 'ng-value': 'product.master.unit_value', "ng-init": "product.master.unit_value='#{@product.master.unit_value}'", name: 'product[unit_value]' }
|
||||
%input{ type: 'hidden', 'ng-value': 'product.master.unit_description', "ng-init": "product.master.unit_description='#{@product.master.unit_description}'", name: 'product[unit_description]' }
|
||||
= f.error_message_on :unit_value
|
||||
|
||||
@@ -216,7 +216,7 @@ describe '
|
||||
fill_in 'product_name', with: 'Big Bag Of Apples'
|
||||
select supplier.name, from: 'product_supplier_id'
|
||||
select 'Weight (g)', from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: '100'
|
||||
fill_in 'product_unit_value', with: '100'
|
||||
fill_in 'product_price', with: '10.00'
|
||||
select taxon.name, from: 'product_primary_taxon_id'
|
||||
select shipping_category.name, from: 'product_shipping_category_id'
|
||||
@@ -828,7 +828,7 @@ describe '
|
||||
fill_in 'product_name', with: 'Big Bag Of Apples'
|
||||
select supplier_permitted.name, from: 'product_supplier_id'
|
||||
select 'Weight (g)', from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: '100'
|
||||
fill_in 'product_unit_value', with: '100'
|
||||
fill_in 'product_price', with: '10.00'
|
||||
select taxon.name, from: 'product_primary_taxon_id'
|
||||
select shipping_category.name, from: 'product_shipping_category_id'
|
||||
|
||||
@@ -37,7 +37,7 @@ describe '
|
||||
|
||||
select @supplier.name, from: 'product_supplier_id'
|
||||
select "Weight (kg)", from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: "5.00 g"
|
||||
fill_in 'product_unit_value', with: "5.00 g"
|
||||
assert_selector(:field, placeholder: "5kg g")
|
||||
fill_in 'product_display_as', with: "Big Box of Chocolates"
|
||||
select taxon.name, from: "product_primary_taxon_id"
|
||||
@@ -51,7 +51,7 @@ describe '
|
||||
|
||||
expect(page).to have_content "Name can't be blank"
|
||||
expect(page).to have_field 'product_supplier_id', with: @supplier.id
|
||||
expect(page).to have_field 'product_unit_value_with_description', with: "5.00 g"
|
||||
expect(page).to have_field 'product_unit_value', with: "5.00 g"
|
||||
expect(page).to have_field 'product_display_as', with: "Big Box of Chocolates"
|
||||
expect(page).to have_field 'product_primary_taxon_id', with: taxon.id
|
||||
expect(page).to have_field 'product_price', with: '19.99'
|
||||
@@ -75,7 +75,7 @@ describe '
|
||||
select 'New supplier', from: 'product_supplier_id'
|
||||
fill_in 'product_name', with: 'A new product !!!'
|
||||
select "Weight (kg)", from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: 5
|
||||
fill_in 'product_unit_value', with: 5
|
||||
select taxon.name, from: "product_primary_taxon_id"
|
||||
fill_in 'product_price', with: '19.99'
|
||||
fill_in 'product_on_hand', with: 5
|
||||
@@ -112,7 +112,7 @@ describe '
|
||||
fill_in 'product_name', with: 'Hot Cakes'
|
||||
select 'New supplier', from: 'product_supplier_id'
|
||||
select "Weight (kg)", from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: 1
|
||||
fill_in 'product_unit_value', with: 1
|
||||
select taxon.name, from: "product_primary_taxon_id"
|
||||
fill_in 'product_price', with: '1.99'
|
||||
fill_in 'product_on_hand', with: 0
|
||||
@@ -137,7 +137,7 @@ describe '
|
||||
fill_in 'product_name', with: 'Hot Cakes'
|
||||
select 'New supplier', from: 'product_supplier_id'
|
||||
select "Weight (kg)", from: 'product_variant_unit_with_scale'
|
||||
fill_in "product_unit_value_with_description", with: ""
|
||||
fill_in "product_unit_value", with: ""
|
||||
select taxon.name, from: "product_primary_taxon_id"
|
||||
fill_in 'product_price', with: '1.99'
|
||||
fill_in 'product_on_hand', with: 0
|
||||
@@ -251,7 +251,7 @@ describe '
|
||||
expect(page).to have_selector('#product_supplier_id')
|
||||
select 'Another Supplier', from: 'product_supplier_id'
|
||||
select 'Weight (g)', from: 'product_variant_unit_with_scale'
|
||||
fill_in 'product_unit_value_with_description', with: '500'
|
||||
fill_in 'product_unit_value', with: '500'
|
||||
select taxon.name, from: "product_primary_taxon_id"
|
||||
select 'None', from: "product_tax_category_id"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user