feat(persoenliche-ausruestung): show catalog category, remove size/date columns, make zustand admin-configurable
This commit is contained in:
@@ -44,8 +44,7 @@ import { usePermissionContext } from '../contexts/PermissionContext';
|
||||
import { membersService } from '../services/members';
|
||||
import { atemschutzApi } from '../services/atemschutz';
|
||||
import { personalEquipmentApi } from '../services/personalEquipment';
|
||||
import { ZUSTAND_LABELS, ZUSTAND_COLORS } from '../types/personalEquipment.types';
|
||||
import type { PersoenlicheAusruestung } from '../types/personalEquipment.types';
|
||||
import type { PersoenlicheAusruestung, ZustandOption } from '../types/personalEquipment.types';
|
||||
import { toGermanDate, fromGermanDate } from '../utils/dateInput';
|
||||
import {
|
||||
MemberWithProfile,
|
||||
@@ -233,6 +232,7 @@ function MitgliedDetail() {
|
||||
// Personal equipment data
|
||||
const [personalEquipment, setPersonalEquipment] = useState<PersoenlicheAusruestung[]>([]);
|
||||
const [personalEquipmentLoading, setPersonalEquipmentLoading] = useState(false);
|
||||
const [zustandOptions, setZustandOptions] = useState<ZustandOption[]>([]);
|
||||
|
||||
// FDISK-synced sub-section data
|
||||
const [befoerderungen, setBefoerderungen] = useState<Befoerderung[]>([]);
|
||||
@@ -291,6 +291,9 @@ function MitgliedDetail() {
|
||||
.then(setPersonalEquipment)
|
||||
.catch(() => setPersonalEquipment([]))
|
||||
.finally(() => setPersonalEquipmentLoading(false));
|
||||
personalEquipmentApi.getZustandOptions()
|
||||
.then(setZustandOptions)
|
||||
.catch(() => {});
|
||||
}, [userId]);
|
||||
|
||||
// Load FDISK-synced sub-section data
|
||||
@@ -976,8 +979,8 @@ function MitgliedDetail() {
|
||||
)}
|
||||
</Box>
|
||||
<Chip
|
||||
label={ZUSTAND_LABELS[item.zustand]}
|
||||
color={ZUSTAND_COLORS[item.zustand]}
|
||||
label={zustandOptions.find(o => o.key === item.zustand)?.label ?? item.zustand}
|
||||
color={(zustandOptions.find(o => o.key === item.zustand)?.color ?? 'default') as any}
|
||||
size="small"
|
||||
variant="outlined"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user