Skip to content

Commit

Permalink
Merge branch 'main' into enhancement/preview_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Feb 14, 2025
2 parents 8609c42 + 1c47aac commit 4dadef5
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
4 changes: 2 additions & 2 deletions app/components/avo/fields/radio_field/edit_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="flex flex-col gap-2">
<% @field.options.each do |key, value| %>
<div>
<%= form.radio_button @field.id, key %>
<%= form.label @field.id, value, value: value %>
<%= form.radio_button @field.id, key, checked: (@field.value.to_s == key.to_s) %>
<%= form.label @field.id, value, value: key %>
</div>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
PATH
remote: ..
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
PATH
remote: ..
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
PATH
remote: ..
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
PATH
remote: ..
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
PATH
remote: ..
specs:
avo (3.17.5)
avo (3.17.6)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/avo/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Avo
VERSION = "3.17.5" unless const_defined?(:VERSION)
VERSION = "3.17.6" unless const_defined?(:VERSION)
end
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/actions/sub/dummy_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Avo::Actions::Sub::DummyAction < Avo::BaseAction
end

def fields
field :size, as: :radio, options: {small: "Small Option", medium: "Medium Option", large: "Large Option"}
field :size, as: :radio, options: {small: "Small Option", medium: "Medium Option", large: "Large Option"}, default: :medium
TestBuddy.hi("Dummy action fields")
field :keep_modal_open, as: :boolean
field :persistent_text, as: :text
Expand Down
5 changes: 5 additions & 0 deletions spec/features/avo/radio_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@

expect(page).to have_text("Small Option")
expect(page).to have_text("Medium Option")
expect(page).to have_checked_field("fields_size_medium")
expect(page).to have_text("Large Option")

find("label[for='fields_size_large']").click
expect(page).not_to have_checked_field("fields_size_medium")
expect(page).to have_checked_field("fields_size_large")
end
end
end

0 comments on commit 4dadef5

Please sign in to comment.