-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-771] Advanced Table Rails Refactor and Multi Column Headers (#…
…4052) [Runway Story](https://runway.powerhrg.com/backlog_items/PBNTR-767) - ✅ Refactor AdvancedTable for Rails to use html table instead of divs - ✅ Redo toggling logic to account change - ✅ children rows to retain expanded state when any item is toggled - ✅ toggle all button to have access to expandedRows state - ✅ Add logic for multiple column headers for Rails side of Advanced Table - ✅ Add logic for multiple levels of columns, not just 2 - ✅ Styling for multiple headers variant ![Screenshot 2024-12-31 at 4 01 10 PM](https://github.com/user-attachments/assets/1111093b-fda3-4fd6-979d-91cb9d171a86)
- Loading branch information
Showing
15 changed files
with
428 additions
and
151 deletions.
There are no files selected for viewing
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/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
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
43 changes: 43 additions & 0 deletions
43
playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.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,43 @@ | ||
<% column_definitions = [ | ||
{ | ||
accessor: "year", | ||
label: "Year", | ||
cellAccessors: ["quarter", "month", "day"], | ||
}, | ||
{ | ||
label: "Enrollment Data", | ||
columns: [ | ||
{ | ||
accessor: "newEnrollments", | ||
label: "New Enrollments", | ||
}, | ||
{ | ||
accessor: "scheduledMeetings", | ||
label: "Scheduled Meetings", | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Performance Data", | ||
columns: [ | ||
{ | ||
accessor: "attendanceRate", | ||
label: "Attendance Rate", | ||
}, | ||
{ | ||
accessor: "completedClasses", | ||
label: "Completed Classes", | ||
}, | ||
{ | ||
accessor: "classCompletionRate", | ||
label: "Class Completion Rate", | ||
}, | ||
{ | ||
accessor: "graduatedStudents", | ||
label: "Graduated Students", | ||
}, | ||
], | ||
}, | ||
] %> | ||
|
||
<%= pb_rails("advanced_table", props: { id: "beta_table_with_headers", table_data: @table_data, column_definitions: column_definitions }) %> |
58 changes: 58 additions & 0 deletions
58
.../pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.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,58 @@ | ||
<% column_definitions = [ | ||
{ | ||
accessor: "year", | ||
label: "Year", | ||
cellAccessors: ["quarter", "month", "day"], | ||
}, | ||
{ | ||
label: "Enrollment Data", | ||
columns: [ | ||
{ | ||
label: "Enrollment Stats", | ||
columns: [ | ||
{ | ||
accessor: "newEnrollments", | ||
label: "New Enrollments", | ||
}, | ||
{ | ||
accessor: "scheduledMeetings", | ||
label: "Scheduled Meetings", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Performance Data", | ||
columns: [ | ||
{ | ||
label: "Completion Metrics", | ||
columns: [ | ||
{ | ||
accessor: "completedClasses", | ||
label: "Completed Classes", | ||
}, | ||
{ | ||
accessor: "classCompletionRate", | ||
label: "Class Completion Rate", | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Attendance", | ||
columns: [ | ||
{ | ||
accessor: "attendanceRate", | ||
label: "Attendance Rate", | ||
}, | ||
{ | ||
accessor: "scheduledMeetings", | ||
label: "Scheduled Meetings", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
] %> | ||
|
||
<%= pb_rails("advanced_table", props: { id: "beta_table_with_muilti_headers", table_data: @table_data, column_definitions: column_definitions }) %> |
5 changes: 4 additions & 1 deletion
5
playbook/app/pb_kits/playbook/pb_advanced_table/docs/example.yml
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
Oops, something went wrong.