<%= render component('ui/panel').new do %>
- <%= render component("ui/forms/text_field").new(field: :name, builder: f) %>
- <%= render component("ui/forms/text_field").new(field: :slug, builder: f) %>
- <%= render component("ui/forms/text_area").new(field: :description, builder: f) %>
+ <%= render component("ui/forms/field").text_field(f, :name) %>
+ <%= render component("ui/forms/field").text_field(f, :slug) %>
+ <%= render component("ui/forms/field").text_area(f, :description) %>
<% end %>
<%= render component('ui/panel').new(title: 'SEO', title_hint: 'Search Engine Optimization') do %>
- <%= render component("ui/forms/text_field").new(field: :meta_title, builder: f) %>
- <%= render component("ui/forms/text_field").new(
- field: :meta_description,
- builder: f
- ) %>
- <%= render component("ui/forms/text_area").new(field: :meta_keywords, builder: f) %>
+ <%= render component("ui/forms/field").text_field(f, :meta_title) %>
+ <%= render component("ui/forms/field").text_field(f, :meta_description) %>
+ <%= render component("ui/forms/field").text_area(f, :meta_keywords) %>
<% end %>
<%= render component('ui/panel').new(title: "Media") do |panel| %>
@@ -58,15 +55,15 @@
<% end %>
<%= render component('ui/panel').new(title: 'Pricing') do %>
- <%= render component("ui/forms/text_field").new(field: :price, builder: f) %>
+ <%= render component("ui/forms/field").text_field(f, :price) %>
- <%= render component("ui/forms/text_field").new(field: :cost_price, builder: f) %>
- <%= render component("ui/forms/text_field").new(field: :cost_currency, builder: f) %>
+ <%= render component("ui/forms/field").text_field(f, :cost_price) %>
+ <%= render component("ui/forms/field").text_field(f, :cost_currency) %>
<% end %>
<%= render component('ui/panel').new(title: 'Stock') do |panel| %>
- <%= render component("ui/forms/text_field").new(field: :sku, builder: f) %>
+ <%= render component("ui/forms/field").text_field(f, :sku) %>
<% panel.with_action(
name: t(".manage_stock"),
@@ -75,30 +72,28 @@
<% end %>
<%= render component('ui/panel').new(title: 'Shipping') do %>
- <%= render component("ui/forms/select").new(
- field: :shipping_category_id,
+ <%= render component("ui/forms/field").select(
+ f,
+ :shipping_category_id,
+ [[t(".none"), nil]] + Spree::ShippingCategory.order(:name).pluck(:name, :id),
tip: t(".hints.shipping_category_html"),
- choices:
- [[t(".none"), nil]] + Spree::ShippingCategory.order(:name).pluck(:name, :id),
- builder: f
) %>
- <%= render component("ui/forms/select").new(
- field: :tax_category_id,
+ <%= render component("ui/forms/field").select(
+ f,
+ :tax_category_id,
+ [[t(".none"), nil]] + Spree::TaxCategory.order(:name).pluck(:name, :id),
tip: t(
".hints.tax_category_html",
default_tax_category: Spree::TaxCategory.default&.name
),
- choices:
- [[t(".none"), nil]] + Spree::TaxCategory.order(:name).pluck(:name, :id),
- builder: f
) %>
<% end %>
<%= render component('ui/panel').new(title: "Options") do %>
- <%= render component("ui/forms/select").new(
- field: :option_type_ids,
- choices: option_type_options,
- builder: f,
+ <%= render component("ui/forms/field").select(
+ f,
+ :option_type_ids,
+ option_type_options,
multiple: true,
"size" => option_type_options.size,
) %>
@@ -114,16 +109,8 @@
diff --git a/admin/app/components/solidus_admin/ui/forms/field/component.html.erb b/admin/app/components/solidus_admin/ui/forms/field/component.html.erb
index fc0e7e22474..d91ea825ade 100644
--- a/admin/app/components/solidus_admin/ui/forms/field/component.html.erb
+++ b/admin/app/components/solidus_admin/ui/forms/field/component.html.erb
@@ -9,7 +9,11 @@
<%= render component('ui/toggletip').new(text: @tip) if @tip.present? %>