Update grades_-/staff_semester_view to css grid - #2748
Conversation
ff3544f to
d9846fe
Compare
|
There are still TODOs in the code. Is there something that we should already look at? |
Good point, I overlooked those. Something, something self review.... Still, @niklasmohrin I would appreciate a review. Resolving the TODOs should only result in a minimal diff. (I switched it to draft anyway.) |
f09c01d to
31a0c75
Compare
| protected readonly filterButtons: HTMLButtonElement[] = []; | ||
| protected readonly resetFilterButton?: HTMLButtonElement; |
There was a problem hiding this comment.
no one is providing any value for these two attributes, right?
| for (const orderElement of headerContainer.querySelectorAll<HTMLElement>(".col-order")) { | ||
| sortableHeaders.set(orderElement.dataset.col!, orderElement); |
There was a problem hiding this comment.
Same in old version, but: Why are we not querying for [data-col] here?
| private searchInput: HTMLInputElement; | ||
| protected readonly resetSearch?: HTMLButtonElement; | ||
| protected rows: Row[] = []; | ||
| export class DataGrid { |
There was a problem hiding this comment.
It seems that the base data grid is now even more complicated and the responsibilities are less clear. I wonder if there is some way to decompose the responsibilities into more modules/classes. Intuitively, I would say that we have
a) sorting of rows b) filtering of rows c) save and restore of state d) mirroring internal state to the DOM. These responsibilities are somewhat intertwined though.
Maybe one possible way to split this is to have one class that does all the sorting, filtering, state management, but does not interact with the DOM, and another class drives an instance according to what users to in the DOM. Not sure though.
|
Discussion today:
|
Refactors the DataGrid class to provide different factory functions for different HTML representations of the tables. Signed-off-by: Felix Koch <dev@felixkoch.at>
Signed-off-by: Felix Koch <dev@felixkoch.at>
Refactors the DataGrid class to provide different factory functions for different HTML representations of the tables.
Updates the tables in:
grades_semester_view.htmlstaff_semester_view.html