From 95984e67b8d57fbe1431fcfedf3bb682f28416b3 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Thu, 27 Nov 2025 17:48:28 +0900 Subject: (김준회) swp 영문 처리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/swp/table/swp-inbox-document-detail-dialog.tsx | 80 +++++++++++----------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'lib/swp/table/swp-inbox-document-detail-dialog.tsx') diff --git a/lib/swp/table/swp-inbox-document-detail-dialog.tsx b/lib/swp/table/swp-inbox-document-detail-dialog.tsx index ca7fcf1b..7f814267 100644 --- a/lib/swp/table/swp-inbox-document-detail-dialog.tsx +++ b/lib/swp/table/swp-inbox-document-detail-dialog.tsx @@ -35,7 +35,7 @@ interface SwpInboxDocumentDetailDialogProps { userId: string; } -// 리비전별 그룹 타입 +// Group type by revision interface RevisionGroup { revNo: string; stage: string; @@ -43,7 +43,7 @@ interface RevisionGroup { totalFiles: number; } -// Activity별 그룹 타입 (activity가 null일 수 있음) +// Group type by Activity (activity can be null) interface ActivityGroup { actvNo: string | null; files: SwpFileApiResponse[]; @@ -59,7 +59,7 @@ export function SwpInboxDocumentDetailDialog({ const [expandedActivities, setExpandedActivities] = useState>(new Set()); const [isAllExpanded, setIsAllExpanded] = useState(true); - // 파일들을 리비전 > Activity 구조로 그룹핑 + // Group files into Revision > Activity structure const revisionGroups = useMemo(() => { if (!document) return []; @@ -78,7 +78,7 @@ export function SwpInboxDocumentDetailDialog({ revMap.forEach((revFiles, revKey) => { const [revNo, stage] = revKey.split("|"); - // Activity별로 그룹핑 (null 가능) + // Group by Activity (nullable) const actMap = new Map(); revFiles.forEach((file) => { @@ -94,7 +94,7 @@ export function SwpInboxDocumentDetailDialog({ activities.push({ actvNo, files }); }); - // Activity가 없는 것을 먼저, 있는 것을 나중에 정렬 + // Sort: No Activity first, then with Activity activities.sort((a, b) => { if (a.actvNo === null && b.actvNo !== null) return -1; if (a.actvNo !== null && b.actvNo === null) return 1; @@ -110,11 +110,11 @@ export function SwpInboxDocumentDetailDialog({ }); }); - // 리비전 번호로 정렬 (최신이 위로) + // Sort by revision number (newest first) return result.sort((a, b) => b.revNo.localeCompare(a.revNo)); }, [document]); - // Dialog가 열릴 때 모두 펼치기 + // Expand all when dialog opens React.useEffect(() => { if (open && revisionGroups.length > 0) { const allRevKeys = new Set(); @@ -160,15 +160,15 @@ export function SwpInboxDocumentDetailDialog({ }); }; - // 일괄 열기/닫기 + // Toggle all const handleToggleAll = () => { if (isAllExpanded) { - // 모두 닫기 + // Collapse all setExpandedRevisions(new Set()); setExpandedActivities(new Set()); setIsAllExpanded(false); } else { - // 모두 열기 + // Expand all const allRevKeys = new Set(); const allActKeys = new Set(); @@ -191,27 +191,27 @@ export function SwpInboxDocumentDetailDialog({ const handleCancelFile = async (boxSeq: string, actvSeq: string, fileName: string) => { try { await cancelVendorFile(boxSeq, actvSeq); - toast.success(`파일 취소 완료: ${fileName}`); + toast.success(`File cancelled: ${fileName}`); - // Dialog를 닫고 부모 컴포넌트가 새로고침하도록 함 + // Close dialog and trigger parent refresh onOpenChange(false); } catch (error) { - console.error("파일 취소 실패:", error); - toast.error("파일 취소에 실패했습니다"); + console.error("Failed to cancel file:", error); + toast.error("Failed to cancel file"); } }; const handleDownloadFile = async (fileName: string, ownDocNo: string) => { try { - toast.info("파일 다운로드 중..."); + toast.info("Downloading file..."); const result = await downloadVendorFile(projNo, ownDocNo, fileName); if (!result.success || !result.data) { - toast.error(result.error || "파일 다운로드 실패"); + toast.error(result.error || "File download failed"); return; } - // Blob 생성 및 다운로드 + // Create Blob and download const blob = new Blob([Buffer.from(result.data)], { type: result.mimeType }); const url = URL.createObjectURL(blob); const link = window.document.createElement("a"); @@ -222,10 +222,10 @@ export function SwpInboxDocumentDetailDialog({ window.document.body.removeChild(link); URL.revokeObjectURL(url); - toast.success(`파일 다운로드 완료: ${fileName}`); + toast.success(`File downloaded: ${fileName}`); } catch (error) { - console.error("파일 다운로드 실패:", error); - toast.error("파일 다운로드에 실패했습니다"); + console.error("File download failed:", error); + toast.error("Failed to download file"); } }; @@ -233,7 +233,7 @@ export function SwpInboxDocumentDetailDialog({ - 업로드 파일 상세 + Uploaded File Details {document && ( {document.ownDocNo} @@ -243,30 +243,30 @@ export function SwpInboxDocumentDetailDialog({ {document && (
- {/* 문서 정보 */} + {/* Document Info */}
OWN_DOC_NO:
{document.ownDocNo}
- 최신 스테이지: + Latest Stage:
{document.latestStage || "-"}
- 최신 리비전: + Latest Revision:
{document.latestRevNo || "-"}
- 최신 REV 파일: -
{document.latestRevFileCount}개
+ Latest REV Files: +
{document.latestRevFileCount}
- {/* 리비전 및 액티비티 트리 */} + {/* Revision and Activity Tree */} {revisionGroups.length > 0 ? (
- {/* 일괄 열기/닫기 버튼 */} + {/* Toggle All Button */}
@@ -292,7 +292,7 @@ export function SwpInboxDocumentDetailDialog({ return (
- {/* 리비전 헤더 */} + {/* Revision Header */}
toggleRevision(revKey)} @@ -314,12 +314,12 @@ export function SwpInboxDocumentDetailDialog({ {revision.stage} - {revision.activities.length}개 그룹 / {revision.totalFiles}개 파일 + {revision.activities.length} Groups / {revision.totalFiles} Files
- {/* 액티비티 목록 (또는 Activity 없는 파일들) */} + {/* Activity List (or files without Activity) */} {isRevExpanded && (
{revision.activities.map((activity) => { @@ -328,7 +328,7 @@ export function SwpInboxDocumentDetailDialog({ return (
- {/* 액티비티 헤더 */} + {/* Activity Header */}
toggleActivity(actKey)} @@ -350,16 +350,16 @@ export function SwpInboxDocumentDetailDialog({ ) : ( - Activity 없음 + No Activity )} - {activity.files.length}개 파일 + {activity.files.length} Files
- {/* 파일 목록 */} + {/* File List */} {isActExpanded && (
{activity.files.map((file, idx) => ( @@ -398,7 +398,7 @@ export function SwpInboxDocumentDetailDialog({ onClick={() => handleCancelFile(file.BOX_SEQ!, file.ACTV_SEQ!, file.FILE_NM)} > - 취소 + Cancel )} {file.FLD_PATH && ( @@ -408,7 +408,7 @@ export function SwpInboxDocumentDetailDialog({ onClick={() => handleDownloadFile(file.FILE_NM, document.ownDocNo)} > - 다운로드 + Download )}
@@ -428,7 +428,7 @@ export function SwpInboxDocumentDetailDialog({ ) : (
-

파일 정보가 없습니다

+

No file information available

)}
-- cgit v1.2.3