From f630bc3c006e82acd7976314ad3d4d43e9bcd2f4 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Wed, 21 Oct 2026 14:22:51 -0500 Subject: [PATCH] feat: Show recipe owner (#8823) --- .../RecipePageParts/RecipePageInfoCard.vue | 19 +++++++++++++++++++ .../app/components/Domain/User/UserAvatar.vue | 7 +++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInfoCard.vue b/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInfoCard.vue index ed222f2dd..71c73bb06 100644 --- a/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInfoCard.vue +++ b/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInfoCard.vue @@ -21,6 +21,18 @@ :recipe-id="recipe.id" :slug="recipe.slug" /> +
+ + {{ owner.fullName }} +
@@ -86,7 +98,10 @@ import RecipeLastMade from "~/components/Domain/Recipe/RecipeLastMade.vue"; import RecipeTimeCard from "~/components/Domain/Recipe/RecipeTimeCard.vue"; import RecipeYield from "~/components/Domain/Recipe/RecipeYield.vue"; import RecipePageInfoCardImage from "~/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInfoCardImage.vue"; +import UserAvatar from "~/components/Domain/User/UserAvatar.vue"; +import { useUserStore } from "~/composables/store/use-user-store"; import type { Recipe } from "~/lib/api/types/recipe"; +import type { UserSummary } from "~/lib/api/types/user"; import type { NoUndefinedField } from "~/lib/api/types/non-generated"; interface Props { @@ -101,6 +116,10 @@ const props = withDefaults(defineProps(), { const { isOwnGroup } = useLoggedInState(); +// group members aren't visible outside the group, so don't fetch them +const users = isOwnGroup.value ? useUserStore().store : ref([]); +const owner = computed(() => users.value.find(u => u.id === props.recipe.userId)); + const hasTime = computed(() => { const { prepTime, totalTime, performTime, prepTimeSeconds, totalTimeSeconds, performTimeSeconds } = props.recipe; return [prepTime, totalTime, performTime, prepTimeSeconds, totalTimeSeconds, performTimeSeconds].some(x => !!x); diff --git a/frontend/app/components/Domain/User/UserAvatar.vue b/frontend/app/components/Domain/User/UserAvatar.vue index 869b590b8..a9d293f58 100644 --- a/frontend/app/components/Domain/User/UserAvatar.vue +++ b/frontend/app/components/Domain/User/UserAvatar.vue @@ -7,7 +7,7 @@