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 Household Filter to Meal Plan Rules #4231

Conversation

michael-genson
Copy link
Collaborator

@michael-genson michael-genson commented Sep 18, 2024

What type of PR is this?

(REQUIRED)

  • feature

What this PR does / why we need it:

(REQUIRED)

Adds a household filter to meal plan rules. Similar to tags and categories, if no household is selected, then all households are considered. I had to re-write the part of the recipes repo that does the filtering by tag/category (since we need to support household, too) and ended out just removing it and using the normal page_all route, since that already supports tags, categories, households, and random ordering.

New rule form:
image
image
image

I also tweaked how meal plan rules render on the frontend to call out when there are no filters (e.g. "All Tags" when no tags are selected):
image
image

Which issue(s) this PR fixes:

(REQUIRED)

Closes #4081

Testing

Pytest coverage. I was surprised to find we didn't have any existing coverage for meal plan rules other than basic CRUD, so I added tests for other filters too (type, tag, etc.).

@michael-genson michael-genson changed the title Feat/add household filter to mealplan rules feat: Add Household Filter to Meal Plan Rules Sep 18, 2024
@michael-genson michael-genson marked this pull request as ready for review September 22, 2024 18:14
Copy link
Collaborator

@boc-the-git boc-the-git left a comment

Choose a reason for hiding this comment

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

This is an incomplete review.. it'll be at least a few days before I can fully/properly review it.

frontend/lib/api/types/meal-plan.ts Show resolved Hide resolved
Copy link
Collaborator

@boc-the-git boc-the-git left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@michael-genson michael-genson enabled auto-merge (squash) September 27, 2024 13:59
@michael-genson michael-genson merged commit 4712994 into mealie-recipes:mealie-next Sep 27, 2024
11 of 12 checks passed
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
Choromanski pushed a commit to Choromanski/mealie that referenced this pull request Oct 1, 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.

[Task] - Enable Cross-Household Recipes
2 participants