From a61bf596659b5441836664643a1f34afdbccb879 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Wed, 7 Feb 2024 16:18:31 +0200 Subject: [PATCH] Fix: Display telegram, user role and phone number. --- client/src/components/cards/vacationCard.vue | 5 +++-- client/src/views/TeamView.vue | 4 ++-- server/cshr/serializers/users.py | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/components/cards/vacationCard.vue b/client/src/components/cards/vacationCard.vue index 6a4507bc..52c1d85e 100644 --- a/client/src/components/cards/vacationCard.vue +++ b/client/src/components/cards/vacationCard.vue @@ -147,16 +147,17 @@ export default { }) const couldApprove = computed(() => { + if (user.value) { if ( user.value.fullUser.user_type === 'Admin' || user.value.fullUser.user_type === 'Supervisor' - ) { + ) { if (props.vacation.user.id == user.value.fullUser.id) { return true } if ( - props.vacation.user.reporting_to.includes(user.value.fullUser.id) && + props.vacation.user.reporting_to[0].id === props.vacation.user.id && props.vacation.user.location.name === user.value.fullUser.location.name ) { return true diff --git a/client/src/views/TeamView.vue b/client/src/views/TeamView.vue index 877b80d1..cc0b00b9 100644 --- a/client/src/views/TeamView.vue +++ b/client/src/views/TeamView.vue @@ -77,8 +77,8 @@ export default { const headers = [ { title: 'Name', sortable: false, key: 'full_name' }, { title: 'Email', key: 'email' }, - { title: 'Phone', key: 'phone' }, - { title: 'Position', key: 'position' }, + { title: 'Phone', key: 'mobile_number' }, + { title: 'Position', key: 'job_title' }, { title: 'Telegram', key: 'telegram_link' }, { title: 'Department', key: 'team' } ] as any[] diff --git a/server/cshr/serializers/users.py b/server/cshr/serializers/users.py index 58452d92..ba87718c 100644 --- a/server/cshr/serializers/users.py +++ b/server/cshr/serializers/users.py @@ -370,6 +370,7 @@ class Meta: "address", "location", "is_active", + "telegram_link", ] def get_image(self, obj):