render overtime anytime needed
This commit is contained in:
parent
81853c4367
commit
eeab3b1fcf
|
|
@ -402,6 +402,15 @@ class _CheckInTabState extends ConsumerState<_CheckInTab> {
|
||||||
.where((l) => (l.justification ?? '').trim().isNotEmpty)
|
.where((l) => (l.justification ?? '').trim().isNotEmpty)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
// Roles allowed to render overtime anytime
|
||||||
|
final allowedOvertimeRoles = {
|
||||||
|
'admin',
|
||||||
|
'programmer',
|
||||||
|
'dispatcher',
|
||||||
|
'it_staff',
|
||||||
|
};
|
||||||
|
final canRenderOvertime = allowedOvertimeRoles.contains(profile.role);
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -649,9 +658,9 @@ class _CheckInTabState extends ConsumerState<_CheckInTab> {
|
||||||
|
|
||||||
if (activeOvertimeLog.isNotEmpty || _overtimeLogId != null)
|
if (activeOvertimeLog.isNotEmpty || _overtimeLogId != null)
|
||||||
_buildActiveOvertimeCard(context, theme, colors, activeOvertimeLog)
|
_buildActiveOvertimeCard(context, theme, colors, activeOvertimeLog)
|
||||||
else if (todaySchedule.isEmpty &&
|
else if (_overtimeLogId == null &&
|
||||||
activeLog.isEmpty &&
|
(canRenderOvertime ||
|
||||||
_overtimeLogId == null)
|
(todaySchedule.isEmpty && activeLog.isEmpty)))
|
||||||
_buildOvertimeCard(context, theme, colors)
|
_buildOvertimeCard(context, theme, colors)
|
||||||
else if (todaySchedule.isEmpty &&
|
else if (todaySchedule.isEmpty &&
|
||||||
(activeLog.isNotEmpty || _overtimeLogId != null))
|
(activeLog.isNotEmpty || _overtimeLogId != null))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user