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: Added support for plural_name for foods #4129

Closed
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
0061af8
Added support for plural_name for foods
Choromanski Aug 31, 2024
ef9955d
Fixed some issues, and added plurals for all items that might be the …
Choromanski Aug 31, 2024
e9c0637
Sorted the foods
Choromanski Aug 31, 2024
4358b7a
Removed UK language should be in en-UK, ignored Scallions, green onio…
Choromanski Aug 31, 2024
aba0440
Removed spacing for CI
Choromanski Aug 31, 2024
544634f
Updated test_seed_foods to reflect the new number of foods in the see…
Choromanski Aug 31, 2024
592cdec
Fixed comments in test_group_seeder.py
Choromanski Aug 31, 2024
2198172
Removed exta potato that I missed
Choromanski Aug 31, 2024
996e9b1
fix: PWA respects orientation lock (#4143)
Choromanski Sep 3, 2024
c0fe1cd
fix(deps): update dependency sqlalchemy to v2.0.33 (#4149)
renovate[bot] Sep 3, 2024
66b31f9
feat: Automate release drafting (#4147)
boc-the-git Sep 3, 2024
2e8922a
chore(l10n): New Crowdin updates (#4145)
hay-kot Sep 4, 2024
4648e3d
chore: Set 'chore' label on PR (#4154)
boc-the-git Sep 4, 2024
afa41ec
chore: Set "documentation" label on PR (#4153)
boc-the-git Sep 4, 2024
dc8fe5e
fix(deps): update dependency fastapi to v0.112.3 (#4159)
renovate[bot] Sep 5, 2024
92398c3
chore(deps): update dependency ruff to v0.6.4 (#4160)
renovate[bot] Sep 5, 2024
10c6c70
fix(deps): update dependency fastapi to ^0.113.0 (#4161)
renovate[bot] Sep 5, 2024
d1ead75
fix(deps): update dependency pydantic to v2.9.0 (#4162)
renovate[bot] Sep 5, 2024
1423b63
fix(deps): update dependency openai to v1.43.1 (#4164)
renovate[bot] Sep 5, 2024
0a68661
docs: OpenAI Documentation (#4165)
michael-genson Sep 6, 2024
ef488be
fix(deps): update dependency sqlalchemy to v2.0.34 (#4156)
renovate[bot] Sep 6, 2024
200706d
docs: Added OpenAI Page to mkdocs (#4167)
michael-genson Sep 6, 2024
777e9e7
docs: add keep screen alive entry (#4116)
paaff Sep 6, 2024
63709a3
docs: Fix OpenAI docs link (#4168)
michael-genson Sep 7, 2024
e8cec9a
feat: Added feature to limit mealplan data by date range (#4111)
vshulcz Sep 7, 2024
b8aa92c
fix(deps): update dependency fastapi to ^0.114.0 (#4169)
renovate[bot] Sep 7, 2024
ad31b09
fix(deps): update dependency openai to v1.44.0 (#4170)
renovate[bot] Sep 7, 2024
a0773a5
chore(l10n): New Crowdin updates (#4171)
hay-kot Sep 7, 2024
9890135
chore(l10n): New Crowdin updates (#4176)
hay-kot Sep 8, 2024
8eb1cc6
fix(deps): update dependency pydantic to v2.9.1 (#4180)
renovate[bot] Sep 9, 2024
042e91c
chore(auto): Update pre-commit hooks (#4179)
github-actions[bot] Sep 9, 2024
b23cd34
chore(l10n): New Crowdin updates (#4181)
hay-kot Sep 9, 2024
7b64664
fix(deps): update dependency openai to v1.44.1 (#4185)
renovate[bot] Sep 9, 2024
0f35803
feat: Add autolabeler functionality for PRs (#4188)
boc-the-git Sep 10, 2024
07ccaf0
chore(deps): update dependency pytest to v8.3.3 (#4189)
renovate[bot] Sep 10, 2024
6d5c852
chore(deps): update dependency rich to v13.8.1 (#4190)
renovate[bot] Sep 10, 2024
1cbfdbe
fix(deps): update dependency pydantic-settings to v2.5.0 (#4191)
renovate[bot] Sep 10, 2024
4ee292a
fix(deps): update dependency fastapi to v0.114.1 (#4194)
renovate[bot] Sep 11, 2024
4400be1
fix(deps): update dependency pydantic-settings to v2.5.2 (#4195)
renovate[bot] Sep 11, 2024
3480d11
feat: Change autolabeler regex to include : (#4196)
boc-the-git Sep 11, 2024
a4869ca
docs: boolean value in docker-compose examples not deserializable in …
ursuscamp Sep 11, 2024
b15d68b
fix: Tweak recipe card height to be consistent (#4150)
michael-genson Sep 11, 2024
924bac3
Updated the other language files
Choromanski Sep 12, 2024
39043fd
Removed all extra spaces, and fixed the name being plural
Choromanski Sep 12, 2024
11f845b
Fixed file encoding
Choromanski Sep 14, 2024
2f77a5e
fix: Broken Social Preview Links (#4183)
michael-genson Sep 12, 2024
87ffa6e
chore(deps): update dependency pydantic-to-typescript2 to v1.0.6 (#4199)
renovate[bot] Sep 12, 2024
25ab093
feat: Reorder ShoppingListItemEditor (#4200)
Kuchenpirat Sep 12, 2024
87ebec2
chore(l10n): New Crowdin updates (#4201)
hay-kot Sep 12, 2024
9dd2f15
fix(deps): update dependency openai to v1.45.0 (#4203)
renovate[bot] Sep 14, 2024
7a25532
chore(deps): update dependency ruff to v0.6.5 (#4205)
renovate[bot] Sep 14, 2024
22d88ad
fix(deps): update dependency fastapi to v0.114.2 (#4206)
renovate[bot] Sep 14, 2024
6f62b50
feat: Use Backend for Recipe Post Actions (#4163)
michael-genson Sep 14, 2024
c9f44d3
fix(deps): Update dependencies for Python 3.12 (#4204)
chishm Sep 15, 2024
3a07984
feat: Allow Cookbooks To Share Names (#4186)
michael-genson Sep 15, 2024
a36abf0
chore(auto): Update pre-commit hooks (#4213)
github-actions[bot] Sep 16, 2024
ef77e88
chore: Improve Alembic Migration Generation (#4192)
michael-genson Sep 16, 2024
a46fff1
fix(deps): update dependency sqlalchemy to v2.0.35 (#4221)
renovate[bot] Sep 16, 2024
2b4c258
fix(deps): update dependency openai to v1.45.1 (#4215)
renovate[bot] Sep 17, 2024
ffb3079
feat: Additional Household Permissions (#4158)
michael-genson Sep 17, 2024
f745242
fix(deps): update dependency fastapi to ^0.115.0 (#4228)
renovate[bot] Sep 18, 2024
0df7d18
fix(deps): update dependency openai to v1.46.0 (#4226)
renovate[bot] Sep 18, 2024
8dc139f
fix(deps): update dependency pydantic to v2.9.2 (#4225)
renovate[bot] Sep 18, 2024
2d7c6d5
chore(l10n): New Crowdin updates (#4230)
hay-kot Sep 18, 2024
f833e18
chore(deps): update dependency mkdocs-material to v9.5.35 (#4229)
renovate[bot] Sep 18, 2024
8e41aa3
chore(l10n): New Crowdin updates (#4233)
hay-kot Sep 19, 2024
0675627
fix(deps): update dependency openai to v1.46.1 (#4234)
renovate[bot] Sep 19, 2024
779b467
feat: Shopping list UI overhaul - increase list item width (#4237)
Wetzel402 Sep 19, 2024
a49791b
feat: Shopping list UI overhaul - label sorted by default (#4238)
Wetzel402 Sep 19, 2024
402a46c
chore: Optimize Loads on Queries (#4220)
michael-genson Sep 20, 2024
d0ea192
chore(deps): update dependency ruff to v0.6.6 (#4240)
renovate[bot] Sep 20, 2024
10a259a
fix: revert shopping list items - increased width (#4241)
Kuchenpirat Sep 20, 2024
9fb638c
chore(deps): update dependency pylint to v3.3.0 (#4243)
renovate[bot] Sep 20, 2024
eadbf6a
chore(deps): update dependency mkdocs-material to v9.5.36 (#4247)
renovate[bot] Sep 21, 2024
e222b41
fix(deps): update dependency openai to v1.47.0 (#4245)
renovate[bot] Sep 21, 2024
6e85d2b
fix: Exclude additional sensitive information from mealie logs (#4218)
bigcat2014 Sep 21, 2024
938c50d
fix(deps): update dependency python-multipart to ^0.0.10 (#4248)
renovate[bot] Sep 22, 2024
1aae037
chore(deps): update dependency ruff to v0.6.7 (#4249)
renovate[bot] Sep 22, 2024
45e51f9
feat: Filter Recipes By Household (and a ton of bug fixes) (#4207)
michael-genson Sep 22, 2024
05b3d6a
feat: OpenAI Custom Headers/Params and Debug Page (#4227)
michael-genson Sep 23, 2024
32d16e7
chore(l10n): New Crowdin updates (#4256)
hay-kot Sep 23, 2024
514fbc6
chore(auto): Update pre-commit hooks (#4255)
github-actions[bot] Sep 23, 2024
8ec1408
fix(deps): update dependency rapidfuzz to v3.10.0 (#4257)
renovate[bot] Sep 23, 2024
222d521
fix(deps): update dependency alembic to v1.13.3 (#4258)
renovate[bot] Sep 23, 2024
4c07092
fix(deps): update dependency openai to v1.47.1 (#4259)
renovate[bot] Sep 23, 2024
44bd649
fix(deps): update dependency tzdata to v2024.2 (#4261)
renovate[bot] Sep 23, 2024
869cabf
chore(l10n): New Crowdin updates (#4264)
hay-kot Sep 24, 2024
49cc627
feat: Shopping list UI overhaul - add label headings per category (#…
Wetzel402 Sep 24, 2024
f625440
chore(deps): update dependency pylint to v3.3.1 (#4265)
renovate[bot] Sep 24, 2024
2f2dff9
feat: sort labels by name,asc in shopping lists (#4253)
seamuslowry Sep 24, 2024
69cbcec
chore(deps): update dependency mkdocs-material to v9.5.37 (#4267)
renovate[bot] Sep 25, 2024
ecb6017
chore(l10n): New Crowdin updates (#4268)
hay-kot Sep 25, 2024
85dc5a8
docs: Update Docs for Households (#4266)
michael-genson Sep 25, 2024
8d0f067
fix(deps): update dependency openai to v1.48.0 (#4269)
renovate[bot] Sep 25, 2024
14f9b7e
chore(deps): update dependency mkdocs-material to v9.5.38 (#4270)
renovate[bot] Sep 26, 2024
0a0e798
chore(l10n): New Crowdin updates (#4271)
hay-kot Sep 26, 2024
6fce4a6
feat: add regex to url before scraping (#4174)
jlssmt Sep 27, 2024
b74ef08
feat: Add Household Filter to Meal Plan Rules (#4231)
michael-genson Sep 27, 2024
79cde72
fix(deps): update dependency openai to v1.50.2 (#4273)
renovate[bot] Sep 28, 2024
a6c49be
chore(deps): update dependency ruff to v0.6.8 (#4272)
renovate[bot] Sep 28, 2024
3318d3b
fix(deps): update dependency uvicorn to ^0.31.0 (#4277)
renovate[bot] Sep 28, 2024
b4acc9f
Resolved merge conflicts
Choromanski Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Add Household Filter to Meal Plan Rules (#4231)
michael-genson authored and Choromanski committed Oct 1, 2024
commit b74ef085178459d5af08af1b9ad417b4d02ad1a4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""add households filter to meal plans

Revision ID: 1fe4bd37ccc8
Revises: be568e39ffdf
Create Date: 2024-09-18 14:52:55.831540

"""

import sqlalchemy as sa

import mealie.db.migration_types
from alembic import op

# revision identifiers, used by Alembic.
revision = "1fe4bd37ccc8"
down_revision: str | None = "be568e39ffdf"
branch_labels: str | tuple[str, ...] | None = None
depends_on: str | tuple[str, ...] | None = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"plan_rules_to_households",
sa.Column("group_plan_rule_id", mealie.db.migration_types.GUID(), nullable=True),
sa.Column("household_id", mealie.db.migration_types.GUID(), nullable=True),
sa.ForeignKeyConstraint(
["group_plan_rule_id"],
["group_meal_plan_rules.id"],
),
sa.ForeignKeyConstraint(
["household_id"],
["households.id"],
),
sa.UniqueConstraint("group_plan_rule_id", "household_id", name="group_plan_rule_id_household_id_key"),
)
with op.batch_alter_table("plan_rules_to_households", schema=None) as batch_op:
batch_op.create_index(
batch_op.f("ix_plan_rules_to_households_group_plan_rule_id"), ["group_plan_rule_id"], unique=False
)
batch_op.create_index(batch_op.f("ix_plan_rules_to_households_household_id"), ["household_id"], unique=False)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("plan_rules_to_households", schema=None) as batch_op:
batch_op.drop_index(batch_op.f("ix_plan_rules_to_households_household_id"))
batch_op.drop_index(batch_op.f("ix_plan_rules_to_households_group_plan_rule_id"))

op.drop_table("plan_rules_to_households")
# ### end Alembic commands ###
91 changes: 91 additions & 0 deletions frontend/components/Domain/Household/GroupHouseholdSelector.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<template>
<v-select
v-model="selected"
:items="households"
:label="label"
:hint="description"
:persistent-hint="!!description"
item-text="name"
:multiple="multiselect"
:prepend-inner-icon="$globals.icons.household"
return-object
>
<template #selection="data">
<v-chip
:key="data.index"
class="ma-1"
:input-value="data.selected"
small
close
label
color="accent"
dark
@click:close="removeByIndex(data.index)"
>
{{ data.item.name || data.item }}
</v-chip>
</template>
</v-select>
</template>

<script lang="ts">
import { computed, defineComponent, onMounted, useContext } from "@nuxtjs/composition-api";
import { useHouseholdStore } from "~/composables/store/use-household-store";

interface HouseholdLike {
id: string;
name: string;
}

export default defineComponent({
props: {
value: {
type: Array as () => HouseholdLike[],
required: true,
},
multiselect: {
type: Boolean,
default: false,
},
description: {
type: String,
default: "",
},
},
setup(props, context) {
const selected = computed({
get: () => props.value,
set: (val) => {
context.emit("input", val);
},
});

onMounted(() => {
if (selected.value === undefined) {
selected.value = [];
}
});

const { i18n } = useContext();
const label = computed(
() => props.multiselect ? i18n.tc("household.households") : i18n.tc("household.household")
);

const { store: households } = useHouseholdStore();
function removeByIndex(index: number) {
if (selected.value === undefined) {
return;
}
const newSelected = selected.value.filter((_, i) => i !== index);
selected.value = [...newSelected];
}

return {
selected,
label,
households,
removeByIndex,
};
},
});
</script>
33 changes: 28 additions & 5 deletions frontend/components/Domain/Household/GroupMealPlanRuleForm.vue
Original file line number Diff line number Diff line change
@@ -5,8 +5,15 @@
<v-select v-model="inputEntryType" :items="MEAL_TYPE_OPTIONS" :label="$t('meal-plan.meal-type')"></v-select>
</div>

<RecipeOrganizerSelector v-model="inputCategories" selector-type="categories" />
<RecipeOrganizerSelector v-model="inputTags" selector-type="tags" />
<div class="mb-5">
<RecipeOrganizerSelector v-model="inputCategories" selector-type="categories" />
<RecipeOrganizerSelector v-model="inputTags" selector-type="tags" />
<GroupHouseholdSelector
v-model="inputHouseholds"
multiselect
:description="$tc('meal-plan.mealplan-households-description')"
/>
</div>

<!-- TODO: proper pluralization of inputDay -->
{{ $t('meal-plan.this-rule-will-apply', {
@@ -18,11 +25,13 @@

<script lang="ts">
import { defineComponent, computed, useContext } from "@nuxtjs/composition-api";
import GroupHouseholdSelector from "~/components/Domain/Household/GroupHouseholdSelector.vue";
import RecipeOrganizerSelector from "~/components/Domain/Recipe/RecipeOrganizerSelector.vue";
import { RecipeTag, RecipeCategory } from "~/lib/api/types/recipe";
import { PlanCategory, PlanHousehold, PlanTag } from "~/lib/api/types/meal-plan";

export default defineComponent({
components: {
GroupHouseholdSelector,
RecipeOrganizerSelector,
},
props: {
@@ -35,11 +44,15 @@ export default defineComponent({
default: "unset",
},
categories: {
type: Array as () => RecipeCategory[],
type: Array as () => PlanCategory[],
default: () => [],
},
tags: {
type: Array as () => RecipeTag[],
type: Array as () => PlanTag[],
default: () => [],
},
households: {
type: Array as () => PlanHousehold[],
default: () => [],
},
showHelp: {
@@ -105,13 +118,23 @@ export default defineComponent({
},
});

const inputHouseholds = computed({
get: () => {
return props.households;
},
set: (val) => {
context.emit("update:households", val);
},
});

return {
MEAL_TYPE_OPTIONS,
MEAL_DAY_OPTIONS,
inputDay,
inputEntryType,
inputCategories,
inputTags,
inputHouseholds,
};
},
});
4 changes: 4 additions & 0 deletions frontend/lang/messages/en-US.json
Original file line number Diff line number Diff line change
@@ -315,6 +315,10 @@
"mealplan-settings": "Mealplan Settings",
"mealplan-update-failed": "Mealplan update failed",
"mealplan-updated": "Mealplan Updated",
"mealplan-households-description": "If no household is selected, recipes can be added from any household",
"any-category": "Any Category",
"any-tag": "Any Tag",
"any-household": "Any Household",
"no-meal-plan-defined-yet": "No meal plan defined yet",
"no-meal-planned-for-today": "No meal planned for today",
"numberOfDays-hint": "Number of days on page load",
27 changes: 20 additions & 7 deletions frontend/lib/api/types/meal-plan.ts
Original file line number Diff line number Diff line change
@@ -31,31 +31,44 @@ export interface ListItem {
quantity?: number;
checked?: boolean;
}
export interface PlanCategory {
id: string;
name: string;
slug: string;
}
export interface PlanHousehold {
id: string;
name: string;
slug: string;
}
export interface PlanRulesCreate {
day?: PlanRulesDay & string;
entryType?: PlanRulesType & string;
categories?: Category[];
tags?: Tag[];
categories?: PlanCategory[];
tags?: PlanTag[];
households?: PlanHousehold[];
}
export interface Tag {
export interface PlanTag {
id: string;
name: string;
slug: string;
}
export interface PlanRulesOut {
day?: PlanRulesDay & string;
entryType?: PlanRulesType & string;
categories?: Category[];
tags?: Tag[];
categories?: PlanCategory[];
tags?: PlanTag[];
households?: PlanHousehold[];
groupId: string;
householdId: string;
id: string;
}
export interface PlanRulesSave {
day?: PlanRulesDay & string;
entryType?: PlanRulesType & string;
categories?: Category[];
tags?: Tag[];
categories?: PlanCategory[];
tags?: PlanTag[];
households?: PlanHousehold[];
groupId: string;
householdId: string;
}
54 changes: 52 additions & 2 deletions frontend/pages/household/mealplan/settings.vue
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
:entry-type.sync="createData.entryType"
:categories.sync="createData.categories"
:tags.sync="createData.tags"
:households.sync="createData.households"
/>
</v-card-text>
<v-card-actions class="justify-end">
@@ -58,12 +59,58 @@
<template v-if="!editState[rule.id]">
<div v-if="rule.categories">
<h4 class="py-1">{{ $t("category.categories") }}:</h4>
<RecipeChips :items="rule.categories" small />
<RecipeChips v-if="rule.categories.length" :items="rule.categories" small class="pb-3" />
<v-card-text
v-else
label
class="ma-0 px-0 pt-0 pb-3"
text-color="accent"
small
dark
>
{{ $tc("meal-plan.any-category") }}
</v-card-text>
</div>

<div v-if="rule.tags">
<h4 class="py-1">{{ $t("tag.tags") }}:</h4>
<RecipeChips :items="rule.tags" url-prefix="tags" small />
<RecipeChips v-if="rule.tags.length" :items="rule.tags" url-prefix="tags" small class="pb-3" />
<v-card-text
v-else
label
class="ma-0 px-0 pt-0 pb-3"
text-color="accent"
small
dark
>
{{ $tc("meal-plan.any-tag") }}
</v-card-text>
</div>
<div v-if="rule.households">
<h4 class="py-1">{{ $t("household.households") }}:</h4>
<div v-if="rule.households.length">
<v-chip
v-for="household in rule.households"
:key="household.id"
label
class="ma-1"
color="accent"
small
dark
>
{{ household.name }}
</v-chip>
</div>
<v-card-text
v-else
label
class="ma-0 px-0 pt-0 pb-3"
text-color="accent"
small
dark
>
{{ $tc("meal-plan.any-household") }}
</v-card-text>
</div>
</template>
<template v-else>
@@ -72,6 +119,7 @@
:entry-type.sync="allRules[idx].entryType"
:categories.sync="allRules[idx].categories"
:tags.sync="allRules[idx].tags"
:households.sync="allRules[idx].households"
/>
<div class="d-flex justify-end">
<BaseButton update @click="updateRule(rule)" />
@@ -138,6 +186,7 @@ export default defineComponent({
day: "unset",
categories: [],
tags: [],
households: [],
});

async function createRule() {
@@ -149,6 +198,7 @@ export default defineComponent({
day: "unset",
categories: [],
tags: [],
households: [],
};
}
}
Loading