Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPA and Grade Distribution in Search Results #671

Merged
merged 94 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
fc9e52c
Add instructor to queryGrades
MinhxNguyen7 Aug 22, 2023
c9ccbbd
GPA cell in section table
MinhxNguyen7 Aug 23, 2023
800514b
Reasonable desktop styling
MinhxNguyen7 Aug 23, 2023
e4b021c
Button to hide GPA column
MinhxNguyen7 Aug 23, 2023
efd2f90
Basic grades popup functionality
MinhxNguyen7 Aug 23, 2023
f91d405
Close distribution on clickaway
MinhxNguyen7 Aug 23, 2023
4a8014d
Styling for GPA text
MinhxNguyen7 Aug 23, 2023
9cd4fc9
Hide Zotistics link in GPA popup
MinhxNguyen7 Aug 23, 2023
e673331
Close GPA distribution on re-click
MinhxNguyen7 Aug 23, 2023
ef39739
Add instructor to grade cache key
MinhxNguyen7 Aug 23, 2023
f3a5bf3
Section GPA graph for particular instructor
MinhxNguyen7 Aug 23, 2023
469b8d3
Restore labels to GPA graph
MinhxNguyen7 Aug 23, 2023
b28cd8a
Did todo
MinhxNguyen7 Aug 23, 2023
ead9dad
Replace Zotistics link with anchor on graph
MinhxNguyen7 Aug 26, 2023
7aadb4a
Clear gradesCache when clearing websocCache
MinhxNguyen7 Aug 26, 2023
a556c05
Lock for gradesCache
MinhxNguyen7 Aug 26, 2023
6f245d6
Helpful graphQL request failure
MinhxNguyen7 Aug 26, 2023
66b07a4
Remove debug print
MinhxNguyen7 Aug 26, 2023
829502f
Add classname to graph anchor
MinhxNguyen7 Aug 26, 2023
c427213
Disable scroll when popover
MinhxNguyen7 Aug 26, 2023
da49e25
Styled table for good spacing and side scrolling
MinhxNguyen7 Aug 26, 2023
249c13b
Remove Todo
MinhxNguyen7 Aug 26, 2023
b313fa6
Add Tabs for Sat/Sun on Map (#632)
KevinWu098 Aug 22, 2023
c1e2c37
Add support for new API time formats (#669)
KevinWu098 Aug 27, 2023
93f43bb
Revert "Add support for new API time formats (#669)" (#678)
KevinWu098 Aug 27, 2023
b43d6f0
Change "Copy Section Code" to Chip (#668)
KevinWu098 Aug 27, 2023
55057e8
Change 'boolean' visit value to string (#657)
KevinWu098 Aug 27, 2023
0309898
Add Course Level Filtering, Restyle Advanced Search (#677)
KevinWu098 Aug 30, 2023
53b2336
Schedule Select element closes with [esc] (#638)
KevinWu098 Aug 31, 2023
deec07d
Rename tabs for descriptiveness and concision (#675)
MinhxNguyen7 Aug 31, 2023
2855765
Add support for new API time formats (#669) (#679)
KevinWu098 Sep 4, 2023
3306538
Swap staging 68 to prod endpoint (#683)
KevinWu098 Sep 4, 2023
1703319
Overhaul Schedule Select | Edit | Delete (#659)
KevinWu098 Sep 4, 2023
91b5a86
Fix Light Mode Coloring (#684)
KevinWu098 Sep 4, 2023
5e5f346
Refactor .ics exports for new time formats (#685)
KevinWu098 Sep 4, 2023
52162b5
Add Vitest to GitHub Actions (#682)
EricPedley Sep 5, 2023
c50fc9f
Fix helper function: removeDuplicateMeetings (#688)
KevinWu098 Sep 6, 2023
7565b61
Switch to staging-88 PP GraphQL endpoint
MinhxNguyen7 Sep 7, 2023
e13cbd5
Generalize graphQL query function
MinhxNguyen7 Sep 7, 2023
c35262a
Merge branch 'main' into gpa
MinhxNguyen7 Sep 7, 2023
06f5940
Rename variables loadCourses for descriptiveness
MinhxNguyen7 Sep 7, 2023
9cdf18a
Implement aggregateGroupedGrades endpoint
MinhxNguyen7 Sep 7, 2023
71863c6
Move grades to separate module and class
MinhxNguyen7 Sep 7, 2023
8bc5e05
cacheOnly for section table grades
MinhxNguyen7 Sep 7, 2023
625682c
Fix typo in import statement
MinhxNguyen7 Sep 7, 2023
09f1a3a
Remove extraneous information from grades cache
MinhxNguyen7 Sep 7, 2023
736e505
Move Zotistics link to grades popup title
MinhxNguyen7 Sep 7, 2023
72e7f43
Refactor and set section table styling
MinhxNguyen7 Sep 7, 2023
77c1e4e
Fix bulk cache population cache hit
MinhxNguyen7 Sep 7, 2023
97e6fea
Refactor gpa (#689)
ap0nia Sep 7, 2023
1424923
fix: styling issues
ap0nia Sep 7, 2023
01c8b02
Tweak column widths for better mobile UX
MinhxNguyen7 Sep 7, 2023
6dd7e40
Fix GPA font size on mobile
MinhxNguyen7 Sep 7, 2023
be54eed
Fix average grade popup
MinhxNguyen7 Sep 7, 2023
7c3a53f
Update queryGrades documentation
MinhxNguyen7 Sep 7, 2023
d9143c0
Fix grades query with GEs
MinhxNguyen7 Sep 7, 2023
2ab1f9a
Bugfix for reversion to old MUI
MinhxNguyen7 Sep 7, 2023
d64bc2c
Merge branch 'main' into gpa
MinhxNguyen7 Sep 7, 2023
3617dff
Fix grades in added courses
MinhxNguyen7 Sep 7, 2023
fc77616
Correct documentation in grades popup
MinhxNguyen7 Sep 8, 2023
ccfb6e9
Filter out "ANY" GE
MinhxNguyen7 Sep 8, 2023
65c3238
Change grades endpoint name
MinhxNguyen7 Sep 8, 2023
c41cdce
TabStore default export
MinhxNguyen7 Sep 9, 2023
a683be5
Remove remnants of tab store from RightPaneStore
MinhxNguyen7 Sep 9, 2023
78d393d
Migrate columns to separate store
MinhxNguyen7 Sep 9, 2023
d0a59a7
Remove remnant of old column store
MinhxNguyen7 Sep 9, 2023
190fe46
Enable/disable columns independantly from selected
MinhxNguyen7 Sep 9, 2023
6627b6e
Disable GPA column in Added pane
MinhxNguyen7 Sep 10, 2023
073a449
Remove redundant import
MinhxNguyen7 Sep 16, 2023
2bd297b
Apply suggestions from review
MinhxNguyen7 Sep 16, 2023
06427cd
Merge branch 'main' into gpa
MinhxNguyen7 Sep 16, 2023
d772d23
Add missing parenthesis
MinhxNguyen7 Sep 16, 2023
0f70d1e
Add course and instructor to graph title
MinhxNguyen7 Sep 16, 2023
9487d02
Fix styling inconsistency
MinhxNguyen7 Sep 16, 2023
880d3f6
Tweak section table columns spacings
MinhxNguyen7 Sep 16, 2023
ba6af16
feat: multiple locations on courses (#696)
ap0nia Sep 16, 2023
d310f3a
Remove underline from location link (#699)
MinhxNguyen7 Sep 16, 2023
8d37524
fixing behavior of buttons in AddedPane (#703)
srukelman Sep 21, 2023
9b14840
Make it clear you import a .ics file to other calendars. (#706)
EricPedley Sep 27, 2023
3368692
Added Analytics to Column Toggle (#707)
KevinWu098 Sep 27, 2023
ba8c973
Update fuzzy search index (#710)
EricPedley Sep 28, 2023
c7efe15
Fix Undefined Trim Bug (#709)
KevinWu098 Sep 29, 2023
67c7b0d
Fix Added Pane Course Grouping (#711)
KevinWu098 Sep 29, 2023
8286e60
Update reviewer lottery roster
EricPedley Sep 30, 2023
f70aa8d
Parallelize Schedule Load Websoc Requests (#713)
EricPedley Oct 1, 2023
e32c6d2
Resolve merge conflict
MinhxNguyen7 Oct 1, 2023
192a4b1
Re-add column analytics trigger
MinhxNguyen7 Oct 1, 2023
7229405
Update graphql/grades endpoint to PP prod
MinhxNguyen7 Oct 7, 2023
24d116e
Apply review suggestions
MinhxNguyen7 Oct 8, 2023
537a996
Make activeColumns dervied in ColumnStore
MinhxNguyen7 Oct 8, 2023
b77c0c7
update dependancy of tableMinWidth in SectionTable
MinhxNguyen7 Oct 10, 2023
ef40ee2
Merge branch 'main' into gpa
MinhxNguyen7 Oct 10, 2023
926cda4
Fix graphql field for queryGrades
MinhxNguyen7 Oct 10, 2023
edef526
Merge branch 'main' into gpa
MinhxNguyen7 Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) {
function SectionTable(props: SectionTableProps) {
const { courseDetails, term, allowHighlight, scheduleNames, analyticsCategory } = props;

const [selectedColumns, getActiveColumns] = useColumnStore((store) => [
store.selectedColumns,
store.getActiveColumns,
]);
const [selectedColumns, activeColumns] = useColumnStore((store) => [store.selectedColumns, store.activeColumns]);

const isMobileScreen = useMediaQuery(`(max-width: ${MOBILE_BREAKPOINT})`);

Expand All @@ -124,7 +121,7 @@ function SectionTable(props: SectionTableProps) {
*/
const tableMinWidth = useMemo(() => {
const width = isMobileScreen ? 600 : 780;
const numActiveColumns = getActiveColumns().length;
const numActiveColumns = activeColumns.length;
return (width * numActiveColumns) / TOTAL_NUM_COLUMNS;
}, [isMobileScreen, selectedColumns]);
MinhxNguyen7 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -180,7 +177,7 @@ function SectionTable(props: SectionTableProps) {
<TableCell padding="none" />

{tableHeaderColumnEntries
.filter(([column]) => getActiveColumns().includes(column as SectionTableColumn))
.filter(([column]) => activeColumns.includes(column as SectionTableColumn))
.map(([column, { label, width }]) => (
<TableCell
key={column}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,7 @@ const LocationsCell = withStyles(styles)((props: LocationsCellProps) => {
const buildingId = locationIds[buildingName];
return (
<Fragment key={meeting.timeIsTBA + bldg}>
<Link
className={classes.mapLink}
to={`/map?location=${buildingId}`}
onClick={focusMap}
>
<Link className={classes.mapLink} to={`/map?location=${buildingId}`} onClick={focusMap}>
{bldg}
</Link>
<br />
Expand Down Expand Up @@ -498,7 +494,7 @@ const tableBodyCells: Record<SectionTableColumn, React.ComponentType<any>> = {
const SectionTableBody = withStyles(styles)((props: SectionTableBodyProps) => {
const { classes, section, courseDetails, term, allowHighlight, scheduleNames } = props;

const getActiveColumns = useColumnStore(store => store.getActiveColumns);
const activeColumns = useColumnStore((store) => store.activeColumns);

const [addedCourse, setAddedCourse] = useState(
AppStore.getAddedSectionCodes().has(`${section.sectionCode} ${term}`)
Expand Down Expand Up @@ -616,7 +612,7 @@ const SectionTableBody = withStyles(styles)((props: SectionTableBodyProps) => {
)}

{Object.entries(tableBodyCells)
.filter(([column]) => getActiveColumns().includes(column as SectionTableColumn))
.filter(([column]) => activeColumns.includes(column as SectionTableColumn))
.map(([column, Component]) => {
return (
// All of this is a little bulky, so if the props can be added specifically to activeTableBodyColumns, LMK!
Expand Down
22 changes: 12 additions & 10 deletions apps/antalmanac/src/stores/ColumnStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ interface ColumnStore {
// Columns that are selected in the dropdown
selectedColumns: boolean[];

/**
*
* @returns The columns that should be displayed in the section table. They need to be both selected and enabled.
*/
getActiveColumns: () => SectionTableColumn[];
// Columns that should be displayed in the section table. They need to be both selected and enabled.
// This is updated whenever enabledColumns or selectedColumns are updated.
activeColumns: SectionTableColumn[];

/**
* Used by the Select menu in CoursePaneButtonRow to toggle columns on/off.
Expand All @@ -57,15 +55,16 @@ interface ColumnStore {
*/
export const useColumnStore = create<ColumnStore>((set, get) => {
return {
activeColumns: Array.from(SECTION_TABLE_COLUMNS),
enabledColumns: SECTION_TABLE_COLUMNS.map(() => true),
selectedColumns: SECTION_TABLE_COLUMNS.map(() => true),
getActiveColumns: () =>
SECTION_TABLE_COLUMNS.filter((_, index) => get().enabledColumns[index] && get().selectedColumns[index]),
activeColumns: Array.from(SECTION_TABLE_COLUMNS),
setSelectedColumns: (columns: SectionTableColumn[]) => {
set(() => {
const selectedColumns = SECTION_TABLE_COLUMNS.map((column) => columns.includes(column));
return { selectedColumns: selectedColumns };
const activeColumns = SECTION_TABLE_COLUMNS.filter(
(_, index) => get().enabledColumns[index] && get().selectedColumns[index]
);
return { selectedColumns: selectedColumns, activeColumns: activeColumns };
});
logAnalytics({
category: analyticsEnum.classSearch.title,
Expand All @@ -75,7 +74,10 @@ export const useColumnStore = create<ColumnStore>((set, get) => {
setColumnEnabled: (column: SectionTableColumn, state: boolean) => {
set((prevState) => {
prevState.enabledColumns[SECTION_TABLE_COLUMNS.indexOf(column)] = state;
return { enabledColumns: prevState.enabledColumns };
const activeColumns = SECTION_TABLE_COLUMNS.filter(
(_, index) => prevState.enabledColumns[index] && prevState.selectedColumns[index]
);
return { enabledColumns: prevState.enabledColumns, activeColumns: activeColumns };
});
},
};
Expand Down