diff --git a/frontend/app/components/Domain/Household/GroupMealPlanEntryDialog.vue b/frontend/app/components/Domain/Household/GroupMealPlanEntryDialog.vue index a232f9900..0403c0b6e 100644 --- a/frontend/app/components/Domain/Household/GroupMealPlanEntryDialog.vue +++ b/frontend/app/components/Domain/Household/GroupMealPlanEntryDialog.vue @@ -45,14 +45,7 @@ - + ({ required: true }); -const { household } = useHouseholdSelf(); const { rules } = useMealplanRules(); const planTypeOptions = usePlanTypeOptions(); @@ -176,7 +167,6 @@ const text = ref(""); const ignoreRules = ref(false); const isRecipe = computed(() => entryMode.value === "recipe"); -const firstDayOfWeek = computed(() => household.value?.preferences?.firstDayOfWeek || 0); const applicableRuleFilter = computed(() => buildRuleQueryFilter(rules.value, selectedDate.value, entryType.value)); const ruleQueryFilter = computed(() => ignoreRules.value ? null : applicableRuleFilter.value); diff --git a/frontend/app/components/Domain/Mealplan/MealPlanAddRecipeDialog.vue b/frontend/app/components/Domain/Mealplan/MealPlanAddRecipeDialog.vue new file mode 100644 index 000000000..43a098cd7 --- /dev/null +++ b/frontend/app/components/Domain/Mealplan/MealPlanAddRecipeDialog.vue @@ -0,0 +1,75 @@ + + + + + + + + + + diff --git a/frontend/app/components/Domain/Mealplan/MealPlanDatePicker.vue b/frontend/app/components/Domain/Mealplan/MealPlanDatePicker.vue new file mode 100644 index 000000000..362226448 --- /dev/null +++ b/frontend/app/components/Domain/Mealplan/MealPlanDatePicker.vue @@ -0,0 +1,77 @@ + + + + + + + + {{ monthYearText.split(' ')[0] }} + + + {{ yearText }} + + + + + + + + + diff --git a/frontend/app/components/Domain/Recipe/RecipeContextMenu/RecipeContextMenuContent.vue b/frontend/app/components/Domain/Recipe/RecipeContextMenu/RecipeContextMenuContent.vue index 0b948f14b..12c179f03 100644 --- a/frontend/app/components/Domain/Recipe/RecipeContextMenu/RecipeContextMenuContent.vue +++ b/frontend/app/components/Domain/Recipe/RecipeContextMenu/RecipeContextMenuContent.vue @@ -37,35 +37,7 @@ /> - - - - - - + ([]); -const newMealdate = ref(new Date()); -const newMealType = ref("dinner"); - -const newMealdateString = computed(() => { - // Format the date to YYYY-MM-DD in the same timezone as newMealdate - const year = newMealdate.value.getFullYear(); - const month = String(newMealdate.value.getMonth() + 1).padStart(2, "0"); - const day = String(newMealdate.value.getDate()).padStart(2, "0"); - return `${year}-${month}-${day}`; -}); const i18n = useI18n(); const auth = useMealieAuth(); const { $globals } = useNuxtApp(); -const { household } = useHouseholdSelf(); const { group, actions: groupActions } = useGroupSelf(); const { isOwnGroup } = useLoggedInState(); const route = useRoute(); const groupSlug = computed(() => route.params.groupSlug as string || auth.user.value?.groupSlug || ""); -const firstDayOfWeek = computed(() => { - return household.value?.preferences?.firstDayOfWeek || 0; -}); - const { share, isSupported: shareIsSupported } = useShare(); const { copy, copied, isSupported: clipboardIsSupported } = useClipboard(); @@ -423,28 +377,6 @@ async function handleDownloadEvent() { download(api.recipes.share.getZipRedirectUrl(shareToken.id), `${props.slug}.zip`); } -async function addRecipeToPlan() { - const { response } = await api.mealplans.createOne({ - date: newMealdateString.value, - entryType: newMealType.value, - title: "", - text: "", - recipeId: props.recipeId, - }); - - if (response?.status === 201) { - alert.success(i18n.t("recipe.recipe-added-to-mealplan"), null, { - action: { - message: i18n.t("general.view"), - onClick: () => router.push("/household/mealplan/planner/view"), - }, - }); - } - else { - alert.error(i18n.t("recipe.failed-to-add-recipe-to-mealplan")); - } -} - async function duplicateRecipe() { const { data } = await api.recipes.duplicateOne(props.slug, recipeName.value); if (data && data.slug) { @@ -515,6 +447,5 @@ function contextMenuEventHandler(eventKey: string) { loading.value = false; } -const planTypeOptions = usePlanTypeOptions(); const recipeActions = groupRecipeActionsStore.recipeActions; diff --git a/frontend/app/pages/household/mealplan/planner.vue b/frontend/app/pages/household/mealplan/planner.vue index f7fe025a0..51d47a6dd 100644 --- a/frontend/app/pages/household/mealplan/planner.vue +++ b/frontend/app/pages/household/mealplan/planner.vue @@ -29,7 +29,7 @@ -