removed debug infor

This commit is contained in:
2025-10-21 14:32:08 +02:00
parent 59b09b663e
commit b3a1c5ff59
13 changed files with 443 additions and 226 deletions

View File

@@ -343,30 +343,53 @@ const Dashboard: React.FC = () => {
return (
<div>
{/* Willkommens-Bereich */}
<div style={{
backgroundColor: '#e8f4fd',
padding: '25px',
borderRadius: '8px',
marginBottom: '30px',
border: '1px solid #b6d7e8',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
}}>
<div>
<h1 style={{ margin: '0 0 10px 0', color: '#2c3e50' }}>
Willkommen zurück, {user?.firstname} {user?.lastname} ! 👋
</h1>
<p style={{ margin: 0, color: '#546e7a', fontSize: '16px' }}>
{new Date().toLocaleDateString('de-DE', {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric'
})}
</p>
</div>
{/* Minimalist Welcome Section */}
<div
style={{
width: '100vw',
position: 'relative',
left: '50%',
right: '50%',
marginLeft: '-50vw',
marginRight: '-50vw',
background: `
radial-gradient(ellipse farthest-corner at center 53%,
#d9b9f3ff 10%,
#ddc5f1ff 22%,
#e9d4f8ff 32%,
#FBFAF6 55%)
`,
textAlign: 'center',
padding: '10vh 0',
color: '#161718',
fontFamily: "'Poppins', 'Inter', 'Manrope', sans-serif",
}}
>
<h1
style={{
fontSize: '3rem',
fontWeight: 100,
letterSpacing: '0.08em',
marginBottom: '0.5rem',
opacity: 0.995,
filter: 'blur(0.2px)',
}}
>
Willkommen
</h1>
<p
style={{
fontSize: '1.1rem',
color: '#3e2069',
letterSpacing: '0.05em',
fontWeight: 300,
opacity: 0.85,
transition: 'color 0.3s ease',
}}
>
{user?.firstname} {user?.lastname}
</p>
</div>
{/* Quick Actions - Nur für Admins/Instandhalter */}
@@ -483,7 +506,7 @@ const Dashboard: React.FC = () => {
}}>
<div style={{
width: `${progress.percentage}%`,
backgroundColor: progress.percentage > 0 ? '#3498db' : '#95a5a6',
backgroundColor: progress.percentage > 0 ? '#854eca' : '#95a5a6',
height: '8px',
borderRadius: '10px',
transition: 'width 0.3s ease'

View File

@@ -190,7 +190,7 @@ const EmployeeManagement: React.FC = () => {
onClick={handleCreateEmployee}
style={{
padding: '12px 24px',
backgroundColor: '#27ae60',
backgroundColor: '#51258f',
color: 'white',
border: 'none',
borderRadius: '6px',

View File

@@ -372,18 +372,6 @@ const AvailabilityManager: React.FC<AvailabilityManagerProps> = ({
</div>
)}
{/* Timetable Structure Info */}
<div style={{
backgroundColor: '#d1ecf1',
border: '1px solid #bee5eb',
padding: '10px 15px',
margin: '10px',
borderRadius: '4px',
fontSize: '12px'
}}>
<strong>Struktur-Info:</strong> {sortedTimeSlots.length} Zeitslots × {days.length} Tage = {sortedTimeSlots.length * days.length} Zellen
</div>
<div style={{ overflowX: 'auto' }}>
<table style={{
width: '100%',
@@ -397,7 +385,7 @@ const AvailabilityManager: React.FC<AvailabilityManagerProps> = ({
textAlign: 'left',
border: '1px solid #dee2e6',
fontWeight: 'bold',
minWidth: '200px'
minWidth: '120px'
}}>
Zeitslot
</th>
@@ -558,15 +546,9 @@ const AvailabilityManager: React.FC<AvailabilityManagerProps> = ({
color: '#666'
}}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<strong>Zusammenfassung:</strong> {sortedTimeSlots.length} Zeitslots × {days.length} Tage = {sortedTimeSlots.length * days.length} mögliche Shifts
</div>
<div>
<strong>Aktive Verfügbarkeiten:</strong> {availabilities.filter(a => a.preferenceLevel !== 3).length}
</div>
<div>
<strong>Validierungsfehler:</strong> {validationErrors.length}
</div>
</div>
</div>
</div>
@@ -667,70 +649,9 @@ const AvailabilityManager: React.FC<AvailabilityManagerProps> = ({
borderBottom: '2px solid #f0f0f0',
paddingBottom: '15px'
}}>
📅 Verfügbarkeit verwalten (Shift-ID basiert)
📅 Verfügbarkeit verwalten
</h2>
{/* Debug-Info */}
<div style={{
backgroundColor: !selectedPlan ? '#f8d7da' : (shiftsCount === 0 ? '#fff3cd' : '#d1ecf1'),
border: `1px solid ${!selectedPlan ? '#f5c6cb' : (shiftsCount === 0 ? '#ffeaa7' : '#bee5eb')}`,
borderRadius: '6px',
padding: '15px',
marginBottom: '20px'
}}>
<h4 style={{
margin: '0 0 10px 0',
color: !selectedPlan ? '#721c24' : (shiftsCount === 0 ? '#856404' : '#0c5460')
}}>
{!selectedPlan ? '❌ KEIN PLAN AUSGEWÄHLT' :
shiftsCount === 0 ? '⚠️ KEINE SHIFTS GEFUNDEN' : '✅ PLAN-DATEN GELADEN'}
</h4>
<div style={{ fontSize: '12px', fontFamily: 'monospace' }}>
<div><strong>Ausgewählter Plan:</strong> {selectedPlan?.name || 'Keiner'}</div>
<div><strong>Plan ID:</strong> {selectedPlanId || 'Nicht gesetzt'}</div>
<div><strong>Geladene Pläne:</strong> {shiftPlans.length}</div>
<div><strong>Einzigartige Shifts:</strong> {shiftsCount}</div>
<div><strong>Geladene Verfügbarkeiten:</strong> {availabilities.length}</div>
{selectedPlan && (
<>
<div><strong>Verwendete Tage:</strong> {days.length} ({days.map(d => d.name).join(', ')})</div>
<div><strong>Gesamte Shifts im Plan:</strong> {selectedPlan.shifts?.length || 0}</div>
</>
)}
</div>
{/* Show existing preferences */}
{availabilities.length > 0 && (
<div style={{ marginTop: '10px', paddingTop: '10px', borderTop: '1px solid #bee5eb' }}>
<strong>Vorhandene Präferenzen:</strong>
{availabilities.slice(0, 5).map(avail => {
// SICHERHEITSCHECK: Stelle sicher, dass shiftId existiert
if (!avail.shiftId) {
return (
<div key={avail.id} style={{ fontSize: '11px', color: 'red' }}>
UNGÜLTIG: Keine Shift-ID
</div>
);
}
const shift = selectedPlan?.shifts?.find(s => s.id === avail.shiftId);
const shiftIdDisplay = avail.shiftId ? avail.shiftId.substring(0, 8) + '...' : 'KEINE ID';
return (
<div key={avail.id} style={{ fontSize: '11px' }}>
Shift {shiftIdDisplay} (Day {shift?.dayOfWeek || '?'}): Level {avail.preferenceLevel}
</div>
);
})}
{availabilities.length > 5 && (
<div style={{ fontSize: '11px', fontStyle: 'italic' }}>
... und {availabilities.length - 5} weitere
</div>
)}
</div>
)}
</div>
{/* Employee Info */}
<div style={{ marginBottom: '20px' }}>
<h3 style={{ margin: '0 0 10px 0', color: '#34495e' }}>
@@ -739,9 +660,6 @@ const AvailabilityManager: React.FC<AvailabilityManagerProps> = ({
<p style={{ margin: 0, color: '#7f8c8d' }}>
<strong>Email:</strong> {employee.email}
</p>
<p style={{ margin: '5px 0 0 0', color: '#7f8c8d' }}>
Legen Sie die Verfügbarkeit für {employeeFullName} fest (basierend auf Shift-IDs).
</p>
</div>
{error && (

View File

@@ -397,14 +397,6 @@ const Settings: React.FC = () => {
/>
</div>
</div>
<div style={{ marginTop: '1rem', padding: '1rem', background: '#f8f9fa', borderRadius: '8px' }}>
<div style={{ fontSize: '0.9rem', color: '#666' }}>
<strong>Vorschau:</strong> {getFullName() || '(Kein Name)'}
</div>
<div style={{ fontSize: '0.8rem', color: '#888', marginTop: '0.5rem' }}>
E-Mail: {currentUser.email}
</div>
</div>
</div>
</div>

View File

@@ -74,7 +74,7 @@ const ShiftPlanList: React.FC = () => {
<Link to="/shift-plans/new">
<button style={{
padding: '10px 20px',
backgroundColor: '#3498db',
backgroundColor: '#51258f',
color: 'white',
border: 'none',
borderRadius: '4px',

View File

@@ -771,19 +771,6 @@ const ShiftPlanView: React.FC = () => {
</ul>
</div>
)}
{/* Timetable Structure Info - SAME AS AVAILABILITYMANAGER */}
<div style={{
backgroundColor: '#d1ecf1',
border: '1px solid #bee5eb',
padding: '10px 15px',
margin: '10px',
borderRadius: '4px',
fontSize: '12px'
}}>
<strong>Struktur-Info:</strong> {allTimeSlots.length} Zeitslots × {days.length} Tage = {allTimeSlots.length * days.length} Zellen
</div>
<div style={{ overflowX: 'auto' }}>
<table style={{
width: '100%',
@@ -797,7 +784,7 @@ const ShiftPlanView: React.FC = () => {
textAlign: 'left',
border: '1px solid #dee2e6',
fontWeight: 'bold',
minWidth: '200px'
minWidth: '120px'
}}>
Schicht (Zeit)
</th>
@@ -850,7 +837,7 @@ const ShiftPlanView: React.FC = () => {
color: '#ccc',
fontStyle: 'italic'
}}>
Kein Shift
Keine Schicht
</td>
);
}
@@ -977,23 +964,6 @@ const ShiftPlanView: React.FC = () => {
</table>
</div>
{/* Summary Statistics - SAME AS AVAILABILITYMANAGER */}
<div style={{
backgroundColor: '#f8f9fa',
padding: '15px',
borderTop: '1px solid #dee2e6',
fontSize: '12px',
color: '#666'
}}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<strong>Zusammenfassung:</strong> {allTimeSlots.length} Zeitslots × {days.length} Tage = {allTimeSlots.length * days.length} mögliche Shifts
</div>
<div>
<strong>Validierungsfehler:</strong> {validation.errors.length}
</div>
</div>
</div>
</div>
);
};
@@ -1069,50 +1039,6 @@ const ShiftPlanView: React.FC = () => {
</div>
</div>
{/* Debug Info - Enhanced */}
<div style={{
backgroundColor: validation.errors.length > 0 ? '#fff3cd' : (allTimeSlots.length === 0 ? '#f8d7da' : '#d1ecf1'),
border: `1px solid ${validation.errors.length > 0 ? '#ffeaa7' : (allTimeSlots.length === 0 ? '#f5c6cb' : '#bee5eb')}`,
borderRadius: '6px',
padding: '15px',
marginBottom: '20px'
}}>
<h4 style={{
margin: '0 0 10px 0',
color: validation.errors.length > 0 ? '#856404' : (allTimeSlots.length === 0 ? '#721c24' : '#0c5460')
}}>
{validation.errors.length > 0 ? '⚠️ VALIDIERUNGSPROBLEME' :
allTimeSlots.length === 0 ? '❌ KEINE SHIFTS GEFUNDEN' : '✅ PLAN-DATEN GELADEN'}
</h4>
<div style={{ fontSize: '12px', fontFamily: 'monospace' }}>
<div><strong>Ausgewählter Plan:</strong> {shiftPlan.name}</div>
<div><strong>Plan ID:</strong> {shiftPlan.id}</div>
<div><strong>Einzigartige Zeitslots:</strong> {allTimeSlots.length}</div>
<div><strong>Verwendete Tage:</strong> {days.length} ({days.map(d => d.name).join(', ')})</div>
<div><strong>Shift Patterns:</strong> {shiftPlan.shifts?.length || 0}</div>
<div><strong>Scheduled Shifts:</strong> {scheduledShifts.length}</div>
<div><strong>Geladene Verfügbarkeiten:</strong> {availabilities.length}</div>
<div><strong>Aktive Mitarbeiter:</strong> {employees.length}</div>
{assignmentResult && (
<div><strong>Assignment Keys:</strong> {Object.keys(assignmentResult.assignments).length}</div>
)}
</div>
{/* Show shift pattern vs scheduled shift matching */}
{shiftPlan.shifts && scheduledShifts.length > 0 && (
<div style={{ marginTop: '10px', paddingTop: '10px', borderTop: '1px solid #bee5eb' }}>
<strong>Shift Matching:</strong>
<div style={{ fontSize: '11px' }}>
{shiftPlan.shifts.length} Patterns {scheduledShifts.length} Scheduled Shifts
{assignmentResult && (
<div> {Object.keys(assignmentResult.assignments).length} Assignment Keys</div>
)}
</div>
</div>
)}
</div>
{/* Rest of the component remains the same... */}
{/* Availability Status - only show for drafts */}
{shiftPlan.status === 'draft' && (
<div style={{