From 051981c1ecba436a2bbc80f9a14bec56c0aa84e4 Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Thu, 3 Oct 2024 13:01:37 -0700 Subject: [PATCH] fix: #1540 add dashes to null name (#1616) --- .../src/components/UserSummaryCard/index.vue | 3 +- frontend/src/utils/UserUtils.ts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/UserSummaryCard/index.vue b/frontend/src/components/UserSummaryCard/index.vue index 813c9df0e..0b5e91133 100644 --- a/frontend/src/components/UserSummaryCard/index.vue +++ b/frontend/src/components/UserSummaryCard/index.vue @@ -5,6 +5,7 @@ import Card from 'primevue/card'; import { AppActlApiService } from '@/services/ApiServiceFactory'; import { DEFAULT_COL_SIZE } from '@/components/UserSummaryCard/constants'; import CardTextCol from '@/components/CardTextCol/index.vue'; +import { formatFullName } from '@/utils/UserUtils'; const props = defineProps<{ userId: string; // Fam User ID @@ -41,7 +42,7 @@ const userQuery = useQuery( :description="userQuery.data.value?.user_name" :is-loading="userQuery.isFetching.value" /> { + if (!firstName && !lastName) { + return PLACE_HOLDER; + } + + if (!firstName) { + return lastName!; + } + + if (!lastName) { + return firstName!; + } + + return `${firstName} ${lastName}`; +}