Skip to content

Conversation

@AaDalal
Copy link
Contributor

@AaDalal AaDalal commented Dec 23, 2023

This PR adds support for course attributes to PCP, including an attribute filter and adding attributes to course details. Attributes include those Wharton, SEAS, SAS, and Nursing, as well as additional ones for GSE, LPS, Grade Mode etc.

TODO:

  • fix issue of page overflowing when there are many attributes available
  • fix attributes selection dropdown auto closing after selection

@AaDalal AaDalal requested a review from andyjiang3 December 23, 2023 04:23
@AaDalal AaDalal requested review from esinx and removed request for andyjiang3 January 27, 2024 22:09
Copy link
Member

@esinx esinx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions & type-related questions!

break;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could possibly make this a bit simpler by using .some method!
filterData.selectedAttrs && Object.values(filterData.selectedAttrs).some(selected => selected)

GSE = "GSE",
LAW = "LAW",
MEDICINE = "MED",
GRADE_MODE = "MODE", // this isn't really a school, but it's used for course attributes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we could split using union types? or is it better left as a one-off? Would love to hear more background behind this decision!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 reasons

  1. blindly following the conventions of the rest of this file (it was probably written before union types?)
  2. easier to guarantee exhaustive matching (?)

I'm not a typescript expert, so I'll defer to you

@AaDalal AaDalal requested a review from esinx January 28, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants