Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements full CRUD functionality for menu editing in the POS, covering editable tabs for foods, details, ingredients, and categories. Key changes include the addition of new tests for the manager components, new side view components for editing food and detail items, and adjustments to the overall manager view and layout.
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tests/MenuManagement.test.js | Added tests for the new MenuManagement component. |
| src/tests/Components/Manager/SideViewFood.test.js | Added tests for food side view editing functionality. |
| src/tests/Components/Manager/SideViewDetail.test.js | Added tests for detail side view editing functionality. |
| src/tests/Components/Manager/FoodManagement.test.js | Added tests covering data grid interactions and side view toggling in FoodManagement. |
| src/tests/Components/Manager/DetailManagement.test.js | Added tests for the DetailManagement component and its API interactions. |
| src/Pages/Manager/MenuManagement.js | New component providing tab-based navigation for menu CRUD operations. |
| src/Pages/Manager/ManagerView.js | Integrated MenuManagement into the manager view for a cohesive UI. |
| src/Components/Manager/MenuManagement/SideViewFood.js | New side view component for editing/adding food details. |
| src/Components/Manager/MenuManagement/SideViewDetail.js | New side view component for editing/adding detail items. |
| src/Components/Manager/MenuManagement/IngredientManagement.js | New component handling ingredient CRUD operations via a data grid. |
| src/Components/Manager/MenuManagement/FoodManagement.js | New component enabling CRUD for food items with a side view integration. |
| src/Components/Manager/MenuManagement/FoodCategoryManagement.js | New component for managing food categories with inline editing. |
| src/Components/Manager/MenuManagement/DetailManagement.js | New component to manage detail items using a data grid and side view. |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (2)
src/Components/Manager/MenuManagement/SideViewFood.js:37
- To maintain consistency, consider using newFood.id for determining whether to POST or PUT, rather than mixing newFood.id and selectedFood.id.
fetch(`http://${process.env.REACT_APP_BACKEND_URL}:${process.env.REACT_APP_BACKEND_PORT}/api/${localStorage.getItem("restaurantID")}/food/${newFood.id === -1 ? '' : selectedFood.id}`,...
src/Components/Manager/MenuManagement/FoodManagement.js:133
- [nitpick] The function name 'deleteOrder' is ambiguous since it deletes a food item; consider renaming it to 'deleteFood' for improved clarity.
const deleteOrder = (id) => {
alecorvec
left a comment
There was a problem hiding this comment.
The new menu works as intented, but :
- An error pops up when trying to go on the page of an already existing food
- The Ingredients don't show up on the modification page of a newly created food via the menu. The buttons do, but they don't act as intended.
- You cannot add ingredients to foods, the modifications aren't saved
This issues been fixed in PR #134, dev was not merged with this branch yet with now done.
This issue is fixed in the PR #130, in the meantime, for newly created food only, you can use the /loading route to manually refresh the informations stored in cache.
This issue is back-end related, it only appears when we try to only modify the ingredients of a food, but if you try to modify the ingredients and any other field, it should work. Hello-Kitchen/Back-End#123 |
Describe your changes
The menu (foods, details, ingredients, category) can now be edited in the POS.
How to test the feature
Log and go to Gestion>Menu manager>Gestion du menu
⚠️ Known issues : The details option 'food' is disabled because not implemented yet in the back.
Test the full CRUD for the four tabs
Issue ticket number and link
Closes #104
Checklist before requesting a review
If a single item in this checklist is not checked, the pull request cannot be accepted