From ba0c21dbd74c99a35858b9a1ecaf9feb57565333 Mon Sep 17 00:00:00 2001 From: Pranay Date: Fri, 10 Jan 2025 12:55:31 +0530 Subject: [PATCH 1/4] Fix: Theme change and issue in Appraisal --- .../models/apprisal_period_master.py | 3 +- .../static/src/webclient/appsbar/appsbar.scss | 130 +++++++++--------- .../static/src/webclient/appsbar/appsbar.xml | 20 +-- 3 files changed, 75 insertions(+), 78 deletions(-) diff --git a/addons_extensions/hr_employee_appraisal/models/apprisal_period_master.py b/addons_extensions/hr_employee_appraisal/models/apprisal_period_master.py index c943080fb..80f6648c1 100644 --- a/addons_extensions/hr_employee_appraisal/models/apprisal_period_master.py +++ b/addons_extensions/hr_employee_appraisal/models/apprisal_period_master.py @@ -18,7 +18,8 @@ class AppraisalPeriod(models.Model): @api.onchange('date_to') def onchange_activation_date(self): for rec in self: - rec.activation_date = rec.date_to + timedelta(days=1) + if rec.date_to: + rec.activation_date = rec.date_to + timedelta(days=1) _defaults = { 'color_name': 'red', diff --git a/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.scss b/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.scss index 7f4135a24..c726ff246 100644 --- a/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.scss +++ b/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.scss @@ -1,89 +1,85 @@ .mk_apps_sidebar_panel { @include mk-disable-scrollbar(); background-color: $mk-appbar-background; - width: var(--mk-sidebar-width, 0); + width: var(--mk-sidebar-collapsed-width, 40px); /* Collapsed width: Icons only */ overflow-y: auto; + transition: width 300ms ease; /* Smooth transition for width */ + + &:hover { + width: var(--mk-sidebar-expanded-width, 150px); /* Expanded width: Fits names */ + } + .mk_apps_sidebar { height: 100%; display: flex; flex-direction: column; justify-content: space-between; - white-space: nowrap; - .mk_apps_sidebar_menu { - padding: 0; - > li > a { - cursor: pointer; - font-size: 13px; - font-weight: 300; - overflow: hidden; - padding: 8px 11px; - text-decoration: none; - color: $mk-appbar-color; - text-overflow: ellipsis; - .mk_apps_sidebar_icon { - width: 22px; - height: 22px; - margin-right: 5px; - } - } - > li.active > a { + white-space: nowrap; + + .mk_apps_sidebar_menu { + padding: 0; + + > li > a { + cursor: pointer; + font-size: 13px; + font-weight: 300; + overflow: hidden; + padding: 8px 11px; + text-decoration: none; + color: $mk-appbar-color; + text-overflow: ellipsis; + + .mk_apps_sidebar_icon { + width: 22px; + height: 22px; + margin-right: 5px; + } + + .mk_apps_sidebar_name { + opacity: 0; + display: inline-block; /* Name stays inline with the icon */ + margin-left: 5px; /* Spacing between icon and name */ + transition: opacity 300ms ease; + white-space: nowrap; + } + } + > li.active > a { background: $mk-appbar-active; - } - > li:hover > a { + } + > li:hover > a { background: $mk-appbar-active; - } - } - } + } + + > li > a .mk_apps_sidebar_name { + opacity: 1; /* All names visible on hover of the entire sidebar */ + } + } + } } .mk_sidebar_type_large { - --mk-sidebar-width: #{$mk-sidebar-large-width}; + --mk-sidebar-collapsed-width: 40px; + --mk-sidebar-expanded-width: 150px; /* Adjust this to match the names' width */ } .mk_sidebar_type_small { - --mk-sidebar-width: #{$mk-sidebar-small-width}; - .mk_apps_sidebar_name { - display: none; - } - .mk_apps_sidebar_icon { - margin-right: 0 !important; - } - .mk_apps_sidebar_logo { - display: none; - } + --mk-sidebar-collapsed-width: 50px; + --mk-sidebar-expanded-width: 150px; /* Adjust if needed */ + + .mk_apps_sidebar_name { + display: none; + } + + .mk_apps_sidebar_icon { + margin-right: 0 !important; + } + + .mk_apps_sidebar_logo { + display: none; + } } .mk_sidebar_type_invisible { - --mk-sidebar-width: 0; + --mk-sidebar-collapsed-width: 0; } -.editor_has_snippets_hide_backend_navbar, -.o_home_menu_background, -.o_fullscreen { - --mk-sidebar-width: 0; -} - -.editor_has_snippets_hide_backend_navbar .mk_apps_sidebar_panel { - transition: width 300ms; -} - -@include media-breakpoint-only(md) { - .mk_sidebar_type_large { - --mk-sidebar-width: #{$mk-sidebar-small-width}; - .mk_apps_sidebar_name { - display: none; - } - .mk_apps_sidebar_icon { - margin-right: 0 !important; - } - .mk_apps_sidebar_logo { - display: none; - } - } -} - -@include media-breakpoint-down(md) { - .mk_sidebar_type_large, .mk_sidebar_type_small { - --mk-sidebar-width: 0; - } -} diff --git a/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.xml b/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.xml index 99c3428d2..4dd247344 100644 --- a/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.xml +++ b/third_party_addons/muk_web_appsbar/static/src/webclient/appsbar/appsbar.xml @@ -8,23 +8,23 @@