-
Status History
+
Assignment Timeline
{workOrder.project_assignment_status_detail.length} status changes
diff --git a/app/(dashboard)/task/component/AssignmentTable.tsx b/app/(dashboard)/task/component/AssignmentTable.tsx
index 1c3fe39..38de698 100644
--- a/app/(dashboard)/task/component/AssignmentTable.tsx
+++ b/app/(dashboard)/task/component/AssignmentTable.tsx
@@ -7,6 +7,8 @@ import BadgeStatus from '@/components/ui/badge-status';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import { Button } from '@/components/ui/button';
import { IProjectAssignment } from '../type.assignment';
+import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
+import { LazyImage } from '@/components/ui/lazy-image';
export default function AssignmentTable({ data }: { data: IProjectAssignment[] }) {
if (data.length === 0) {
@@ -42,6 +44,7 @@ export default function AssignmentTable({ data }: { data: IProjectAssignment[] }
WO End
Last Status
Status Remarks
+
Team
@@ -95,7 +98,34 @@ export default function AssignmentTable({ data }: { data: IProjectAssignment[] }
- {assignment.project_assignment_status_detail[0].status_remarks}
+ {assignment.project_assignment_status_detail[0]?.status_remarks}
+
+
+
+ {assignment.project_assignment_work_order_detail?.slice(0, 5).map((user, key) => {
+ return (
+
+
+
+
+
+
+ {user?.user?.name}
+ {user?.user?.position?.name}
+
+
+
+ );
+ })}
+ {assignment.project_assignment_work_order_detail?.length! > 5 &&
+
+ +{assignment.project_assignment_work_order_detail?.length! - 5}
+
+ }
+ {assignment.project_assignment_work_order_detail?.length === 0 &&
+
No team assigned
+ }
+
diff --git a/app/(dashboard)/task/component/ClientGrid.tsx b/app/(dashboard)/task/component/ClientGrid.tsx
index 39c5c36..11bc12d 100644
--- a/app/(dashboard)/task/component/ClientGrid.tsx
+++ b/app/(dashboard)/task/component/ClientGrid.tsx
@@ -19,7 +19,7 @@ import { useRouter } from 'next/navigation';
import FormClient from './FormClient';
import { ConfirmDeleteWithInput } from '@/components/modal/ConfirmDeleteWithInput';
-export default function ClientGrid({ clients, assignments }: { clients: IClient[], assignments: any[] }) {
+export default function ClientGrid({ clients }: { clients: IClient[] }) {
const router = useRouter();
const [action, setAction] = useState<'EDIT' | 'DELETE' | undefined>(undefined)
const [selectedData, setShowSelectedData] = useState()
@@ -42,13 +42,10 @@ export default function ClientGrid({ clients, assignments }: { clients: IClient[
<>
{clients.map((client, i) => {
- const clientAssignments = assignments.filter(a => a.clientId === client.id);
const imCount = 0
const projectCount = client.total_project;
- // const woCount = clientAssignments.reduce((acc, a) => acc + a.workOrders.length, 0);
const woCount = client.total_work_order
- const assignedEmployeeIds = Array.from(new Set(clientAssignments.flatMap(a => a.assignedEmployees)));
- console.log(client)
+ const userCount = client.total_user_assigned
return (
0 && (
<>
A dedicated team of{" "}
- {assignedEmployeeIds.length} experts is handling{" "}
+ {userCount} experts is handling{" "}
{woCount} work order{woCount! > 1 ? 's' : ''}{" "}to ensure successful delivery for {client.end_user_name}.
>
)}
@@ -123,27 +120,25 @@ export default function ClientGrid({ clients, assignments }: { clients: IClient[
return (
-
-
+
+
- {user?.fullname}
- {user?.role?.name}
+ {user?.name}
+ {user?.position?.name}
);
})}
- {client.users?.length! > 5 && (
+ {client.users?.length! > 5 &&
+{client.users?.length! - 5}
- )}
- {client.users?.length === 0 && (
+ }
+ {client.users?.length === 0 &&
No team assigned
- )}
+ }
diff --git a/app/(dashboard)/task/page.tsx b/app/(dashboard)/task/page.tsx
index 7b59803..8c5199a 100644
--- a/app/(dashboard)/task/page.tsx
+++ b/app/(dashboard)/task/page.tsx
@@ -37,7 +37,7 @@ export default async function ClientsPage({ searchParams }: Props) {
{/* Render the correct view based on the URL */}
}>
{view === 'grid' ?
-
+
:
}
diff --git a/app/admin/administration/user/component/type.tsx b/app/admin/administration/user/component/type.tsx
index 00bc405..80883c5 100644
--- a/app/admin/administration/user/component/type.tsx
+++ b/app/admin/administration/user/component/type.tsx
@@ -36,4 +36,5 @@ export interface IUser {
resign_date?: string
resign_reason?: string
post_company?: string
+ name?: string
}
\ No newline at end of file
diff --git a/components/ui/badge-status.tsx b/components/ui/badge-status.tsx
index 1315923..2ec45b3 100644
--- a/components/ui/badge-status.tsx
+++ b/components/ui/badge-status.tsx
@@ -3,10 +3,7 @@ import { Badge, STATUS_BADGE_MAP } from "@/components/ui/badge"
export default function BadgeStatus({ status, className }: { status: string, className?: string }) { // e.g. status = "UAT"
return (
- {status?.toLowerCase()
- .split(' ')
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
- .join(' ')}
+ {status}
)
}
\ No newline at end of file