Skip to content

Submit-Once Feature, Coffee Chat Form (Member) - #1217

Merged
zkdlinyne merged 11 commits into
mainfrom
ek/submit-once-coffee-chat-form
Nov 6, 2026
Merged

zkdlinyne merged 11 commits into
mainfrom
ek/submit-once-coffee-chat-form

Conversation

@zkdlinyne

@zkdlinyne zkdlinyne commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

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.

  • This time record lives in a new coffee-chat-category-responses collection, 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 (😢).
  • POST /coffee-chat-categories/responses checks that record in the same transaction that updates the category lists. If it already exists, the request fails and membership is left unchanged.
  • An unknown category name, a bad payload, or a missing NetID is rejected before that record is written, so those mistakes do not use up the submission.
  • GET /coffee-chat-categories/responses now returns { categories, submitted }.
  • After a successful submit, and on later visits, the checkboxes and Submit button are replaced by the categories they chose and a note to contact a lead. Submitting nothing shows that they are not listed on any categories.
  • CSV upload and setMemberCategories still 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

  1. Run locally, open Coffee Chat Form under Forms as a member.
  2. Click some categories you fit.
  3. Click Submit
  4. Post submission, you should be unable to see the submit button, instead a note to contact leads if you wish to change your submission in any way and a copy of your responses, listed in bullet points.

P.S. This PR is pretty large because of the frontend UI changes post-submission, cutting it close

@zkdlinyne
zkdlinyne requested a review from a team as a code owner October 31, 2026 21:12
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: ba0b0a15-c91f-496a-b408-cc67b9678aec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dti-github-bot

dti-github-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 288.

@ladriennel ladriennel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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!

Comment thread frontend/src/API/CoffeeChatAPI.ts Outdated
}

public static async getCoffeeChatCategoriesByUser(): Promise<string[]> {
public static async getCoffeeChatCategoriesByUser(): Promise<{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: the backend GET is now getCoffeeChatCategoryForm, but the frontend still calls it getCoffeeChatCategoriesByUser. Could we rename the frontend one to match?

@zkdlinyne
zkdlinyne requested a review from ladriennel November 6, 2026 03:48

@ladriennel ladriennel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me now!

@zkdlinyne
zkdlinyne merged commit 09c2b00 into main Nov 6, 2026
14 checks passed
@zkdlinyne
zkdlinyne deleted the ek/submit-once-coffee-chat-form branch November 6, 2026 19:30
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