Skip to content

Commit

Permalink
Revert use of searchableDropdownComponent for product unit
Browse files Browse the repository at this point in the history
  • Loading branch information
wandji20 committed Aug 20, 2024
1 parent bb38f47 commit 5c95fe6
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions app/views/spree/admin/products/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@
= f.field_container :variant_unit do
= f.label :variant_unit, t(".units")
%span.required *
= render(SearchableDropdownComponent.new(form: f,
name: :variant_unit,
aria_label: t('.units'),
options: [],
selected_option: @product.variant_unit,
include_blank: true,
placeholder_value: t('.search_for_units'),
other_attrs: { id: 'product_variant_unit_with_scale',
name: '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}'}))
= f.select 'variant_unit', [],
{ include_blank: true },
{ id: 'product_variant_unit_with_scale',
name: '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",
}
%input{ type: 'hidden', 'ng-value': 'product.variant_unit', "ng-init": "product.variant_unit='#{@product.variant_unit}'", name: 'product[variant_unit]' }
%input{ type: 'hidden', 'ng-value': 'product.variant_unit_scale', "ng-init": "product.variant_unit_scale='#{@product.variant_unit_scale}'", name: 'product[variant_unit_scale]' }
= f.error_message_on :variant_unit
Expand Down

0 comments on commit 5c95fe6

Please sign in to comment.