From 95aa6a49b98959bc8c05e91cbf86752b3f7af92f Mon Sep 17 00:00:00 2001 From: Sue Zhou Date: Tue, 18 Feb 2025 10:40:49 +0000 Subject: [PATCH 1/4] add row class to horizontal form row (.form-group) --- CHANGELOG.md | 2 +- app/helpers/ndr_ui/bootstrap_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6bfc9b..626b5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## [Unreleased] -* no unreleased changes * +* add row class to horizontal form row (.form-group) ## 5.0.1 / 2025-02-03 ### Fixed diff --git a/app/helpers/ndr_ui/bootstrap_helper.rb b/app/helpers/ndr_ui/bootstrap_helper.rb index 14e5cd1..6fc72c0 100644 --- a/app/helpers/ndr_ui/bootstrap_helper.rb +++ b/app/helpers/ndr_ui/bootstrap_helper.rb @@ -381,7 +381,7 @@ def bootstrap_progressbar_tag(*args) # ==== Examples # bootstrap_horizontal_form_group("The Label", [3, 9]) { 'This is the content' } # # => - #
+ #
# #
This is the content
#
@@ -395,7 +395,7 @@ def bootstrap_horizontal_form_group(label = nil, ratio = [2, 10], &block) # Prepend optional label: content = content_tag(:label, label, class: "col-sm-#{l} col-form-label") + content unless label.nil? - content_tag(:div, content, class: 'form-group') + content_tag(:div, content, class: 'form-group row') end # This helper produces a pair of HTML dt, dd tags to display name and value pairs. From bd17525837acff8747a076fbabafdb60709f444f Mon Sep 17 00:00:00 2001 From: Sue Zhou Date: Tue, 18 Feb 2025 10:46:02 +0000 Subject: [PATCH 2/4] add missing tests --- test/helpers/ndr_ui/bootstrap_helper_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/helpers/ndr_ui/bootstrap_helper_test.rb b/test/helpers/ndr_ui/bootstrap_helper_test.rb index f0af737..948b3f8 100644 --- a/test/helpers/ndr_ui/bootstrap_helper_test.rb +++ b/test/helpers/ndr_ui/bootstrap_helper_test.rb @@ -298,14 +298,14 @@ class BootstrapHelperTest < ActionView::TestCase # TODO: bootstrap_pagination_tag(*args, &block) test 'button_control_group' do - assert_dom_equal '
' \ + assert_dom_equal '
' \ 'Apples
', button_control_group('Apples') html = button_control_group(class: 'some_class') do 'Pears' end - assert_dom_equal '
' \ + assert_dom_equal '
' \ '
Pears
', html @@ -334,19 +334,19 @@ class BootstrapHelperTest < ActionView::TestCase test 'bootstrap_horizontal_form_group' do # Test with standard columns: actual = bootstrap_horizontal_form_group('The Label') { 'This is the content' } - expected = '