From f63fb553a135f0157581d4288cf1e8a50c5b6452 Mon Sep 17 00:00:00 2001 From: Christian Rodrigues Date: Fri, 10 Oct 2025 11:42:48 -0700 Subject: [PATCH] client(feat): implement ticket completion feature with documentation modal --- .../tickets/ticket-complete-modal.tsx | 107 ++++++++++++++++++ client/components/tickets/ticket-detail.tsx | 97 ++++++++++++++-- client/components/tickets/ticket-edit.tsx | 40 +++++-- client/lib/api/tickets.ts | 5 + client/lib/hooks/queries/use-tickets.ts | 16 ++- client/lib/types/ticket.ts | 1 + server/internal/api/handlers.go | 36 ++++++ server/internal/models/ticket.go | 69 +++++------ server/internal/storage/storage.go | 5 + 9 files changed, 322 insertions(+), 54 deletions(-) create mode 100644 client/components/tickets/ticket-complete-modal.tsx diff --git a/client/components/tickets/ticket-complete-modal.tsx b/client/components/tickets/ticket-complete-modal.tsx new file mode 100644 index 0000000..bbed5b7 --- /dev/null +++ b/client/components/tickets/ticket-complete-modal.tsx @@ -0,0 +1,107 @@ +"use client"; + +import { BookOpen, CheckCircle } from "lucide-react"; +import { FormEvent, useState } from "react"; + +import Button from "../ui/button"; +import LabeledIcon from "../ui/labeled-icon"; +import Modal from "../ui/modal"; + +export interface TicketCompleteModalProps { + isOpen: boolean; + ticketTitle: string; + existingDocumentation?: string; + onClose: () => void; + onComplete: (documentation: string) => void; + isLoading?: boolean; +} + +export default function TicketCompleteModal({ + isOpen, + ticketTitle, + existingDocumentation = "", + onClose, + onComplete, + isLoading = false, +}: TicketCompleteModalProps) { + const [documentation, setDocumentation] = useState(existingDocumentation); + + const handleSubmit = (e: FormEvent) => { + e.preventDefault(); + onComplete(documentation); + }; + + const handleClose = () => { + setDocumentation(existingDocumentation); // Reset to original value + onClose(); + }; + + return ( + +
+
+
+ +

+ Complete Ticket +

+
+

+ Ticket: {ticketTitle} +

+

+ Before marking this ticket as complete, please document how you resolved it. + This helps other team members learn from your solution. +

+
+ +
+
+ +