feat: nullable projectId, new ticket categories, improved create form

This commit is contained in:
pray4skylark
2026-06-08 16:53:01 +09:00
parent ca444a3b4f
commit 0e141e16af
8 changed files with 299 additions and 40 deletions
+42 -3
View File
@@ -18,6 +18,24 @@ const statusLabel: Record<string, string> = {
OPEN: 'Open', ASSIGNED: 'Assigned', IN_PROGRESS: 'In Progress', RESOLVED: 'Resolved', CLOSED: 'Closed',
};
const categoryLabel: Record<string, string> = {
BUG: '버그 리포트',
FEATURE: '기능 요청',
SUPPORT: '기술 지원',
QA: 'QA 이슈',
VACATION: '휴가 신청',
EXPENSE: '비용 청구',
EQUIPMENT_REQUEST: '장비 요청',
GENERAL: '일반 문의',
};
const priorityColor: Record<string, string> = {
LOW: 'bg-gray-100 text-gray-600',
NORMAL: 'bg-status-open-bg text-status-open-text',
HIGH: 'bg-status-pending-bg text-status-pending-text',
CRITICAL: 'bg-status-critical-bg text-status-critical-text',
};
export default function IssueDetailPage({ params }: { params: Promise<{ id: string }> }) {
const resolvedParams = React.use(params);
const ticketId = parseInt(resolvedParams.id);
@@ -87,15 +105,36 @@ export default function IssueDetailPage({ params }: { params: Promise<{ id: stri
<div className="bg-surface rounded-2xl border border-border p-4 sm:p-6">
<h1 className="font-outfit text-xl font-semibold text-text-main mb-4">{ticket.title}</h1>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 text-sm mb-4">
<div><span className="text-text-muted text-xs">Project</span><p className="font-medium text-text-main">{ticket.projectName || '-'}</p></div>
<div><span className="text-text-muted text-xs">Category</span><p className="font-medium text-text-main">{ticket.category}</p></div>
<div><span className="text-text-muted text-xs">Priority</span><p className={`font-medium ${ticket.priority === 'CRITICAL' ? 'text-status-critical-text' : 'text-text-main'}`}>{ticket.priority}</p></div>
<div><span className="text-text-muted text-xs">Project</span><p className="font-medium text-text-main">{ticket.projectName || '해당 없음'}</p></div>
<div><span className="text-text-muted text-xs">Category</span><p className="font-medium text-text-main">{categoryLabel[ticket.category] || ticket.category}</p></div>
<div><span className="text-text-muted text-xs">Priority</span>
<span className={`inline-block text-xs font-semibold px-2.5 py-0.5 rounded-full ${priorityColor[ticket.priority] || 'bg-gray-100 text-gray-600'}`}>
{ticket.priority}
</span>
</div>
<div><span className="text-text-muted text-xs">Due</span><p className="font-medium text-text-main flex items-center">{ticket.dueDate ? <><Clock className="w-3.5 h-3.5 mr-1 text-status-critical-text" />{new Date(ticket.dueDate).toLocaleDateString('ko-KR')}</> : '-'}</p></div>
</div>
<div className="bg-gray-50 rounded-xl p-4">
<p className="text-xs text-text-muted mb-1">Description</p>
<p className="text-sm text-text-main whitespace-pre-wrap">{ticket.description}</p>
</div>
{ticket.category === 'VACATION' && (
<div className="bg-amber-50 border border-amber-200 rounded-xl px-4 py-3 text-sm">
<p className="font-semibold text-amber-800">휴가 신청</p>
<p className="text-amber-700 mt-1">세부 일정은 description을 확인하세요.</p>
</div>
)}
{ticket.category === 'EXPENSE' && (
<div className="bg-green-50 border border-green-200 rounded-xl px-4 py-3 text-sm">
<p className="font-semibold text-green-800">비용 청구</p>
</div>
)}
{ticket.category === 'EQUIPMENT_REQUEST' && (
<div className="bg-purple-50 border border-purple-200 rounded-xl px-4 py-3 text-sm">
<p className="font-semibold text-purple-800">장비 요청</p>
</div>
)}
</div>
<div className="bg-surface rounded-2xl border border-border p-4 sm:p-6">