refactor(WEB): 프론트엔드 대규모 코드 정리 및 리팩토링
- 미사용 코드 삭제: ThemeContext, itemStore, utils/date.ts, utils/formatAmount.ts - 유틸리티 이동: date, formatAmount → src/lib/utils/ (중앙 집중화) - 다수 page.tsx 클라이언트 컴포넌트 패턴 통일 - DateRangeSelector 리팩토링 및 date-range-picker UI 컴포넌트 추가 - ThemeSelect/themeStore Zustand 직접 연동으로 전환 - 건설/회계/영업/품목/출하 등 전반적 컴포넌트 개선 - UniversalListPage, IntegratedListTemplateV2 타입 확장 - 프론트엔드 종합 리뷰 문서 및 개선 체크리스트 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import type { BendingDetail } from '@/types/item';
|
||||
import type { UseFormSetValue } from 'react-hook-form';
|
||||
import type { CreateItemFormData } from '@/lib/utils/validation';
|
||||
import { downloadFileById } from '@/lib/utils/fileDownload';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
export interface BendingDiagramSectionProps {
|
||||
selectedPartType: string;
|
||||
@@ -63,7 +64,7 @@ export default function BendingDiagramSection({
|
||||
// 기존 파일 다운로드 핸들러
|
||||
const handleDownloadExistingFile = async () => {
|
||||
if (!existingBendingDiagramFileId) {
|
||||
alert('파일 ID가 없습니다.');
|
||||
toast.error('파일 ID가 없습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +73,7 @@ export default function BendingDiagramSection({
|
||||
await downloadFileById(existingBendingDiagramFileId, fileName);
|
||||
} catch (error) {
|
||||
console.error('[BendingDiagramSection] 파일 다운로드 실패:', error);
|
||||
alert('파일 다운로드에 실패했습니다.');
|
||||
toast.error('파일 다운로드에 실패했습니다.');
|
||||
}
|
||||
};
|
||||
// 폭 합계 업데이트 헬퍼
|
||||
|
||||
@@ -33,6 +33,7 @@ import BendingDiagramSection from './BendingDiagramSection';
|
||||
import BOMSection from './BOMSection';
|
||||
import { MaterialForm, ProductForm, ProductCertificationSection, PartForm } from './forms';
|
||||
import { useItemFormState } from './hooks';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
export default function ItemForm({ mode, initialData, onSubmit }: ItemFormProps) {
|
||||
const router = useRouter();
|
||||
@@ -177,7 +178,7 @@ export default function ItemForm({ mode, initialData, onSubmit }: ItemFormProps)
|
||||
router.push('/production/screen-production');
|
||||
router.refresh();
|
||||
} catch {
|
||||
alert('품목 저장에 실패했습니다.');
|
||||
toast.error('품목 저장에 실패했습니다.');
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user