mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 15:05:45 +01:00
removed users table relicts
This commit is contained in:
@@ -382,14 +382,25 @@ const EmployeeForm: React.FC<EmployeeFormProps> = ({
|
||||
backgroundColor: formData.role === role.value ? '#fef9e7' : 'white',
|
||||
cursor: 'pointer'
|
||||
}}
|
||||
onClick={() => setFormData(prev => ({ ...prev, role: role.value }))}
|
||||
onClick={() => {
|
||||
// Use a direct setter instead of the function form
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
role: role.value as 'admin' | 'maintenance' | 'user'
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="role"
|
||||
value={role.value}
|
||||
checked={formData.role === role.value}
|
||||
onChange={() => setFormData(prev => ({ ...prev, role: role.value }))}
|
||||
onChange={(e) => {
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
role: e.target.value as 'admin' | 'maintenance' | 'user'
|
||||
}));
|
||||
}}
|
||||
style={{
|
||||
marginRight: '10px',
|
||||
marginTop: '2px'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// frontend/src/pages/Employees/components/EmployeeList.tsx - KORRIGIERT
|
||||
import React, { useState } from 'react';
|
||||
import { ROLE_CONFIG, EMPLOYEE_TYPE_CONFIG } from '../../../../../backend/src/models/defaults/employeeDefaults';
|
||||
import { Employee } from '../../../../../backend/src/models/employee';
|
||||
import { ROLE_CONFIG, EMPLOYEE_TYPE_CONFIG } from '../../../models/defaults/employeeDefaults';
|
||||
import { Employee } from '../../../models/Employee';
|
||||
import { useAuth } from '../../../contexts/AuthContext';
|
||||
|
||||
interface EmployeeListProps {
|
||||
@@ -55,9 +55,10 @@ const EmployeeList: React.FC<EmployeeListProps> = ({
|
||||
};
|
||||
|
||||
// Using shared configuration for consistent styling
|
||||
const getEmployeeTypeBadge = (type: keyof typeof EMPLOYEE_TYPE_CONFIG) => {
|
||||
return EMPLOYEE_TYPE_CONFIG[type] || EMPLOYEE_TYPE_CONFIG.trainee;
|
||||
};
|
||||
const getEmployeeTypeBadge = (type: 'manager' | 'trainee' | 'experienced') => {
|
||||
const config = EMPLOYEE_TYPE_CONFIG.find(t => t.value === type);
|
||||
return config || EMPLOYEE_TYPE_CONFIG[0];
|
||||
};
|
||||
|
||||
const getStatusBadge = (isActive: boolean) => {
|
||||
return isActive
|
||||
|
||||
Reference in New Issue
Block a user