Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adim] Fix parameter name in the select component #5366

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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