Skip to content

Commit 7c5d08c

Browse files
[PLAY-1752] Implement pb_content_tag (#4203)
**What does this PR do?** A clear and concise description with your runway ticket url. Update Icon, Layout, Legend, Message kits to no longer use `content_tag` and use our new `pb_content_tag` There should be no visible changes to the kits. #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code.
1 parent 05b0d00 commit 7c5d08c

File tree

10 files changed

+11
-54
lines changed

10 files changed

+11
-54
lines changed

playbook/app/pb_kits/playbook/pb_icon/icon.html.erb

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
<%= object.icon.html_safe %>
66
</span>
77
<% else %>
8-
<%= content_tag(:i, nil,
9-
id: object.id,
10-
data: object.data,
11-
class: object.classname,
12-
**combined_html_options
13-
) %>
8+
<%= pb_content_tag(:i) do %>
9+
<% end %>
1410
<%= content_tag(:span, nil,
1511
aria: { label: "#{object.icon} icon" }.merge(object.aria),
1612
hidden: true
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(object.tag,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content.presence %>
73
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(object.tag,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content.presence %>
73
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(object.tag,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content.presence %>
73
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(:div,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content %>
73
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(:div,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content.presence %>
73
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= content_tag(:div,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
62
<%= content.presence %>
73
<% end %>

playbook/app/pb_kits/playbook/pb_legend/legend.html.erb

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<%= content_tag(:div, object.text,
2-
aria: object.aria,
3-
id: object.id,
4-
data: object.data,
5-
class: object.classname,
6-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
72
<%= pb_rails("body", props: {color: object.body_color}) do %>
83
<span style="<%= object.custom_color %>" class=<%= object.custom_color_class %>></span>
94
<%= pb_rails("title", props: { dark: object.dark, text: object.prefix_text, tag: "span", size: 4 }) %>

playbook/app/pb_kits/playbook/pb_message/message.html.erb

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<%= content_tag(:div,
2-
aria: object.aria,
3-
id: object.id,
4-
data: object.data,
5-
class: object.classname,
6-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
72
<% if object.valid? %>
83
<%= pb_rails("avatar", props: {
94
name: object.avatar_name,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
<%= content_tag(:div,
2-
id: object.id,
3-
data: object.data,
4-
class: object.classname,
5-
aria: object.aria,
6-
**combined_html_options) do %>
1+
<%= pb_content_tag do %>
72
<%= content %>
83
<% end %>

0 commit comments

Comments
 (0)