mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
fixed manager detection
This commit is contained in:
@@ -679,7 +679,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
const matchingScheduledShifts = scheduledShifts.filter(scheduled => {
|
||||
const dayOfWeek = getDayOfWeek(scheduled.date);
|
||||
return dayOfWeek === shiftPattern.dayOfWeek &&
|
||||
scheduled.timeSlotId === shiftPattern.timeSlotId;
|
||||
scheduled.timeSlotId === shiftPattern.timeSlotId;
|
||||
});
|
||||
|
||||
console.log(`📅 Shift Pattern: ${shiftPattern.id}`);
|
||||
@@ -932,7 +932,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
|
||||
if (employee.isTrainee) {
|
||||
backgroundColor = '#cda8f0'; // Trainee
|
||||
} else if (employee.roles?.includes('manager')) {
|
||||
} else if (employee.employeeType === 'manager') {
|
||||
backgroundColor = '#CC0000'; // Manager
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
const scheduledShift = scheduledShifts.find(scheduled => {
|
||||
const scheduledDayOfWeek = getDayOfWeek(scheduled.date);
|
||||
return scheduledDayOfWeek === weekday.id &&
|
||||
scheduled.timeSlotId === timeSlot.id;
|
||||
scheduled.timeSlotId === timeSlot.id;
|
||||
});
|
||||
|
||||
if (scheduledShift) {
|
||||
@@ -1001,7 +1001,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
const scheduledShift = scheduledShifts.find(scheduled => {
|
||||
const scheduledDayOfWeek = getDayOfWeek(scheduled.date);
|
||||
return scheduledDayOfWeek === weekday.id &&
|
||||
scheduled.timeSlotId === timeSlot.id;
|
||||
scheduled.timeSlotId === timeSlot.id;
|
||||
});
|
||||
|
||||
if (scheduledShift) {
|
||||
@@ -1054,7 +1054,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}}
|
||||
title={`Shift Validierung: timeSlotId=${shift.timeSlotId}, dayOfWeek=${shift.dayOfWeek}`}
|
||||
title={`Shift Validierung: timeSlotId=${shift.timeSlotId}, dayOfWeek=${shift.dayOfWeek}`}
|
||||
>
|
||||
⚠️
|
||||
</div>
|
||||
@@ -1124,7 +1124,7 @@ const ShiftPlanView: React.FC = () => {
|
||||
{shiftPlan.status === 'published' ? 'Veröffentlicht' : 'Entwurf'}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: '10px', alignItems: 'center' }}>
|
||||
<div style={{ display: 'flex', gap: '10px', alignItems: 'center' }}>
|
||||
{shiftPlan.status === 'published' && hasRole(['admin', 'maintenance']) && (
|
||||
<>
|
||||
<button
|
||||
@@ -1506,8 +1506,8 @@ const ShiftPlanView: React.FC = () => {
|
||||
shiftPlan.status === 'published'
|
||||
? 'Angezeigt werden die aktuell zugewiesenen Mitarbeiter'
|
||||
: assignmentResult
|
||||
? 'Angezeigt werden die vorgeschlagenen Mitarbeiter für eine exemplarische Woche'
|
||||
: 'Angezeigt wird "zugewiesene/benötigte Mitarbeiter" pro Schicht und Wochentag'
|
||||
? 'Angezeigt werden die vorgeschlagenen Mitarbeiter für eine exemplarische Woche'
|
||||
: 'Angezeigt wird "zugewiesene/benötigte Mitarbeiter" pro Schicht und Wochentag'
|
||||
}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user