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

feat: Add the ability to flag a food as "on hand", to exclude from shopping list #3777

Merged

Conversation

boc-the-git
Copy link
Collaborator

@boc-the-git boc-the-git commented Jun 23, 2024

What type of PR is this?

  • feature

What this PR does / why we need it:

Adds the ability to mark a food as "on hand" (terminology taken from tools). Then when adding a recipe to a shopping list, on hand foods will be unticked by default. Current behaviour is that every ingredient is ticked by default. The intent is to use this for your staple ingredients that you rarely need to buy, sugar, salt, spices, rice, ...

Don't ask me how this recipe would turn out!! 🙈

foods_marked_as_staples2

Which issue(s) this PR fixes:

None.

Special notes for your reviewer:

I think the change is fairly straight forward. There are a couple files that had a lot of formatting updates applied, so I've put some comments to indicate the small change actually made in there.

Testing

Locally, with SQLite.

@@ -144,12 +146,15 @@ class IngredientFoodModel(SqlAlchemyBase, BaseMixins):
name: Mapped[str | None] = mapped_column(String)
plural_name: Mapped[str | None] = mapped_column(String)
description: Mapped[str | None] = mapped_column(String)
on_hand: Mapped[bool] = mapped_column(Boolean)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only actual functional change in this file

@@ -36,6 +36,7 @@ class UnitFoodBase(MealieModel):
plural_name: str | None = None
description: str = ""
extras: dict | None = {}
on_hand: bool = False
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only actual functional change in this file

@michael-genson
Copy link
Collaborator

LGTM, besides the one comment I had. Once this is ready I'll pull it locally and test it out, but reviewing the dif looks good

@boc-the-git boc-the-git marked this pull request as ready for review June 24, 2024 06:48
Copy link
Collaborator

@michael-genson michael-genson left a comment

Choose a reason for hiding this comment

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

Functionality looks great. A few UI things which I think will make it look more in line with other similar data features

@boc-the-git
Copy link
Collaborator Author

Changes made @michael-genson; good suggestions!

image

image

@michael-genson michael-genson enabled auto-merge (squash) June 28, 2024 15:09
Copy link
Collaborator

@michael-genson michael-genson left a comment

Choose a reason for hiding this comment

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

👍

@michael-genson michael-genson merged commit a062a4b into mealie-recipes:mealie-next Jun 28, 2024
11 checks passed
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.

2 participants