From 938eb7e08dce1678b746347121467c16a1769437 Mon Sep 17 00:00:00 2001 From: weeihan Date: Thu, 23 Jul 2026 12:00:43 +0800 Subject: [PATCH] feat(capa): wire owner notes form into capa-owner page and HSE detail view --- app/(protected)/capa-owner/page.tsx | 4 +++- app/(protected)/hse/capa/[id]/page.tsx | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/(protected)/capa-owner/page.tsx b/app/(protected)/capa-owner/page.tsx index 2d2bc2d..145772b 100644 --- a/app/(protected)/capa-owner/page.tsx +++ b/app/(protected)/capa-owner/page.tsx @@ -5,6 +5,7 @@ import { createClient } from '@/lib/supabase/server' import { redirect } from 'next/navigation' import { StatCard } from '@/components/dashboard/stat-card' import { CapaOwnerActions } from '@/components/capa/capa-owner-actions' +import { CapaOwnerNotesForm } from '@/components/capa/capa-owner-notes-form' const STATUS_LABELS: Record = { open: 'Open', @@ -36,7 +37,7 @@ export default async function CapaOwnerPage() { const { data: capas } = await supabase .from('capa_actions') - .select('id, description, due_date, priority, status, incident_id, incidents (reference_no)') + .select('id, description, due_date, priority, status, incident_id, owner_notes, incidents (reference_no)') .eq('owner_user_id', user.id) .order('due_date', { ascending: true, nullsFirst: false }) @@ -99,6 +100,7 @@ export default async function CapaOwnerPage() { + ) })} diff --git a/app/(protected)/hse/capa/[id]/page.tsx b/app/(protected)/hse/capa/[id]/page.tsx index 14a74b4..7a4ebcc 100644 --- a/app/(protected)/hse/capa/[id]/page.tsx +++ b/app/(protected)/hse/capa/[id]/page.tsx @@ -30,6 +30,7 @@ export default async function CapaDetailPage({ params }: Props) { .select(` id, incident_id, root_cause_ref, description, department, due_date, priority, status, completed_at, verified_by, verified_at, created_at, + owner_notes, incidents (reference_no, incident_type), owner:users!owner_user_id (name, email) `) @@ -77,6 +78,14 @@ export default async function CapaDetailPage({ params }: Props) {

Status

{status.replace(/_/g, ' ')}

+ {(capa as { owner_notes: string | null }).owner_notes && ( +
+

Owner Notes

+

+ {(capa as { owner_notes: string }).owner_notes} +

+
+ )} {(capa as { root_cause_ref: string | null }).root_cause_ref && (