summaryrefslogtreecommitdiff
path: root/lib/rfqs/vendor-table
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
commitef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch)
tree345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/rfqs/vendor-table
parent9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff)
~20250428 작업사항
Diffstat (limited to 'lib/rfqs/vendor-table')
-rw-r--r--lib/rfqs/vendor-table/comments-sheet.tsx10
-rw-r--r--lib/rfqs/vendor-table/vendor-list/vendor-list-table.tsx2
-rw-r--r--lib/rfqs/vendor-table/vendors-table-toolbar-actions.tsx12
-rw-r--r--lib/rfqs/vendor-table/vendors-table.tsx16
4 files changed, 18 insertions, 22 deletions
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<MatchedVendorComment[]>(initialComments)
const [isPending, startTransition] = React.useTransition()
@@ -138,7 +136,7 @@ export function CommentSheet({
</TableRow>
</TableHeader>
<TableBody>
- {comments.map((c) => (
+ {comments.map((c) => (
<TableRow key={c.id}>
<TableCell>{c.commentText}</TableCell>
<TableCell>
@@ -150,7 +148,7 @@ export function CommentSheet({
{c.attachments.map((att) => (
<div key={att.id} className="flex items-center gap-2">
<a
- href={`/api/rfq-download?path=${encodeURIComponent(att.filePath)}`}
+ href={`/api/rfq-download?path=${encodeURIComponent(att.filePath)}`}
download
target="_blank"
rel="noreferrer"
@@ -164,7 +162,7 @@ export function CommentSheet({
</div>
)}
</TableCell>
- <TableCell> { c.createdAt ? formatDate(c.createdAt): "-"}</TableCell>
+ <TableCell> {c.createdAt ? formatDate(c.createdAt) : "-"}</TableCell>
<TableCell>{c.commentedByEmail ?? "-"}</TableCell>
</TableRow>
))}
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="선택된 협력업체 중 초대 가능한 협력업체가 없습니다"
>
초대 불가
</Button>
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 (
- <div style={{ maxWidth: '80vw' }}>
+ <>
<DataTable
table={table}
>
@@ -205,6 +203,6 @@ export function MatchedVendorsTable({ promises, rfqId, rfqType }: VendorsTablePr
rowAction.row.original.comments = updatedComments
}}
/>
- </div>
+ </>
)
} \ No newline at end of file