Skip to content

feat: Menu editing in POS#131

Merged
JulesGresset merged 5 commits intodevfrom
104-menu-management
Apr 5, 2025
Merged

feat: Menu editing in POS#131
JulesGresset merged 5 commits intodevfrom
104-menu-management

Conversation

@JulesGresset
Copy link
Copy Markdown
Member

@JulesGresset JulesGresset commented Mar 30, 2025

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
Test the full CRUD for the four tabs
⚠️ Known issues : The details option 'food' is disabled because not implemented yet in the back.

Issue ticket number and link

Closes #104

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Documentation has been updated as required
    If a single item in this checklist is not checked, the pull request cannot be accepted

@JulesGresset JulesGresset self-assigned this Mar 30, 2025
@JulesGresset JulesGresset linked an issue Mar 30, 2025 that may be closed by this pull request
3 tasks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) => {

Comment thread src/Components/Manager/MenuManagement/SideViewFood.js
@JulesGresset JulesGresset enabled auto-merge March 31, 2025 00:11
Copy link
Copy Markdown
Contributor

@alecorvec alecorvec left a comment

Choose a reason for hiding this comment

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

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

@JulesGresset
Copy link
Copy Markdown
Member Author

JulesGresset commented Apr 3, 2025

  • An error pops up when trying to go on the page of an already existing food

This issues been fixed in PR #134, dev was not merged with this branch yet with now done.

  • 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.

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.

  • You cannot add ingredients to foods, the modifications aren't saved

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
EDIT : Fix in PR Hello-Kitchen/Back-End#124

@JulesGresset JulesGresset requested a review from alecorvec April 3, 2025 20:23
@JulesGresset JulesGresset merged commit 7416445 into dev Apr 5, 2025
12 checks passed
@JulesGresset JulesGresset deleted the 104-menu-management branch April 5, 2025 03:44
@JulesGresset JulesGresset restored the 104-menu-management branch April 5, 2025 03:44
@JulesGresset JulesGresset deleted the 104-menu-management branch April 5, 2025 03:45
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.

Menu management

4 participants