Merge pull request #5921 from expsa/14.0-feat-system_dashboard_classic-auto-20251231_222119

[IMP] system_dashboard_classic:
This commit is contained in:
Mohamed Eltayar 2025-12-31 22:21:46 +03:00 committed by GitHub
commit b1f5b13afe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 17 deletions

View File

@ -359,7 +359,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
['holiday_status_id.limit', '=', false],
['state', '!=', 'refuse']
],
target: 'main',
target: 'current',
flags:{
reload: true,
}
@ -386,7 +386,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
domain: [
['user_id', '=', result['user'][0]]
],
target: 'main',
target: 'current',
flags:{
reload: true,
}
@ -411,7 +411,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
'search_default_employee_id': [result['employee'][0][0].id],
'default_employee_id': result['employee'][0][0].id,
},
target: 'main',
target: 'current',
flags:{
reload: true,
}
@ -490,11 +490,11 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
[form_view, 'form']
],
domain: domain,
target: 'main',
target: 'current',
flags:{
reload: true,
}
}, { on_reverse_breadcrumb: function() { return self.reload(); } });
}, { on_reverse_breadcrumb: function() { return self.reload({active_tab: 'self_service'}); } });
});
// triggering click event at the (Create New) button
@ -537,7 +537,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
flags:{
reload: true,
}
}, { on_reverse_breadcrumb: self.on_reverse_breadcrumb })
}, { on_reverse_breadcrumb: function() { return self.reload({active_tab: 'self_service'}); } })
});
// ============================================================
@ -1101,7 +1101,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
<div class="timer-label">${isRtl ? 'متبقي' : 'remaining'}</div>
</div>
</div>
<div class="timer-progress-bar">
<div class="timer-progress-bg">
<div class="timer-progress-fill" style="width: ${data.progress}%"></div>
</div>
<div class="timer-elapsed">${isRtl ? 'منقضي' : 'Elapsed'}: ${data.elapsed}</div>
@ -1165,7 +1165,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
<span class="timer-icon"><i class="fa fa-check-circle"></i></span>
<div class="timer-content">
<div class="timer-value">${data.hours_worked_formatted}</div>
<div class="timer-label">${isRtl ? 'إجمالي ساعات العمل' : 'Total Hours'}</div>
<div class="timer-label">${isRtl ? 'ساعات العمل' : 'Total Hours'}</div>
</div>
</div>
@ -1173,7 +1173,7 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
<div class="timer-progress-fill ${isOvertime ? 'overtime' : ''}" style="width: ${progress}%"></div>
</div>
<div class="timer-footer" style="display: flex; justify-content: space-between; padding: 0 15px; font-size: 11px; color: #64748b; margin-top: 5px;">
<div class="timer-footer" style="justify-content: space-between; padding: 0 15px; font-size: 11px; color: #64748b; margin-top: 5px;">
<span>${isRtl ? 'متبقي' : 'Remaining'}: ${remainingText}</span>
<span style="display: none">${isRtl ? 'مخطط' : 'Planned'}: ${format(plannedSeconds)}</span>
</div>
@ -1346,10 +1346,22 @@ odoo.define('system_dashboard_classic.dashboard_self_services', function(require
$('.attendance-img-section').removeClass('attendance-success-pulse');
}, 800);
setTimeout(function() { $notification.addClass('show'); }, 50);
setTimeout(function() {
// Auto-close after 4 seconds
var autoCloseTimer = setTimeout(function() {
$notification.removeClass('show');
setTimeout(function() { $notification.remove(); }, 400);
}, 5500);
}, 4000);
// Click anywhere outside the notification to close it
$notification.on('click', function(e) {
// If clicked on the overlay (not the notification itself)
if ($(e.target).hasClass('attendance-notification-overlay')) {
clearTimeout(autoCloseTimer);
$notification.removeClass('show');
setTimeout(function() { $notification.remove(); }, 400);
}
});
// ===== REFRESH WORK TIMER AFTER CHECK-IN/OUT =====
// console.log('[WorkTimer] Attendance changed - will refresh widget...');

View File

@ -95,7 +95,7 @@ $border-color_1: #2eac96;
text-align: center;
padding: 0;
p {
margin-bottom: 10px;
margin-bottom: 3px;
}
h3 {
margin-top: 0;

View File

@ -1605,7 +1605,7 @@ p.fn-section.clickable-profile:hover {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
padding: 15px !important;
// padding: 15px !important;
margin: 0 5px !important;
border-radius: 12px !important;
gap: 12px !important;
@ -2554,7 +2554,7 @@ p.fn-section.clickable-profile:hover {
border-radius: 6px !important;
height: 12px !important; /* Thicker for visibility */
overflow: hidden !important;
margin: 12px 15px !important;
margin: 5px 8px !important;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
position: relative !important;
border: 1px solid rgba(0,0,0,0.05) !important;
@ -2563,11 +2563,11 @@ p.fn-section.clickable-profile:hover {
.timer-progress-fill {
height: 100% !important;
border-radius: 6px !important;
/* Solid Teal/Cyan - Clear and Professional */
background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%) !important;
/* Uses the Warning color from module settings */
background: var(--dash-warning, #f59e0b) !important;
box-shadow:
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 2px 6px rgba(8, 145, 178, 0.4) !important;
0 2px 6px rgba(0, 0, 0, 0.15) !important;
transition: width 1s ease-out !important;
position: relative !important;
min-width: 2px !important; /* Always show a bit */