Skip to content

136 kitchen staff view permission page adding categories and appropriate filtering#152

Closed
idavoong wants to merge 22 commits into
developfrom
136-kitchen-staff-view-permission-page-adding-categories-and-appropriate-filtering
Closed

136 kitchen staff view permission page adding categories and appropriate filtering#152
idavoong wants to merge 22 commits into
developfrom
136-kitchen-staff-view-permission-page-adding-categories-and-appropriate-filtering

Conversation

@idavoong
Copy link
Copy Markdown
Collaborator

@idavoong idavoong commented Apr 27, 2026

Developer: Ida Voong

Closes #136

Pull Request Summary

  • make sure kitchen staff cannot create/edit/delete recipes (and publish drafts?)
  • filter by user role in permissions page
  • sort users in permissions page

Modifications

  • src/app/drafts/page.tsx: move client code into src/components/DraftsPageClient.tsx, fetch user role
  • src/app/permissions/page.tsx: move client code into src/components/PermissionsClient.tsx, edit test users
  • src/components/PermissionsClient.tsx: filter and sort users
  • src/app/recipe/page.tsx: fetch user role
  • src/components/CardGrid.tsx: pass user role to components
  • src/components/CategoryToggle.tsx: accept RoleValue as a type to reuse code from recipe page
  • src/components/ComboCard.tsx: only admin can edit, publish, and delete draft combos
  • src/components/MealBrowser.tsx: only admin can create new recipe; pass user role to components
  • src/components/RecipeCard.tsx: only admin can edit, publish, and delete draft recipes
  • src/components/RecipePageClient.tsx: pass user role to components
  • src/components/SortPermissionsButton.tsx: edit onSortChange to expose the selected sort type to parent component
  • src/components/ViewRecipePopUp.tsx: only admin can edit recipes (pop ups in recipe page)
  • src/lib/types.ts: add new type for user roles
  • src/components/menuPlanning/RecipeDatabase.tsx: edit component type

Testing Considerations

  • only admin can create/edit/publish/delete combos and recipes
  • filtering on permissions page
  • sorting on permissions page

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Screenshots/Screencast

image
  • I think on Haixin's branch she moved the checkboxes and stuff to the left side so I didn't do it here
image - view for dining site staff and not logged in

Notes:

  • "can only view allergen/filter tags only when clicked on recipe or combo cards on Recipe page" not implemented yet

idavoong and others added 3 commits April 27, 2026 02:30
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meals-that-connect-25 Ready Ready Preview, Comment May 11, 2026 2:57am

@idavoong
Copy link
Copy Markdown
Collaborator Author

I implemented permissions based on Admin/Kitchen Staff role, but I noticed that on the permissions page that there is a yes/no option. Sorting is based on the schema in mongodb because theres a createdAt and updatedAt. I think how we're currently showing users and perms deviates from schema so lmk what to do with merge conflicts.

soramicha

This comment was marked as outdated.

@soramicha
Copy link
Copy Markdown
Collaborator

I implemented permissions based on Admin/Kitchen Staff role, but I noticed that on the permissions page that there is a yes/no option. Sorting is based on the schema in mongodb because theres a createdAt and updatedAt. I think how we're currently showing users and perms deviates from schema so lmk what to do with merge conflicts.

will get back to you after our client meeting tomorrow!

@soramicha soramicha self-requested a review April 28, 2026 00:13
@anvch
Copy link
Copy Markdown
Collaborator

anvch commented Apr 28, 2026

Hi Ida, we discussed and for permissions in order of most restrictive to least restrictive here are the actions that each should be able to do. In my opinion, the yes/no flags are not necessary and permissions should just be role-based.

logged out/viewer – menu calendar and allergen/restrictions/etc. flags
dining site staff – view NOT edit recipes
kitchen/nutrition staff – edit recipes and calendar
admin – can edit permissions

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
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