mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 15:05:45 +01:00
fixed role naming instandhalter -> maintenance
This commit is contained in:
@@ -48,6 +48,13 @@ const EmployeeList: React.FC<EmployeeListProps> = ({
|
||||
return true;
|
||||
});
|
||||
|
||||
// Helper to get highest role for sorting
|
||||
const getHighestRole = (roles: string[]): string => {
|
||||
if (roles.includes('admin')) return 'admin';
|
||||
if (roles.includes('maintenance')) return 'maintenance';
|
||||
return 'user';
|
||||
};
|
||||
|
||||
// Sort employees based on selected field and direction
|
||||
const sortedEmployees = [...filteredEmployees].sort((a, b) => {
|
||||
let aValue: any;
|
||||
@@ -67,7 +74,6 @@ const EmployeeList: React.FC<EmployeeListProps> = ({
|
||||
bValue = b.canWorkAlone;
|
||||
break;
|
||||
case 'role':
|
||||
// Use the highest role for sorting
|
||||
aValue = getHighestRole(a.roles || []);
|
||||
bValue = getHighestRole(b.roles || []);
|
||||
break;
|
||||
@@ -87,13 +93,6 @@ const EmployeeList: React.FC<EmployeeListProps> = ({
|
||||
}
|
||||
});
|
||||
|
||||
// Helper to get highest role for sorting
|
||||
const getHighestRole = (roles: string[]): string => {
|
||||
if (roles.includes('admin')) return 'admin';
|
||||
if (roles.includes('maintenance')) return 'maintenance';
|
||||
return 'user';
|
||||
};
|
||||
|
||||
const handleSort = (field: SortField) => {
|
||||
if (sortField === field) {
|
||||
// Toggle direction if same field
|
||||
|
||||
Reference in New Issue
Block a user