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

Fix issue with radio buttons field group #405

Merged
merged 3 commits into from
May 28, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.1] - 2024-05-20

### Fixed
- Incorrect `for` attribute value in radio buttons of `radio_buttons_field_group` when value is a datetime

## [1.2.0] - 2024-05-06

### Changed
Expand Down
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:
bali_view_components (1.2.0)
bali_view_components (1.2.1)
caxlsx
rails (>= 7.0.2)
ransack
Expand Down
3 changes: 1 addition & 2 deletions lib/bali/form_builder/radio_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ def radio_buttons(method, values, options)
end

def tags(values, html_options, method, label_class)
field_name = [options[:as] || object.model_name.singular, method].join('_')
data = html_options.delete(:data)

values.map do |display_value|
display, value, radio_options = display_value
radio_options ||= {}
radio_options.merge!(html_options)

tag.label(class: label_class, for: [field_name, value].join('_')) do
label(method, class: label_class, value: value) do
radio_button(method, value, radio_options.merge(data: data)) + display
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bali/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Bali
VERSION = '1.2.0'
VERSION = '1.2.1'
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bali-view-components",
"version": "1.2.0",
"version": "1.2.1",
"description": "Bali ViewComponents",
"repository": "[email protected]:Grupo-AFAL/bali.git",
"author": "Federico Gonzalez <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ application.register('selected', SelectedController)
application.register('auto-play-audio', AutoPlayAudioController)
application.register('autocomplete-address', AutocompleteAddressController)
application.register('checkbox-toggle-address', CheckboxToggleController)
application.register('datepicker-address', DatepickerController)
application.register('datepicker', DatepickerController)
application.register('drawing-maps', DrawingMapsController)
application.register('dynamic-fields', DynamicFieldsController)
application.register('elements-overlap', ElementsOverlapController)
Expand Down
Loading