From 7e456dbbda0ab48e4cc36b3f9f2c28355187c5d6 Mon Sep 17 00:00:00 2001 From: Ichsan Kurniawan Date: Tue, 28 Apr 2026 20:11:11 +0700 Subject: [PATCH] Add end-user photo & UI refinements Show end-user info and improve responsive layout and form UX. Changes include: make grid responsive (md:grid-cols-2) and add an inline end-user card with LazyImage in ClientDetailComponent; update ProjectAssignmentForm to show a default header description when no clientId, add bottom spacing to CardContent, and hide the "add client" (+) button when a clientId exists; remove a debug console.log and show client.description (with fallback) in project detail page; and add a photo field to Client and EndUser types in type.assignment.ts. These tweaks improve visual clarity and prevent creating duplicate clients from the assignment form. --- .../[client_id]/(main)/ClientDetailComponent.tsx | 14 ++++++++++++-- .../project-assignments/ProjectAssignmentForm.tsx | 12 +++++++----- .../project-detail/[project_id]/page.tsx | 3 +-- app/(dashboard)/task/type.assignment.ts | 2 ++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx b/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx index ee161b3..ecdef01 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx @@ -84,7 +84,7 @@ export default function ClientDetailComponent({ clientId, assignmentLists }: Pro : viewMode === 'grid' ? /* --- GRID VIEW --- */ -
+
{assignmentLists.map((assignment) => { const isProject = assignment.wo_name @@ -127,7 +127,17 @@ export default function ClientDetailComponent({ clientId, assignmentLists }: Pro

{assignmentDesc}

-
+
+
+ +
+
+

End User

+

{assignment.end_user.name}

+
+
+ +
diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-assignments/ProjectAssignmentForm.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-assignments/ProjectAssignmentForm.tsx index 2e08cc2..d4d14a7 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-assignments/ProjectAssignmentForm.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-assignments/ProjectAssignmentForm.tsx @@ -256,7 +256,7 @@ export default function ProjectAssignmentForm({ client, clientId, isEdit, assign

{isEdit ? 'Update' : 'Create Project'} Assignment

-

{clientId ? `For ${client?.name}` : ''}

+

{clientId ? `For ${client?.name}` : 'Manage the creation and modification of assignment information'}

@@ -346,7 +346,7 @@ export default function ProjectAssignmentForm({ client, clientId, isEdit, assign Client Details Select the client and end user information for this assignment. - + ( @@ -377,9 +377,11 @@ export default function ProjectAssignmentForm({ client, clientId, isEdit, assign ); }} /> - + {clientId ? null : + + }
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 1f1aa37..7f2b141 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 @@ -31,7 +31,6 @@ export default async function ProjectDetailPage({ params, searchParams }: Props) const [client, project] = await Promise.all([getClientById, getAssignmentByProjectId]); - console.log(project) // 3. Handle 404 Securely on the server if (!project) { return ( @@ -200,7 +199,7 @@ export default async function ProjectDetailPage({ params, searchParams }: Props)

{client?.name}

- End user: {client?.end_user_name} + {client?.description ?? "No description available for this client."}

diff --git a/app/(dashboard)/task/type.assignment.ts b/app/(dashboard)/task/type.assignment.ts index 10b0fa4..f543452 100644 --- a/app/(dashboard)/task/type.assignment.ts +++ b/app/(dashboard)/task/type.assignment.ts @@ -29,12 +29,14 @@ export interface Client { id: number code: string name: string + photo: string } export interface EndUser { id: number code: string name: string + photo: string } export interface Project {