diff --git a/app/(dashboard)/task/client-detail/[client_id]/(main)/page.tsx b/app/(dashboard)/task/client-detail/[client_id]/(main)/page.tsx index a341af6..bad5db7 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/(main)/page.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/(main)/page.tsx @@ -56,7 +56,7 @@ export default async function ClientDetailPage({ params, searchParams }: Props)

{client.name}

-

{client?.description || 'No description available for this client!'}

+

{client?.description || 'No description available for this client.'}

diff --git a/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx index d086d62..41cee88 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx @@ -117,7 +117,7 @@ export default function AssignmentDetail({ client, initialAssignment: assignment
{isProject && ( - +
Project context
@@ -127,50 +127,48 @@ export default function AssignmentDetail({ client, initialAssignment: assignment + + Year {assignment.project?.year} + -
- {/* {assignment.project?.name} */} +
# Code: {assignment.project?.code} - Year: {assignment.project?.year} {formatDate(assignment.project?.start_date!)} → {`${assignment.project?.end_date ? formatDate(assignment.project.end_date) : 'N/A'}`}
-

{assignment.project?.description ?? 'No description available'}

+

{assignment.project?.description ?? 'No description available.'}

)} - {/* Work Orders Section */} -
- {!assignment.wo_name ? - - - No work orders defined for this assignment. - - - : -
- - -
-
- Team -
- -
+ {!assignment.wo_name ? + + + No work orders defined for this assignment. + + + : null + } - - -
-
+ + +
+
+ Team +
+
- } -
+ + + + + +
{/* Right Column: Status History */} diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx index 61e9b22..5047b2a 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx @@ -43,8 +43,8 @@ const AssignedPeople = ({ people, defaultOpen = true }: Props) => {

assigned to this work order

- diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/StatusTimeline.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/StatusTimeline.tsx index 3c6683b..3ba814a 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/StatusTimeline.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/StatusTimeline.tsx @@ -1,55 +1,103 @@ import { ProjectAssignmentStatusDetail } from '@/app/(dashboard)/task/type.assignment'; import BadgeStatus from '@/components/ui/badge-status'; +import { Button } from '@/components/ui/button'; import dayjs from 'dayjs'; -import { Clock } from 'lucide-react'; +import { ChevronDown, Clock } from 'lucide-react'; +import { useState } from 'react'; +import { motion, AnimatePresence } from 'motion/react'; interface StatusTimelineProps { history: ProjectAssignmentStatusDetail[]; + defaultOpen?: boolean; } -const StatusTimeline = ({ history }: StatusTimelineProps) => { +const StatusTimeline = ({ history, defaultOpen = true }: StatusTimelineProps) => { + const [isOpen, setIsOpen] = useState(defaultOpen); return (
{/* Vertical connector line */}
-
- {history.map((item, i) => { - const isLatest = i === 0; +
+
+ {/* Dot */} +
+
+
+
+
+
- return ( -
- {/* Dot */} -
-
-
-
- {isLatest &&
} -
+ {/* Content */} +
+
+ + Current +
+
+ + {history[0]?.start_date ? dayjs(history[0]?.start_date).format('MMM D, YYYY') : ''} + - + {history[0]?.end_date ? dayjs(history[0]?.end_date).format('MMM D, YYYY') : ''} +
+
+
- {/* Content */} -
-
- - {isLatest && Current} -
-
- - {item.start_date ? dayjs(item.start_date).format('MMM D, YYYY') : ''} - - - {item.end_date ? dayjs(item.end_date).format('MMM D, YYYY') : ''} -
- {/* {item.status_remarks && + +
+ + + {isOpen && ( + + +
+ {history.slice(1, history.length).map((item, i) => { + // const isLatest = i === 0; + + return ( +
+ {/* Dot */} +
+
+
+
+ {/* {isLatest &&
} */} +
+ + {/* Content */} +
+
+ + {/* {isLatest && Current} */} +
+
+ + {item.start_date ? dayjs(item.start_date).format('MMM D, YYYY') : ''} + - + {item.end_date ? dayjs(item.end_date).format('MMM D, YYYY') : ''} +
+ {/* {item.status_remarks &&

{item.status_remarks}

} */} -
+
+
+ ); + })}
- ); - })} -
+
+ )} +
); }; diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/WorkOrderCard.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/WorkOrderCard.tsx index 3eb790e..087fd5d 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/WorkOrderCard.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/WorkOrderCard.tsx @@ -34,7 +34,7 @@ const WorkOrderCard = ({ workOrder, index, defaultOpen = false }: WorkOrderCardP return ( <> - + {/* Header (always visible) */}
@@ -60,7 +60,7 @@ const WorkOrderCard = ({ workOrder, index, defaultOpen = false }: WorkOrderCardP - {formatDate(workOrder.wo_start_date)} → {formatDate(workOrder.wo_end_date!)} + {formatDate(workOrder.wo_start_date)} → {workOrder.wo_end_date ? formatDate(workOrder.wo_end_date!) : 'N/A'} @@ -80,9 +80,7 @@ const WorkOrderCard = ({ workOrder, index, defaultOpen = false }: WorkOrderCardP {/* Toggle button - full width on mobile */}
diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/page.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/page.tsx index fe39402..a9ab918 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/page.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/page.tsx @@ -115,7 +115,7 @@ export default async function ProjectDetailPage({ params, searchParams }: Props) - + {/*
*/} {/*
*/} diff --git a/app/(dashboard)/task/component/ClientGrid.tsx b/app/(dashboard)/task/component/ClientGrid.tsx index fec0f6a..0a710d0 100644 --- a/app/(dashboard)/task/component/ClientGrid.tsx +++ b/app/(dashboard)/task/component/ClientGrid.tsx @@ -80,9 +80,7 @@ export default function ClientGrid({ clients }: { clients: IClient[] }) {
- {client.status_name.toLowerCase() === 'active' && - - } + {client.status_name.toLowerCase() === 'active' && }
Status Summary
This is status summary information from WO or IM related to this client.
-
+
{client.project_status_summary.map((item, key) =>