seas-computing / course-planner

SEAS Course Planning Application. JSDoc Docs at: https://seas-computing.github.io/course-planner/
0 stars 1 forks source link

Filters on Faculty page reset between academic year #634

Closed jonseitz closed 1 year ago

jonseitz commented 1 year ago

This is based on feedback from Patrick Ulrich:

When in the courses view, if I filter by a course number and then
change the academic year, it remembers that filter (so for example,
I can filter in 50a, AP50a shows up, and then I can flip through
the academic year list and see the details quickly for that
course).  But the same functionality is not available in the
faculty view. If I filter by a name (for example, my own last
name), and then change the year, the filter is gone and the full
list shows up.  There are lots of times when we want to see what an
individual faculty member has taught over the years, so it would be
great if the filter could be retained as you flip through the
different years (like it is in the Courses view)

At a quick glace, I think it's a difference in how the two pages store the filters and the table content.

Faculty keeps just the content in the FacultyPage and passes that down to the FacultyScheduleTable, where the filter data lives. Any time the content changes on the FacultyPage, it triggers a rerender of the FacultyScheduleTable, which zeroes out all the filters (and any other state values saved there).

Courses keeps both the filter data and the content at the CoursePage level, then passes all of that into the CourseInstanceTable. When the content changes at the CoursePage level, it can re-render the CourseInstanceTable without affecting any of the other props.

I think it's worth trying to refactor the FacultyPage to operate more like the CoursePage, but I haven't dug very deeply into what that might entail.