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: Cross-Household Recipes #4089

Conversation

michael-genson
Copy link
Collaborator

@michael-genson michael-genson commented Aug 23, 2024

What type of PR is this?

(REQUIRED)

  • feature

What this PR does / why we need it:

(REQUIRED)

Partial implementation of #4081. This PR allows users to see recipes from other households. More specifically:

  • When searching, filtering, etc. all recipes are shown, rather than just your households' recipes
  • You can "make" the recipe (i.e. add a timeline event and update the last made date)
  • You can add the recipe to your shopping list
  • You can add the recipe to your meal plan (only when added directly, see below)
  • You can rate the recipe (and your rating is factored into the global "average" rating)
  • You can favorite the recipe (and it will appear on your favorites list)
  • You can comment on the recipe

There are a few restrictions:

  • You cannot edit recipes if they don't belong to your household. There is no way to override this (not even admins can do this, and they are not on the data management page)
  • There's no way to not see all recipes (I plan to address this separately, the API supports this)
  • These recipes are not considered when choosing a random meal plan recipe (I plan to address this separately)
  • These recipes are not included in cookbooks (I don't have plans to change this unless there's community interest)

Which issue(s) this PR fixes:

(REQUIRED)

Partial implementation of #4081

Special notes for your reviewer:

(fill-in or delete this section)

This implementation assumes we're never going to allow users to hide recipes from other household members. Users can hide the entire household from public users. Supporting hiding from other household users would add an immense amount of complexity (e.g. what happens if a recipe on my shopping list suddenly becomes hidden?), so personally I never see that being an option.

Testing

(fill-in or delete this section)

Pytest for backend. Checked around the frontend a bunch and everything works as expected.

@michael-genson michael-genson marked this pull request as ready for review August 23, 2024 21:59
hay-kot
hay-kot previously approved these changes Aug 31, 2024
Copy link
Collaborator

@hay-kot hay-kot left a comment

Choose a reason for hiding this comment

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

LGTM, one small comment on the frontend stuff, but not a blocker. Leave it to you.

@@ -46,6 +47,9 @@ def __init__(self, repos: AllRepositories, user: PrivateUser, household: Househo
if repos.household_id != user.household_id != household.id:
raise Exception("household ids do not match")

self.group_recipes = get_repositories(repos.session, group_id=repos.group_id, household_id=None).recipes
"""Recipes repo without a Household filter"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥

@michael-genson michael-genson enabled auto-merge (squash) September 1, 2024 02:49
@michael-genson michael-genson merged commit 9acf9ec into mealie-recipes:mealie-next Sep 1, 2024
11 checks passed
@michael-genson michael-genson deleted the feat/cross-household-recipes branch September 1, 2024 03:31
boc-the-git pushed a commit to boc-the-git/mealie that referenced this pull request Sep 28, 2024
boc-the-git pushed a commit to boc-the-git/mealie that referenced this pull request Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants