From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 28 Apr 2025 02:13:30 +0000 Subject: ~20250428 작업사항 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfqs/vendor-table/comments-sheet.tsx | 10 ++++------ lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx | 2 +- lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx | 12 ++++++------ lib/rfqs/vendor-table/vendors-table.tsx | 16 +++++++--------- 4 files changed, 18 insertions(+), 22 deletions(-) (limited to 'lib/rfqs/vendor-table') diff --git a/lib/rfqs/vendor-table/comments-sheet.tsx b/lib/rfqs/vendor-table/comments-sheet.tsx index 3a2a9353..441fdcf1 100644 --- a/lib/rfqs/vendor-table/comments-sheet.tsx +++ b/lib/rfqs/vendor-table/comments-sheet.tsx @@ -53,7 +53,7 @@ export interface MatchedVendorComment { commentText: string commentedBy?: number commentedByEmail?: string - createdAt?: Date + createdAt?: Date attachments?: { id: number fileName: string @@ -90,8 +90,6 @@ export function CommentSheet({ ...props }: CommentSheetProps) { - console.log(initialComments) - const [comments, setComments] = React.useState(initialComments) const [isPending, startTransition] = React.useTransition() @@ -138,7 +136,7 @@ export function CommentSheet({ - {comments.map((c) => ( + {comments.map((c) => ( {c.commentText} @@ -150,7 +148,7 @@ export function CommentSheet({ {c.attachments.map((att) => (
)} - { c.createdAt ? formatDate(c.createdAt): "-"} + {c.createdAt ? formatDate(c.createdAt) : "-"} {c.commentedByEmail ?? "-"} ))} diff --git a/lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx b/lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx index c436eebd..e34a5052 100644 --- a/lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx +++ b/lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx @@ -52,7 +52,7 @@ export function VendorsListTable({ rfqId }: VendorsListTableProps) { const allVendors = await getAllVendors() setVendors(allVendors) } catch (error) { - console.error("벤더 목록 로드 오류:", error) + console.error("협력업체 목록 로드 오류:", error) toast({ title: "Error", description: "Failed to load vendors", diff --git a/lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx b/lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx index abb34f85..864d0f4b 100644 --- a/lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx +++ b/lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx @@ -21,14 +21,14 @@ export function VendorsTableToolbarActions({ table, rfqId }: VendorsTableToolbar // 선택된 모든 행 const selectedRows = table.getFilteredSelectedRowModel().rows - // 조건에 맞는 벤더만 필터링 + // 조건에 맞는 협력업체만 필터링 const eligibleVendors = React.useMemo(() => { return selectedRows .map(row => row.original) .filter(vendor => !vendor.rfqVendorStatus || vendor.rfqVendorStatus === "INVITED") }, [selectedRows]) - // 조건에 맞지 않는 벤더 수 + // 조건에 맞지 않는 협력업체 수 const ineligibleCount = selectedRows.length - eligibleVendors.length function handleImportClick() { @@ -36,17 +36,17 @@ export function VendorsTableToolbarActions({ table, rfqId }: VendorsTableToolbar } function handleInviteClick() { - // 조건에 맞지 않는 벤더가 있다면 토스트 메시지 표시 + // 조건에 맞지 않는 협력업체가 있다면 토스트 메시지 표시 if (ineligibleCount > 0) { toast({ - title: "일부 벤더만 초대됩니다", + title: "일부 협력업체만 초대됩니다", description: `선택한 ${selectedRows.length}개 중 ${eligibleVendors.length}개만 초대 가능합니다. 나머지 ${ineligibleCount}개는 초대 불가능한 상태입니다.`, // variant: "warning", }) } } - // 다이얼로그 표시 여부 - 적합한 벤더가 1개 이상 있으면 표시 + // 다이얼로그 표시 여부 - 적합한 협력업체가 1개 이상 있으면 표시 const showInviteDialog = eligibleVendors.length > 0 return ( @@ -70,7 +70,7 @@ export function VendorsTableToolbarActions({ table, rfqId }: VendorsTableToolbar variant="default" size="sm" disabled={true} - title="선택된 벤더 중 초대 가능한 벤더가 없습니다" + title="선택된 협력업체 중 초대 가능한 협력업체가 없습니다" > 초대 불가 diff --git a/lib/rfqs/vendor-table/vendors-table.tsx b/lib/rfqs/vendor-table/vendors-table.tsx index ae9cba41..b2e4d5ad 100644 --- a/lib/rfqs/vendor-table/vendors-table.tsx +++ b/lib/rfqs/vendor-table/vendors-table.tsx @@ -74,17 +74,17 @@ export function MatchedVendorsTable({ promises, rfqId, rfqType }: VendorsTablePr async function openCommentSheet(vendorId: number) { // Clear previous comments setInitialComments([]) - + // Start loading setIsLoadingComments(true) - + // Open the sheet immediately with loading state setSelectedVendorIdForComments(vendorId) setCommentSheetOpen(true) - + // (a) 현재 Row의 comments 불러옴 const comments = rowAction?.row.original.comments - + try { if (comments && comments.length > 0) { // (b) 각 comment마다 첨부파일 fetch @@ -107,7 +107,7 @@ export function MatchedVendorsTable({ promises, rfqId, rfqType }: VendorsTablePr setIsLoadingComments(false) } } - + // 6) 컬럼 정의 (memo) const columns = React.useMemo( () => getColumns({ setRowAction, router, openCommentSheet }), @@ -164,10 +164,8 @@ export function MatchedVendorsTable({ promises, rfqId, rfqType }: VendorsTablePr // 세션에서 userId 추출하고 숫자로 변환 const currentUserId = session?.user?.id ? parseInt(session.user.id, 10) : 0 - console.log(currentUserId,"currentUserId") - return ( -
+ <> @@ -205,6 +203,6 @@ export function MatchedVendorsTable({ promises, rfqId, rfqType }: VendorsTablePr rowAction.row.original.comments = updatedComments }} /> -
+ ) } \ No newline at end of file -- cgit v1.2.3