fix: [receiving] 입고 등록 초기값 설정 및 UX 개선
- 작성자 필드에 세션 사용자 이름 기본값 설정 - 입고일 필드에 오늘 날짜 기본값 설정 - 등록 완료 후 목록 대신 생성된 입고 상세 페이지로 바로 이동 - 수입검사 저장 시 rendered_html 크기 제한 (500KB 초과 시 제외, 413 방지) - Dialog 접근성 경고 수정 (DialogDescription 추가)
This commit is contained in:
@@ -18,6 +18,8 @@ import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
VisuallyHidden,
|
||||
DialogDescription,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -668,7 +670,13 @@ export function ImportInspectionInputModal({
|
||||
// 캡처 실패 시 무시 — rendered_html 없이 저장 진행
|
||||
}
|
||||
|
||||
// 5. 저장 API 호출
|
||||
// 5. 저장 API 호출 (rendered_html이 너무 크면 제외 — 413 방지)
|
||||
const MAX_HTML_SIZE = 500 * 1024; // 500KB 제한
|
||||
const safeHtml = renderedHtml && renderedHtml.length <= MAX_HTML_SIZE ? renderedHtml : undefined;
|
||||
if (renderedHtml && renderedHtml.length > MAX_HTML_SIZE) {
|
||||
console.warn(`[ImportInspection] rendered_html 크기 초과 (${(renderedHtml.length / 1024).toFixed(0)}KB), 제외하고 저장합니다.`);
|
||||
}
|
||||
|
||||
const result = await saveInspectionData({
|
||||
templateId: parseInt(template.templateId),
|
||||
itemId,
|
||||
@@ -677,7 +685,7 @@ export function ImportInspectionInputModal({
|
||||
attachments,
|
||||
receivingId,
|
||||
inspectionResult: overallResult,
|
||||
rendered_html: renderedHtml,
|
||||
rendered_html: safeHtml,
|
||||
});
|
||||
|
||||
if (result.success) {
|
||||
@@ -755,6 +763,7 @@ export function ImportInspectionInputModal({
|
||||
<DialogContent className="w-[95vw] max-w-[500px] sm:max-w-[500px] max-h-[90vh] flex flex-col p-0">
|
||||
<DialogHeader className="px-6 pt-6 pb-0 shrink-0">
|
||||
<DialogTitle className="text-lg font-bold">수입검사</DialogTitle>
|
||||
<VisuallyHidden><DialogDescription>수입검사 항목 입력</DialogDescription></VisuallyHidden>
|
||||
</DialogHeader>
|
||||
|
||||
{isLoadingTemplate ? (
|
||||
|
||||
Reference in New Issue
Block a user