[x] dropdown button to choose between submitting as anonymous user or as self
[x] remove hardcoded user
[x] create auth user at account creation and populate it as part of the jwt object with next-auth
item 2 & 3 tracked as separate tasks at #115
closes #83, closes #85
changes
new
+ <ReviewForm/> component
+ <ReviewFormSection/> component
+ toTitleCase function
+ professor, label trpc routers
+ <SubmitButtonGroup/> component
update
move <Combobox/> to submit module
update <Combobox/> to forward refs
allow <Field/> to accept className overrides
make <Tag/> client component
implementation
ReviewForm consists of 2 ReviewFormSections, one of which is marked as optional (professor)
zod object takes into account the type of review using a discriminated union
professor review is optional if reviewable type is "course", otherwise, it's required
assumes review label names to be displayed is return of this function (name) => toTitleCase(name.replaceAll('_', ' ')) after passing name in db.labels to it
assumes school is by default, SMU
note
searching and filtering for course/professor is not yet feature complete and will not be addressed in this PR
TODO:
item 2 & 3 tracked as separate tasks at #115
closes #83, closes #85
changes
new
<ReviewForm/>
component<ReviewFormSection/>
componenttoTitleCase
functionprofessor
,label
trpc routers<SubmitButtonGroup/>
componentupdate
<Combobox/>
tosubmit
module<Combobox/>
to forward refs<Field/>
to acceptclassName
overrides<Tag/>
client componentimplementation
"course"
, otherwise, it's required(name) => toTitleCase(name.replaceAll('_', ' '))
after passingname
indb.labels
to itSMU
note
searching and filtering for course/professor is not yet feature complete and will not be addressed in this PR
preview