diff --git a/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/ActivityHistoryModal.tsx b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/ActivityHistoryModal.tsx new file mode 100644 index 0000000..cb52b66 --- /dev/null +++ b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/ActivityHistoryModal.tsx @@ -0,0 +1,114 @@ +"use client"; + +import { useState } from 'react'; +import { IProjectAssignmentHistory } from '../../../type.assignment'; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; +import { Button } from '@/components/ui/button'; +import { Check, Copy, FileText } from 'lucide-react'; +import dayjs from 'dayjs'; +import { DialogDescription } from '@radix-ui/react-dialog'; + +interface ActivityHistoryModalProps { + historyItem: IProjectAssignmentHistory | null; + open: boolean; + onClose: () => void; +} + +export function ActivityHistoryModal({ historyItem, open, onClose }: ActivityHistoryModalProps) { + const [copied, setCopied] = useState(false); + + if (!historyItem) return null; + + const oldData = historyItem.old_data; + const newData = historyItem.new_data; + + const copyFullJson = () => { + const payload = { + id: historyItem.id, + description: historyItem.description, + created_at: historyItem.created_at, + user: historyItem.user, + old_data: oldData, + new_data: newData, + }; + navigator.clipboard.writeText(JSON.stringify(payload, null, 2)); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + + return ( + + ); +} 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 7f41302..e552145 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 @@ -1,14 +1,4 @@ -"use client" - -/** - * Design read: internal ops detail page for staff, calm Linear-style language, - * existing shadcn + Tailwind stack, brand orange (`his`) as the single accent. - * Dials: VARIANCE 5, MOTION 4, DENSITY 5. - * - * Shape lock: surfaces rounded-2xl, inner tiles rounded-xl, small chips rounded-lg. - * Elevation comes from borders, not shadows. Accent is used only for the current - * timeline node, link hovers and the primary action. - */ +"use client"; import { useState, type ReactNode } from 'react'; import Link from 'next/link'; @@ -19,6 +9,7 @@ import { FolderGit2, History, LayoutGrid, List, Mail, Phone, UserPlus, Users, } from 'lucide-react'; import { Button } from '@/components/ui/button'; +import { Card900 } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { LazyImage } from '@/components/ui/lazy-image'; import BadgeStatus from '@/components/ui/badge-status'; @@ -28,6 +19,18 @@ import { IClient, CLIENT_FALLBACK_IMAGE, END_USER_FALLBACK_IMAGE } from '../../. import { IProjectAssignment, ProjectAssignmentWorkOrderDetail } from '../../../type.assignment'; import ConvertedAssignmentBadge from '../../../component/project-assignment/ConvertedAssignmentBadge'; import Reveal from '@/components/ui/reveal'; +import { buildAssignmentOverview, formatAssignmentDate } from '../../../utils/assignment-overview-helpers'; + +// Dynamically imported heavy child components +const ProjectMilestoneTimeline = dynamic( + () => import('./ProjectMilestoneTimeline').then((mod) => mod.ProjectMilestoneTimeline), + { ssr: false, loading: () =>
} +); + +const DevelopmentActivityLog = dynamic( + () => import('./DevelopmentActivityLog').then((mod) => mod.DevelopmentActivityLog), + { ssr: false, loading: () => } +); const ModalActionLoader = () => (+
{assignmentDesc}
) : null}+ {assignment.project.name} +
++ {assignment.project.description || 'No description available.'} +
+- {assignment.project.name} -
-- {assignment.project.description || 'No description available.'} -
-- {assignment.note} -
-Nobody is assigned yet
-- Add people from the team directory to start tracking who works on this assignment. -
-- {team.length} {team.length === 1 ? 'member assigned' : 'members assigned'} -
-- {activeTeamCount} active · {positionCount} {positionCount === 1 ? 'role' : 'roles'} -
-- No status changes recorded yet. Use Update Technical Status to log the first one. -
- ) : ( -- {formatAssignmentDate(entry.start_date)} - {entry.end_date ? formatAssignmentDate(entry.end_date) : 'Present'} -
- {span ? ( -{span}
- ) : null} - {entry.description ? ( -- {entry.description} -
- ) : null} -+ {assignment.note} +
Nobody is assigned yet
++ Add people from the team directory to start tracking who works on this assignment. +
++ {team.length} {team.length === 1 ? 'member assigned' : 'members assigned'} +
++ {activeTeamCount} active · {positionCount} {positionCount === 1 ? 'role' : 'roles'} +
+