Skip to content

Commit

Permalink
Fix parameter name in the select component
Browse files Browse the repository at this point in the history
#5363 was merged just before
#5360, so it didn't pick up the
rename.
  • Loading branch information
waiting-for-dev authored and elia committed Sep 28, 2023
1 parent fe7cd9c commit 1e18d33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions admin/app/components/solidus_admin/ui/forms/select/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SolidusAdmin::UI::Forms::Select::Component < SolidusAdmin::BaseComponent
}.freeze

# @param field [Symbol] the name of the field. Usually a model attribute.
# @param form [ActionView::Helpers::FormBuilder] the form builder instance.
# @param builder [ActionView::Helpers::FormBuilder] the form builder instance.
# @param size [Symbol] the size of the field: `:s`, `:m` or `:l`.
# @param choices [Array] an array of choices for the select box. All the
# formats valid for Rails' `select` helper are supported.
Expand All @@ -31,7 +31,7 @@ class SolidusAdmin::UI::Forms::Select::Component < SolidusAdmin::BaseComponent
# instance and no `errors` Hash is passed to the component.
def initialize(
field:,
form:,
builder:,
size: :m,
choices: [],
hint: nil,
Expand All @@ -42,7 +42,7 @@ def initialize(
attributes: {}
)
@field = field
@form = form
@builder = builder
@size = size
@choices = choices
@hint = hint
Expand All @@ -56,7 +56,7 @@ def initialize(
def call
guidance = @guidance_component.new(
field: @field,
form: @form,
builder: @builder,
hint: @hint,
errors: @errors,
disabled: @attributes[:disabled]
Expand All @@ -80,7 +80,7 @@ def field_wrapper_tag(guidance)
end

def field_tag(guidance)
@form.select(
@builder.select(
@field,
@choices,
@options,
Expand Down Expand Up @@ -152,7 +152,7 @@ def arrow_color_class(guidance)
end

def label_tag
render @label_component.new(field: @field, form: @form)
render @label_component.new(field: @field, builder: @builder)
end

def guidance_tag(guidance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<td class="px-3 py-1">
<%=
render current_component.new(
form: form,
builder: form,
field: name,
choices: choices,
size: size,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= form_with(url: "#", scope: :playground, method: :get, class: "w-60") do |form| %>
<%=
render current_component.new(
form: form,
builder: form,
size: size,
choices: choices,
field: field,
Expand Down

0 comments on commit 1e18d33

Please sign in to comment.