From e53434a8f4476829f56c22949df384ec60f01574 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 23 Apr 2024 12:09:56 +0200 Subject: [PATCH] Added user name in the birthday event. --- client/src/components/CalenderComponent.vue | 2 +- client/src/components/UpdateUser.vue | 3 --- client/src/utils/helpers.ts | 2 +- server/cshr/serializers/users.py | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/components/CalenderComponent.vue b/client/src/components/CalenderComponent.vue index 51ab27d2..4507268e 100644 --- a/client/src/components/CalenderComponent.vue +++ b/client/src/components/CalenderComponent.vue @@ -245,7 +245,7 @@ function onClick(arg: any) { (vacation) => vacation.id === Number(arg.event.id.replace('vacation', '')) )[0] openDialog(CalendarEventSelection.Vacation) - } else if (clickedEventTitle === CalendarEventSelection.Birthday) { + } else if (clickedEventTitle.includes(CalendarEventSelection.Birthday)) { selectedEvent.value = birthdays.value.filter( (birthday) => birthday.id === Number(arg.event.id.replace('birthday', '')) )[0] diff --git a/client/src/components/UpdateUser.vue b/client/src/components/UpdateUser.vue index 3e1b6ea2..8cae7731 100644 --- a/client/src/components/UpdateUser.vue +++ b/client/src/components/UpdateUser.vue @@ -252,9 +252,6 @@ export default { const { execute, isLoading } = useAsyncState( async () => { selectedUser.value.user_type = selectedUser.value.user_type === "Team Lead" ? "Supervisor" : selectedUser.value.user_type - // const imageParts = selectedUser.value.image.split("/") as string[] - // const filename = imageParts[imageParts.length -1] - // console.log("selectedUser.value.image", filename) const data = { ...selectedUser.value, image: imageUrl.value ? imageUrl.value : null, diff --git a/client/src/utils/helpers.ts b/client/src/utils/helpers.ts index 5b0de00c..53a45f1d 100644 --- a/client/src/utils/helpers.ts +++ b/client/src/utils/helpers.ts @@ -113,7 +113,7 @@ export function normalizedBirthday(u: Api.User) { return { type: u.type, - title: `Birthday`, + title: `${u.full_name}'s Birthday`, color: '#e0adf0', start: dates.start, end: dates.end, diff --git a/server/cshr/serializers/users.py b/server/cshr/serializers/users.py index 0b099db6..143b54ed 100644 --- a/server/cshr/serializers/users.py +++ b/server/cshr/serializers/users.py @@ -324,6 +324,7 @@ class Meta: fields = [ "id", "full_name", + "first_name", "email", "image", "team",