-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-743] Advanced Table - Add Responsiveness to Rails kit (#4151)
**What does this PR do?** A clear and concise description with your runway ticket url. As a Playbook dev, I want to add Responsiveness to our Rails Advanced Table kit, so that I can ensure parity between our Rails and React kits. **How to test?** Steps to confirm the desired behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See addition/change #### 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.
- Loading branch information
Showing
11 changed files
with
109 additions
and
29 deletions.
There are no files selected for viewing
21 changes: 13 additions & 8 deletions
21
playbook/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
<%= pb_content_tag do %> | ||
<%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }.merge(object.table_props)) do %> | ||
<% if content.present? %> | ||
<% content.presence %> | ||
<% else %> | ||
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion }) %> | ||
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions }) %> | ||
<% end %> | ||
<% end %> | ||
<%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive: "none", dark: dark }.merge(object.table_props)) do %> | ||
<% if content.present? %> | ||
<% content.presence %> | ||
<% else %> | ||
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, | ||
enable_toggle_expansion: object.enable_toggle_expansion, | ||
responsive: object.responsive }) %> | ||
<%= pb_rails("advanced_table/table_body", props: { id: object.id, | ||
table_data: object.table_data, | ||
column_definitions: object.column_definitions, | ||
responsive: object.responsive }) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
<% column_definitions = [ | ||
{ | ||
accessor: "year", | ||
label: "Year", | ||
cellAccessors: ["quarter", "month", "day"], | ||
}, | ||
{ | ||
accessor: "newEnrollments", | ||
label: "New Enrollments", | ||
}, | ||
{ | ||
accessor: "scheduledMeetings", | ||
label: "Scheduled Meetings", | ||
}, | ||
{ | ||
accessor: "attendanceRate", | ||
label: "Attendance Rate", | ||
}, | ||
{ | ||
accessor: "completedClasses", | ||
label: "Completed Classes", | ||
}, | ||
{ | ||
accessor: "classCompletionRate", | ||
label: "Class Completion Rate", | ||
}, | ||
{ | ||
accessor: "graduatedStudents", | ||
label: "Graduated Students", | ||
}, | ||
] %> | ||
|
||
<%= pb_rails("title", props: { size: 4 }) do %> Not Responsive <% end %> | ||
<%= pb_rails("advanced_table", props: { id: "table_props_table_non_responsive", table_data: @table_data, column_definitions: column_definitions, responsive: "none" }) %> | ||
|
||
<%= pb_rails("title", props: { padding_top: "sm", size: 4 }) do %> Responsive as Default <% end %> | ||
<%= pb_rails("advanced_table", props: { id: "table_props_table_responsive", table_data: @table_data, column_definitions: column_definitions }) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
playbook/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
playbook/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters