Skip to content
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

Recipe editor update to allow prompting of ingredients #849

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amgarr
Copy link
Contributor

@amgarr amgarr commented Aug 15, 2024

Change in recipe-editor to prompt ingredients for quantity when creating recipe.

Checks if Prompt for quantity when adding items is enabled in Diary settings. If so then also prompts for quantity when creating recipes.

@davidhealey
Copy link
Owner

Is this the same code used for the diary?

@amgarr
Copy link
Contributor Author

amgarr commented Aug 15, 2024

Its very similar to the code in the diary. Just made a changes to keep it in line with Recipe-Editor, i.e. took out things related to category and entry. Also took out the code writing to dbhandler since that is handled by the save function.

@davidhealey
Copy link
Owner

I'm wondering if it would be possible to add a generic function that can be used by both the diary and the recipes, to avoid code duplication.

@EmilJunker
Copy link
Contributor

I'm wondering if it would be possible to add a generic function that can be used by both the diary and the recipes, to avoid code duplication.

Yes, I also think that would be preferable. And ideally, it should be usable for meals too in addition to recipes.

And the setting should then probably be moved from the Diary section into the Foods/Meals/Recipes section because it applies to all of them.

@amgarr
Copy link
Contributor Author

amgarr commented Aug 15, 2024

Happy to take a crack at it but I may be out of my depth. Would it matter where the generic function would be?

@davidhealey
Copy link
Owner

It would probably make most sense to put it in this file - https://github.com/davidhealey/waistline/blob/master/www/activities/foods-meals-recipes/js/foods-meals-recipes.js

Unless @EmilJunker has a better suggestion.

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