From 130813ffe402b0bde00ea1f02abd4243b5d3acc5 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Sat, 9 Mar 2024 12:29:41 -0600 Subject: [PATCH] fix: Make Meal Planner Notes Not Clickable (#3274) * selectively remove recipe card components when there is no recipe * copied changes to regular card --- .../components/Domain/Recipe/RecipeCard.vue | 17 +++++++++-------- .../Domain/Recipe/RecipeCardMobile.vue | 19 +++++++++++-------- .../Domain/Recipe/RecipeDialogSearch.vue | 1 - .../pages/group/mealplan/planner/view.vue | 1 - 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeCard.vue b/frontend/components/Domain/Recipe/RecipeCard.vue index 4499cdb989c..db96996f12f 100644 --- a/frontend/components/Domain/Recipe/RecipeCard.vue +++ b/frontend/components/Domain/Recipe/RecipeCard.vue @@ -3,8 +3,9 @@ @@ -33,7 +34,7 @@ - + @@ -101,10 +102,6 @@ export default defineComponent({ required: false, default: "abc123", }, - route: { - type: Boolean, - default: true, - }, tags: { type: Array, default: () => [], @@ -123,14 +120,18 @@ export default defineComponent({ const { isOwnGroup } = useLoggedInState(); const route = useRoute(); - const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "") + const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || ""); + const showRecipeContent = computed(() => props.recipeId && props.slug); const recipeRoute = computed(() => { - return `/g/${groupSlug.value}/r/${props.slug}`; + return showRecipeContent.value ? `/g/${groupSlug.value}/r/${props.slug}` : ""; }); + const cursor = computed(() => showRecipeContent.value ? "pointer" : "auto"); return { isOwnGroup, recipeRoute, + showRecipeContent, + cursor, }; }, }); diff --git a/frontend/components/Domain/Recipe/RecipeCardMobile.vue b/frontend/components/Domain/Recipe/RecipeCardMobile.vue index 8f46d2f6b47..57c22b3f606 100644 --- a/frontend/components/Domain/Recipe/RecipeCardMobile.vue +++ b/frontend/components/Domain/Recipe/RecipeCardMobile.vue @@ -3,6 +3,7 @@
- + route.value.params.groupSlug || $auth.user?.groupSlug || "") + const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || ""); + const showRecipeContent = computed(() => props.recipeId && props.slug); const recipeRoute = computed(() => { - return `/g/${groupSlug.value}/r/${props.slug}`; + return showRecipeContent.value ? `/g/${groupSlug.value}/r/${props.slug}` : ""; }); + const cursor = computed(() => showRecipeContent.value ? "pointer" : "auto"); + return { isOwnGroup, recipeRoute, + showRecipeContent, + cursor, }; }, }); diff --git a/frontend/components/Domain/Recipe/RecipeDialogSearch.vue b/frontend/components/Domain/Recipe/RecipeDialogSearch.vue index 4d93b0ba1e5..87c3f468dd5 100644 --- a/frontend/components/Domain/Recipe/RecipeDialogSearch.vue +++ b/frontend/components/Domain/Recipe/RecipeDialogSearch.vue @@ -45,7 +45,6 @@ :rating="recipe.rating" :image="recipe.image" :recipe-id="recipe.id" - :route="true" v-on="$listeners.selected ? { selected: () => handleSelect(recipe) } : {}" /> diff --git a/frontend/pages/group/mealplan/planner/view.vue b/frontend/pages/group/mealplan/planner/view.vue index d982d160839..baa916e29a6 100644 --- a/frontend/pages/group/mealplan/planner/view.vue +++ b/frontend/pages/group/mealplan/planner/view.vue @@ -38,7 +38,6 @@ :key="mealplan.id" :recipe-id="mealplan.recipe ? mealplan.recipe.id : ''" class="mb-2" - :route="mealplan.recipe ? true : false" :rating="mealplan.recipe ? mealplan.recipe.rating : 0" :slug="mealplan.recipe ? mealplan.recipe.slug : mealplan.title" :description="mealplan.recipe ? mealplan.recipe.description : mealplan.text"