From be0b1678f43b19d4f756c6ff3ce198f1858c1339 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:21:13 +0530 Subject: [PATCH 01/55] feat: add setting to enable employee checkin for mobile app (backport #1569) (#1651) * feat: add setting to enable employee checkin for mobile app (#1569) * feat: add setting to disable employee checkin for mobile app * fix: edit description and invert the setting * fix: change "Checkin Setting" section title to Mobile App Setting * fix: remove the disabled checkin message * refactor: change namings and formatting * refactor: remove console log * chore: section break name * refactor: HR setting for employee checkin, function namings and Checkin Panel UI * fix: date format and label styling in Checkin Panel * fix: Mobile App casing in HR settings * fix: disabled checkin fallback text * fix: enable "allow checkin" setting on migration * fix(patch): ignore permissions & mandatory to avoid breakage --------- Co-authored-by: Rucha Mahabal (cherry picked from commit 06995c1e85328551a796c0b71bce9fdb503589a7) # Conflicts: # hrms/hr/doctype/hr_settings/hr_settings.json * chore: fix conflicts --------- Co-authored-by: Viny Selopal <52369157+vinyselopal@users.noreply.github.com> Co-authored-by: Rucha Mahabal --- frontend/src/components/CheckInPanel.vue | 45 +++++++++++-------- frontend/src/data/settings.js | 6 +++ hrms/api/__init__.py | 6 +++ hrms/hr/doctype/hr_settings/hr_settings.json | 17 ++++++- hrms/patches.txt | 3 +- .../v15_0/enable_allow_checkin_setting.py | 9 ++++ 6 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 frontend/src/data/settings.js create mode 100644 hrms/patches/v15_0/enable_allow_checkin_setting.py diff --git a/frontend/src/components/CheckInPanel.vue b/frontend/src/components/CheckInPanel.vue index c9f78a673a..02a7ad7214 100644 --- a/frontend/src/components/CheckInPanel.vue +++ b/frontend/src/components/CheckInPanel.vue @@ -3,26 +3,32 @@

Hey, {{ employee?.data?.first_name }} 👋

-
- Last {{ lastLogType }} was at {{ lastLogTime }} + + +
+ {{ dayjs().format("ddd, D MMMM, YYYY") }}
-
list[str]: return [ transition.state for transition in workflow.transitions if transition.allowed in user_roles ] + + +@frappe.whitelist() +def is_employee_checkin_allowed(): + return cint(frappe.db.get_single_value("HR Settings", "allow_employee_checkin_from_mobile_app")) diff --git a/hrms/hr/doctype/hr_settings/hr_settings.json b/hrms/hr/doctype/hr_settings/hr_settings.json index 2955bc14e6..c68b84db7a 100644 --- a/hrms/hr/doctype/hr_settings/hr_settings.json +++ b/hrms/hr/doctype/hr_settings/hr_settings.json @@ -46,7 +46,9 @@ "employee_exit_section", "exit_questionnaire_web_form", "column_break_34", - "exit_questionnaire_notification_template" + "exit_questionnaire_notification_template", + "mobile_settings_section", + "allow_employee_checkin_from_mobile_app" ], "fields": [ { @@ -296,13 +298,24 @@ "fieldname": "shift_settings_section", "fieldtype": "Section Break", "label": "Shift Settings" + }, + { + "default": "1", + "fieldname": "allow_employee_checkin_from_mobile_app", + "fieldtype": "Check", + "label": "Allow Employee Checkin from Mobile App" + }, + { + "fieldname": "mobile_settings_section", + "fieldtype": "Section Break", + "label": "Mobile Settings" } ], "icon": "fa fa-cog", "idx": 1, "issingle": 1, "links": [], - "modified": "2023-12-28 23:07:36.317223", + "modified": "2024-04-10 14:25:29.958973", "modified_by": "Administrator", "module": "HR", "name": "HR Settings", diff --git a/hrms/patches.txt b/hrms/patches.txt index f387f4cfc0..27b3e5a0ac 100644 --- a/hrms/patches.txt +++ b/hrms/patches.txt @@ -20,4 +20,5 @@ hrms.patches.v14_0.update_loan_repayment_repay_from_salary hrms.patches.v15_0.migrate_loan_type_to_loan_product hrms.patches.v15_0.rename_and_update_leave_encashment_fields hrms.patches.v14_0.update_title_in_employee_onboarding_and_separation_templates -hrms.patches.v15_0.make_hr_settings_tab_in_company_master \ No newline at end of file +hrms.patches.v15_0.make_hr_settings_tab_in_company_master +hrms.patches.v15_0.enable_allow_checkin_setting \ No newline at end of file diff --git a/hrms/patches/v15_0/enable_allow_checkin_setting.py b/hrms/patches/v15_0/enable_allow_checkin_setting.py new file mode 100644 index 0000000000..c648e24b8a --- /dev/null +++ b/hrms/patches/v15_0/enable_allow_checkin_setting.py @@ -0,0 +1,9 @@ +import frappe + + +def execute(): + settings = frappe.get_single("HR Settings") + settings.allow_employee_checkin_from_mobile_app = 1 + settings.flags.ignore_mandatory = True + settings.flags.ignore_permissions = True + settings.save() From c1d0f1b1e782abdb679bf12b7402738d70558c43 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 11 Apr 2024 17:16:31 +0530 Subject: [PATCH 02/55] style: fix date alignment on webkit based browsers (cherry picked from commit f22353e19393759a7d14d81a88b30d685958847d) --- frontend/src/main.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/main.css b/frontend/src/main.css index 0fd4c4a269..6291e866d0 100644 --- a/frontend/src/main.css +++ b/frontend/src/main.css @@ -11,12 +11,15 @@ input:disabled { color: var(--tw-text-color); } -/* For Webkit-based browsers */ +/* For Webkit-based browsers (Chrome, Safari and Opera) */ +input::-webkit-date-and-time-value { + text-align: left; +} + body { -webkit-tap-highlight-color: transparent; } -/* For Webkit-based browsers (Chrome, Safari and Opera) */ .hide-scrollbar::-webkit-scrollbar { display: none; } @@ -25,4 +28,4 @@ body { .hide-scrollbar { -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ -} +} \ No newline at end of file From 3bb02ce436b031aa5be62d6b7e19091ae4ed72fe Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 11 Apr 2024 19:27:02 +0530 Subject: [PATCH 03/55] fix: formview header, layout and scroll (cherry picked from commit 8f843d93a83d4a4af6c494b6c63115fcaf3d5d6f) --- frontend/src/components/FormView.vue | 137 +++++++++++++-------------- frontend/src/main.css | 2 +- 2 files changed, 68 insertions(+), 71 deletions(-) diff --git a/frontend/src/components/FormView.vue b/frontend/src/components/FormView.vue index 50d78a0299..8afd516b16 100644 --- a/frontend/src/components/FormView.vue +++ b/frontend/src/components/FormView.vue @@ -1,10 +1,8 @@