feat(capa): add action buttons to CAPA detail page
This commit is contained in:
@@ -9,6 +9,7 @@ import { eq } from 'drizzle-orm'
|
||||
import { aliasedTable } from 'drizzle-orm'
|
||||
import { VerifyForm } from '@/components/capa/verify-form'
|
||||
import { CloseCapaButton } from '@/components/capa/close-capa-button'
|
||||
import { CapaOwnerActions } from '@/components/capa/capa-owner-actions'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ id: string }>
|
||||
@@ -39,6 +40,7 @@ export default async function CapaDetailPage({ params }: Props) {
|
||||
status: capaActions.status,
|
||||
completedAt: capaActions.completedAt,
|
||||
ownerNotes: capaActions.ownerNotes,
|
||||
ownerUserId: capaActions.ownerUserId,
|
||||
incidentRefNo: incidents.referenceNo,
|
||||
ownerName: ownerAlias.name,
|
||||
})
|
||||
@@ -112,6 +114,11 @@ export default async function CapaDetailPage({ params }: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{['open', 'in_progress', 'overdue', 'reopened'].includes(status) &&
|
||||
(isHse || session?.sub === capa.ownerUserId) && (
|
||||
<CapaOwnerActions capaId={id} currentStatus={status} />
|
||||
)}
|
||||
|
||||
{isHse && status === 'pending_verification' && (
|
||||
<VerifyForm capaId={id} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user