-
Notifications
You must be signed in to change notification settings - Fork 0
Enable editing for complex recipes #696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
refactor(GroupHeaderActions-ui): make PasteButton disabled prop optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enable editing of complex recipes by removing UI restrictions, updating error handling for recipe fetching, and adding domain tests.
- Remove conditional blocks that prevented editing or pasting into complex recipes
- Update
PasteButtonsignature to accept an optionaldisabledprop - Add tests for
addItemToRecipeandaddItemsToRecipeon recipes withprepared_multiplier !== 1 - Enhance
useRecipeResourceto callhandleApiErroron fetch failures
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/sections/item-group/components/ItemGroupEditModalBody.tsx | Removed UI guard blocking edits on complex recipes |
| src/sections/item-group/components/GroupHeaderActions.tsx | Dropped complexity checks and updated PasteButton props |
| src/modules/diet/recipe/domain/recipeOperations.test.ts | Added tests for adding items to complex recipes |
| src/modules/diet/item-group/application/useRecipeResource.ts | Added handleApiError in catch block when fetching recipes |
Comments suppressed due to low confidence (1)
src/modules/diet/item-group/application/useRecipeResource.ts:17
- Add a unit test to cover the error path in
useRecipeResource, asserting that whenfetchRecipeByIdrejects,handleApiErroris called and the resource resolves tonull.
} catch (error) {
Remove UI restrictions preventing the editing of complex recipes and ensure that editing functions work correctly for these cases. Update error handling for recipe fetching and add tests to verify functionality.
Closes #616