From 2d18ccd36c9df62158d247c342833b5551f0cffb Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:36:17 +0200 Subject: [PATCH 1/7] Fix: make the social_insurance_number field optional. --- client/src/components/AddUser.vue | 5 +---- client/src/components/UpdateUser.vue | 4 +--- client/src/utils/validators.ts | 12 ++++++------ server/cshr/models/users.py | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/client/src/components/AddUser.vue b/client/src/components/AddUser.vue index 3eca35540..dd3534f6a 100644 --- a/client/src/components/AddUser.vue +++ b/client/src/components/AddUser.vue @@ -14,7 +14,7 @@ + density="comfortable"> + density="comfortable"> (v && v.length >= 3 && v.length <= 50) || 'Address must be between 3 and 50 characters.' ] -export const socialInsuranceRules = [ - (v: string) => typeof v === 'string' || 'Social Number must be a string.', - (v: string) => !!v || 'Social Number is required.', - (v: string) => - (v && v.length >= 3 && v.length <= 50) || 'Social Number must be between 3 and 50 characters.' -] +// export const socialInsuranceRules = [ +// (v: string) => typeof v === 'string' || 'Social Number must be a string.', +// (v: string) => !!v || 'Social Number is required.', +// (v: string) => +// (v && v.length >= 3 && v.length <= 50) || 'Social Number must be between 3 and 50 characters.' +// ] export const telegramRules = [ (v: string) => typeof v === 'string' || 'Telegram must be a string.', (v: string) => !!v || 'Telegram is required.', diff --git a/server/cshr/models/users.py b/server/cshr/models/users.py index 56d5529f6..c8ccdedc8 100644 --- a/server/cshr/models/users.py +++ b/server/cshr/models/users.py @@ -101,7 +101,7 @@ class User(AbstractBaseUser, TimeStamp): skills = models.ManyToManyField(UserSkills, related_name="skills", blank=True) user_type = models.CharField(max_length=20, choices=USER_TYPE.choices) gender = models.CharField(max_length=20, choices=GENDER_TYPE.choices) - social_insurance_number = models.CharField(max_length=45) + social_insurance_number = models.CharField(max_length=45, null=True, blank=True) address = models.CharField(max_length=150) job_title = models.CharField(max_length=150) USERNAME_FIELD = "email" From d2621b751fd9e15c71b6b01bf2dd59afc20ab138 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:38:16 +0200 Subject: [PATCH 2/7] Update: Replaced the Email in the birthday card with the telegram-handle --- client/src/components/cards/birthdayCard.vue | 6 ++++-- server/cshr/serializers/users.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/cards/birthdayCard.vue b/client/src/components/cards/birthdayCard.vue index 8749e464a..c9846ba9d 100644 --- a/client/src/components/cards/birthdayCard.vue +++ b/client/src/components/cards/birthdayCard.vue @@ -34,8 +34,10 @@ {{ birthday.team ? birthday.team : '--' }} - Email : - {{ birthday.email }} + Telegram : + + {{ birthday.telegram_link }} + diff --git a/server/cshr/serializers/users.py b/server/cshr/serializers/users.py index ba87718c5..0b099db65 100644 --- a/server/cshr/serializers/users.py +++ b/server/cshr/serializers/users.py @@ -332,6 +332,7 @@ class Meta: "job_title", "user_certificates", "is_active", + "telegram_link", "location" ] From e43d2f3baf507967b841ebaeb4577a553d864fca Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:39:19 +0200 Subject: [PATCH 3/7] Enhancement: Fix typo in public holiday card --- client/src/components/cards/holidayCard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/cards/holidayCard.vue b/client/src/components/cards/holidayCard.vue index b67a90c43..4681709bf 100644 --- a/client/src/components/cards/holidayCard.vue +++ b/client/src/components/cards/holidayCard.vue @@ -13,7 +13,7 @@

{{ holiday.holiday_date }} is a public holiday in {{ holiday.location.country }}, We hope you and your familys have a peaceful and enjoyable holiday. Please be aware + >, We hope you and your families have a peaceful and enjoyable holiday. Please be aware that our office in {{ holiday.location.country }}, will be closed on this date. Thank you!

From dd2f0d3716911d06f9f9b6d2bfd7abf4fb84f034 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:41:18 +0200 Subject: [PATCH 4/7] Enhancement: The login page description has been updated. --- client/src/views/LoginView.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/views/LoginView.vue b/client/src/views/LoginView.vue index 9d66511c2..a6d3e20a7 100644 --- a/client/src/views/LoginView.vue +++ b/client/src/views/LoginView.vue @@ -10,10 +10,9 @@ - A versatile management system with vacation request submissions and seamless - integration with a global calendar. Users across offices can collectively view - approved Vacations, Birthdates, Events, Meetings, and Holidays, providing a - centralized overview for the entire organization. + Our internal HR system manages all team requests across offices. + For the first version, + will manage vacation requests, Birthdays, events, meetings, and public holidays so anyone in the team can have a collective overview of the entire organization calendar. Powered by CodeScalers Egypt. From d6966ad546bf5b0b77ea8f615296a12a05d6e94f Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:41:54 +0200 Subject: [PATCH 5/7] Fix: An issue in the get_office_by_id helper fixed. --- server/cshr/services/office.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/cshr/services/office.py b/server/cshr/services/office.py index 90781cba5..4096b3c6f 100644 --- a/server/cshr/services/office.py +++ b/server/cshr/services/office.py @@ -8,7 +8,7 @@ def get_office_by_id(id: str) -> Office: - if not id.isdigit(): + if not str(id).isdigit(): return None try: return Office.objects.get(id=int(id)) From 1d0a0aff69f95e50a6c50c4b63ff5c94d1b7bdb6 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:45:06 +0200 Subject: [PATCH 6/7] Update: The vacation balance calculation is now calculated based on the user joining date, not the user created date. --- server/cshr/utils/vacation_balance_helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/cshr/utils/vacation_balance_helper.py b/server/cshr/utils/vacation_balance_helper.py index 30e741998..cf2468738 100644 --- a/server/cshr/utils/vacation_balance_helper.py +++ b/server/cshr/utils/vacation_balance_helper.py @@ -34,7 +34,10 @@ def create_new_balance(self): if self.user is None or self.user.location.id is None: return None - month: int = 12 - self.user.created_at.month + month: int = 12 + if self.user.joining_at.month > 1: + month: int = 12 - self.user.joining_at.month + office_balance = OfficeVacationBalance.objects.get_or_create( year=datetime.datetime.now().year, location=self.user.location )[0] From aa68d72f7c89bb984a90ab0d38f0d46c4c0f681d Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 12 Mar 2024 13:45:34 +0200 Subject: [PATCH 7/7] Fix: make the social_insurance_number field optional. --- .../0005_alter_user_social_insurance_number.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 server/cshr/migrations/0005_alter_user_social_insurance_number.py diff --git a/server/cshr/migrations/0005_alter_user_social_insurance_number.py b/server/cshr/migrations/0005_alter_user_social_insurance_number.py new file mode 100644 index 000000000..cdffb1ceb --- /dev/null +++ b/server/cshr/migrations/0005_alter_user_social_insurance_number.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.9 on 2024-03-12 11:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("cshr", "0004_remove_vacationbalance_actual_balance_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="social_insurance_number", + field=models.CharField(blank=True, max_length=45, null=True), + ), + ]