Repository navigation
Submit-Once Feature, Coffee Chat Form (Member) - #1217
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
[diff-counting] Significant lines: 288. |
ladriennel
left a comment
There was a problem hiding this comment.
Thanks for working on the submit-once feature! Just left a few comments!
| * @param categoryNames - category names the member fits | ||
| * @returns the category names the member now belongs to | ||
| */ | ||
| static async submitMemberCategories( |
There was a problem hiding this comment.
Nothing clears coffee-chat-category-responses, so next sem everyone who submitted categories this semester won't be able to submit again. Since "Archive all coffee chats" is our semester reset, could archiveCoffeeChats also clear this collection? It should probably also clear every category's members.
And with that, I think it would be a good idea to update the confirm text in CoffeeChats.tsx line 101 to say so, e.g. "This will archive all coffee chats and reset everyone's coffee chat category responses. This cannot be undone." Lmk what you think though!
There was a problem hiding this comment.
Good point, it is the semester reset, so it should prob clear the category member lists and the "submit-once" records. I think the category names themselves would stay tho. Let me update archiveCoffeeChats and the documentation too!
| } | ||
|
|
||
| public static async getCoffeeChatCategoriesByUser(): Promise<string[]> { | ||
| public static async getCoffeeChatCategoriesByUser(): Promise<{ |
There was a problem hiding this comment.
nit: the backend GET is now getCoffeeChatCategoryForm, but the frontend still calls it getCoffeeChatCategoriesByUser. Could we rename the frontend one to match?
ladriennel
left a comment
There was a problem hiding this comment.
Looks good to me now!
Summary
Previously, nothing prevented members on IDOL for switching up their responses to the coffee chat categories form multiple times a semester. This guard would be helpful and also not too difficult to implement, so we decided to add it. Now, a member can submit the coffee chat category form once. A second submit is rejected and the first set of categories stays in place.
coffee-chat-category-responsescollection, one document per NetID, separate from the category lists. An empty selection still counts as a submission, since we still want members to submit the form even if they don't fit any categories (😢)./coffee-chat-categories/responseschecks that record in the same transaction that updates the category lists. If it already exists, the request fails and membership is left unchanged./coffee-chat-categories/responsesnow returns{ categories, submitted }.setMemberCategoriesstill update the lists directly and do not read or write the one-time record, so leads can keep changing responses until the admin page exists.Test Plan
P.S. This PR is pretty large because of the frontend UI changes post-submission, cutting it close