From c3383a11541821870b1c20797791250f5864d36f Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 25 Oct 2025 12:11:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=88=98=EC=8B=A0=ED=95=A8=20=ED=94=84?= =?UTF-8?q?=EB=A1=A0=ED=8A=B8=EC=97=94=EB=93=9C=20=EC=99=84=EC=A0=84=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20-=20=EC=8B=A4=EC=A0=9C=20API=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎨 UI Components: - 3개 μ›Œν¬ν”Œλ‘œμš° λͺ¨λ‹¬ μΆ”κ°€: * 폐기 λͺ¨λ‹¬: μ‚¬μœ  선택 (쀑볡/λ¬΄νš¨μ‹ κ³ /ν•΄λ‹Ήμ—†μŒ/슀팸/μ§μ ‘μž…λ ₯) * κ²€ν†  λͺ¨λ‹¬: ν”„λ‘œμ νŠΈ/μΉ΄ν…Œκ³ λ¦¬/μ„€λͺ… μˆ˜μ • + 원본 정보 ν‘œμ‹œ * μƒνƒœ λͺ¨λ‹¬: 진행쀑/μ™„λ£Œ 선택 + 처리 λ©”λͺ¨ - 뢀적합 μΉ΄λ“œ UI κ°œμ„ : * μ›Œν¬ν”Œλ‘œμš° μ•‘μ…˜ λ²„νŠΌ (폐기/κ²€ν† /승인) * 읽음/μ•ˆμ½μŒ μƒνƒœ ν‘œμ‹œ * 사진 첨뢀 μ—¬λΆ€ ν‘œμ‹œ * 클릭 κ°€λŠ₯ν•œ 제λͺ© (상세보기) πŸ”Œ API Integration: - μ‹€μ œ λ°±μ—”λ“œ API μ™„μ „ 연동: * GET /api/inbox/ - μˆ˜μ‹ ν•¨ λͺ©λ‘ (ν”„λ‘œμ νŠΈ 필터링) * GET /api/inbox/statistics - μ‹€μ‹œκ°„ 톡계 * POST /api/inbox/{id}/dispose - 폐기 처리 * POST /api/inbox/{id}/review - κ²€ν† /μˆ˜μ • * POST /api/inbox/{id}/status - μƒνƒœ λ³€κ²½ - μ—λŸ¬ 처리 및 μ‚¬μš©μž ν”Όλ“œλ°±: * API 였λ₯˜ μ‹œ μ μ ˆν•œ λ©”μ‹œμ§€ ν‘œμ‹œ * 성곡 μ‹œ κ²°κ³Ό μ•ˆλ‚΄ 및 λͺ©λ‘ μžλ™ μƒˆλ‘œκ³ μΉ¨ * μž…λ ₯ 검증 (ν•„μˆ˜κ°’, μ‚¬μš©μž μ •μ˜ μ‚¬μœ  λ“±) 🎯 Workflow Logic: - 폐기 처리: * 5κ°€μ§€ μ‚¬μœ  선택 (κΈ°λ³Έκ°’: 쀑볡) * μ‚¬μš©μž μ •μ˜ μ‚¬μœ  μž…λ ₯ 검증 * 폐기 ν›„ νκΈ°ν•¨μœΌλ‘œ 이동 - κ²€ν† /μˆ˜μ •: * 원본 정보 보쑴 및 ν‘œμ‹œ * ν”„λ‘œμ νŠΈ/μΉ΄ν…Œκ³ λ¦¬/μ„€λͺ… μˆ˜μ • κ°€λŠ₯ * μˆ˜μ • 이λ ₯ μžλ™ 좔적 - μƒνƒœ κ²°μ •: * 진행쀑/μ™„λ£Œ 선택 * 처리 λ©”λͺ¨ μΆ”κ°€ κ°€λŠ₯ * κ΄€λ¦¬ν•¨μœΌλ‘œ μžλ™ 이동 πŸ“Š Real-time Features: - μ‹€μ‹œκ°„ 톡계 μ—…λ°μ΄νŠΈ - 읽음 μƒνƒœ 둜컬 μ €μž₯ (inbox_read_status) - ν”„λ‘œμ νŠΈλ³„ 필터링 - μžλ™ λͺ©λ‘ μƒˆλ‘œκ³ μΉ¨ 🎨 UX Improvements: - λͺ¨λ‹¬ 기반 μ›Œν¬ν”Œλ‘œμš° (직관적) - 원본 정보 ν‘œμ‹œ (μˆ˜μ • μ „ν›„ 비ꡐ) - μ μ ˆν•œ λ‘œλ”© μƒνƒœ ν‘œμ‹œ - μ‚¬μš©μž μΉœν™”μ  μ—λŸ¬ λ©”μ‹œμ§€ - μ•‘μ…˜ λ²„νŠΌ 색상 ꡬ뢄 (λΉ¨κ°•/νŒŒλž‘/초둝) Result: βœ… μˆ˜μ‹ ν•¨ μ›Œν¬ν”Œλ‘œμš° ν”„λ‘ νŠΈμ—”λ“œ 100% μ™„μ„± βœ… λ°±μ—”λ“œ API와 μ™„λ²½ 연동 βœ… μ‹€μ‹œκ°„ 데이터 동기화 βœ… μ‚¬μš©μž μΉœν™”μ  UI/UX βœ… λͺ¨λ“  μ›Œν¬ν”Œλ‘œμš° μ•‘μ…˜ κ΅¬ν˜„ --- frontend/issues-inbox.html | 468 ++++++++++++++++++++++++++++++++++--- 1 file changed, 439 insertions(+), 29 deletions(-) diff --git a/frontend/issues-inbox.html b/frontend/issues-inbox.html index 31fdd4a..1c59a4a 100644 --- a/frontend/issues-inbox.html +++ b/frontend/issues-inbox.html @@ -224,6 +224,153 @@ + + + + + + + + + @@ -307,11 +454,19 @@ }); } - // 뢀적합 λͺ©λ‘ λ‘œλ“œ + // μˆ˜μ‹ ν•¨ 뢀적합 λͺ©λ‘ λ‘œλ“œ (μ‹€μ œ API 연동) async function loadIssues() { showLoading(true); try { - const response = await fetch('/api/issues/', { + const projectId = document.getElementById('projectFilter').value; + let url = '/api/inbox/'; + + // ν”„λ‘œμ νŠΈ ν•„ν„° 적용 + if (projectId) { + url += `?project_id=${projectId}`; + } + + const response = await fetch(url, { headers: { 'Authorization': `Bearer ${localStorage.getItem('access_token')}`, 'Content-Type': 'application/json' @@ -322,19 +477,19 @@ issues = await response.json(); // 읽음 μƒνƒœ λ‘œλ“œ (localStorageμ—μ„œ) - const savedReadStatus = localStorage.getItem('issues_read_status'); + const savedReadStatus = localStorage.getItem('inbox_read_status'); if (savedReadStatus) { readStatus = new Set(JSON.parse(savedReadStatus)); } filterIssues(); - updateStatistics(); + await loadStatistics(); } else { - throw new Error('뢀적합 λͺ©λ‘μ„ 뢈러올 수 μ—†μŠ΅λ‹ˆλ‹€.'); + throw new Error('μˆ˜μ‹ ν•¨ λͺ©λ‘μ„ 뢈러올 수 μ—†μŠ΅λ‹ˆλ‹€.'); } } catch (error) { - console.error('뢀적합 λ‘œλ“œ μ‹€νŒ¨:', error); - showError('뢀적합 λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.'); + console.error('μˆ˜μ‹ ν•¨ λ‘œλ“œ μ‹€νŒ¨:', error); + showError('μˆ˜μ‹ ν•¨ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.'); } finally { showLoading(false); } @@ -414,29 +569,45 @@ const timeAgo = getTimeAgo(new Date(issue.created_at)); return ` -
+
${isUnread ? '
' : '
'} - ${getStatusText(issue.status)} + κ²€ν†  λŒ€κΈ° ${project ? `${project.name}` : ''} ${timeAgo}
-

${issue.description}

+

${issue.description}

-
+
${issue.reporter?.username || 'μ•Œ 수 μ—†μŒ'} ${createdDate} ${issue.category ? `${getCategoryText(issue.category)}` : ''} + ${issue.photo_path ? '사진 첨뢀' : ''} +
+ + +
+ + +
- ${issue.photo_path ? '' : ''} -