fix: repair checklist create (intervall constraint) and start execution (stuck spinner), add equipment items display
This commit is contained in:
@@ -126,7 +126,7 @@ export default function ChecklistAusfuehrung() {
|
||||
});
|
||||
|
||||
// ── Loading states ──
|
||||
if (isNew || startingExecution) {
|
||||
if (isNew) {
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', py: 8 }}><CircularProgress /></Box>
|
||||
@@ -155,6 +155,7 @@ export default function ChecklistAusfuehrung() {
|
||||
const items = execution.items ?? [];
|
||||
const vorlageItems = items.filter((i) => i.vorlage_item_id != null);
|
||||
const vehicleItems = items.filter((i) => i.fahrzeug_item_id != null);
|
||||
const equipmentItems = items.filter((i) => i.ausruestung_item_id != null);
|
||||
|
||||
const renderItemGroup = (groupItems: ChecklistAusfuehrungItem[], title: string) => {
|
||||
if (groupItems.length === 0) return null;
|
||||
@@ -223,7 +224,7 @@ export default function ChecklistAusfuehrung() {
|
||||
{execution.vorlage_name ?? 'Checkliste'}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
{execution.fahrzeug_name ?? '–'} · {formatDate(execution.ausgefuehrt_am ?? execution.created_at)}
|
||||
{execution.fahrzeug_name ?? execution.ausruestung_name ?? '–'} · {formatDate(execution.ausgefuehrt_am ?? execution.created_at)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Chip
|
||||
@@ -243,6 +244,8 @@ export default function ChecklistAusfuehrung() {
|
||||
{renderItemGroup(vorlageItems, 'Vorlage-Items')}
|
||||
{vorlageItems.length > 0 && vehicleItems.length > 0 && <Divider sx={{ my: 2 }} />}
|
||||
{renderItemGroup(vehicleItems, 'Fahrzeugspezifische Items')}
|
||||
{(vorlageItems.length > 0 || vehicleItems.length > 0) && equipmentItems.length > 0 && <Divider sx={{ my: 2 }} />}
|
||||
{renderItemGroup(equipmentItems, 'Ausrüstungsspezifische Items')}
|
||||
|
||||
{items.length === 0 && (
|
||||
<Typography color="text.secondary">Keine Items in dieser Checkliste.</Typography>
|
||||
|
||||
Reference in New Issue
Block a user