mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
fix: show Tanggal Selesai Kandang Kosong if category is empty kandang
This commit is contained in:
+19
@@ -60,6 +60,7 @@ interface ChecklistHeader {
|
||||
progress_percent: number;
|
||||
total_phases: number;
|
||||
total_activities: number;
|
||||
empty_kandang_end_date?: string | null;
|
||||
}
|
||||
|
||||
interface PhaseGroup {
|
||||
@@ -179,6 +180,9 @@ export function DetailDailyChecklistContent() {
|
||||
|
||||
setDocuments(rawDetailChecklist?.document_urls || []);
|
||||
|
||||
const emptyKandangEndDate =
|
||||
rawDetailChecklist?.empty_kandang?.end_date ?? null;
|
||||
|
||||
const checklistData = {
|
||||
id: rawDetailChecklist?.id,
|
||||
date: rawDetailChecklist?.date,
|
||||
@@ -205,6 +209,7 @@ export function DetailDailyChecklistContent() {
|
||||
progress_percent: 0,
|
||||
total_phases: 0,
|
||||
total_activities: 0,
|
||||
empty_kandang_end_date: emptyKandangEndDate,
|
||||
});
|
||||
setLoading(false);
|
||||
return;
|
||||
@@ -272,6 +277,7 @@ export function DetailDailyChecklistContent() {
|
||||
progress_percent: 0,
|
||||
total_phases: new Set(tasks.map((t) => t.phase_id)).size,
|
||||
total_activities: tasks.length,
|
||||
empty_kandang_end_date: emptyKandangEndDate,
|
||||
});
|
||||
setLoading(false);
|
||||
return;
|
||||
@@ -322,6 +328,7 @@ export function DetailDailyChecklistContent() {
|
||||
progress_percent: progressPercent,
|
||||
total_phases: uniquePhases.size,
|
||||
total_activities: uniqueActivities.size,
|
||||
empty_kandang_end_date: emptyKandangEndDate,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching checklist detail:', error);
|
||||
@@ -777,6 +784,18 @@ export function DetailDailyChecklistContent() {
|
||||
{CATEGORY_LABELS[header.category] || header.category}
|
||||
</p>
|
||||
</div>
|
||||
{header.category === 'empty_kandang' && (
|
||||
<div>
|
||||
<Label className='text-xs text-gray-500'>
|
||||
Tanggal Selesai Kandang Kosong
|
||||
</Label>
|
||||
<p className='text-sm font-medium text-gray-900 mt-1'>
|
||||
{header.empty_kandang_end_date
|
||||
? formatDate(header.empty_kandang_end_date)
|
||||
: '-'}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<Label className='text-xs text-gray-500'>Status</Label>
|
||||
<div className='mt-1'>{getStatusBadge(header.status)}</div>
|
||||
|
||||
Reference in New Issue
Block a user