Skip to content

Commit 0a16c83

Browse files
authored
fix bootstrap 5 data attribute with BS namespace (#35)
1 parent a512de8 commit 0a16c83

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## [Unreleased]
2-
+* no unreleased changes
2+
* fix bootstrap 5 data attribute with BS namespace
33

44
## 2.4.0 / 2025-01-31
55
### Changed

app/helpers/ndr_error/errors_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def multiple_occurrences_badge_for(fingerprint)
3333

3434
text = "+ #{fingerprint.count - 1}"
3535
opts = {
36-
'class' => 'badge badge-info',
37-
'data-toggle' => 'tooltip',
38-
'data-placement' => 'right',
39-
'title' => "Since #{fingerprint.created_at.to_formatted_s(:db)}"
36+
'class' => 'badge badge-info',
37+
'data-bs-toggle' => 'tooltip',
38+
'data-bs-placement' => 'right',
39+
'data-bs-title' => "Since #{fingerprint.created_at.to_formatted_s(:db)}"
4040
}
4141

4242
content_tag(:span, text, opts)

app/views/ndr_error/errors/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<%= previous_button_for(@error.previous) %>
2323

2424
<div class="btn-group">
25-
<a class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" href="#">
25+
<a class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" href="#">
2626
<%= pluralize(@error.similar_errors.length - 1, 'Similar Error') %> Stored
2727
<span class="caret"></span>
2828
</a>
@@ -45,7 +45,7 @@
4545

4646
<% if @fingerprint.caused_error_fingerprints.any? %>
4747
<div class="btn-group">
48-
<a class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" href="#">
48+
<a class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" href="#">
4949
<%= pluralize(@fingerprint.caused_error_fingerprints.length, 'Downstream Error') %> Stored
5050
<span class="caret"></span>
5151
</a>

test/unit/helpers/ndr_error/errors_helper_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class ErrorsHelperTest < ActionView::TestCase
5656
print.stubs(count: 3)
5757

5858
actual = multiple_occurrences_badge_for(print)
59-
expected = '<span class="badge badge-info" data-placement="right"' \
60-
' data-toggle="tooltip" title="Since 2015-01-01">+ 2</span>'
59+
expected = '<span class="badge badge-info" data-bs-placement="right"' \
60+
' data-bs-toggle="tooltip" data-bs-title="Since 2015-01-01">+ 2</span>'
6161

6262
assert_dom_equal expected, actual
6363
end

0 commit comments

Comments
 (0)