refactor: [Phase 0] 공통→테넌트 모듈 의존성 해소
- InspectionReportModal/WorkLogModal/AssigneeSelectModal → document-system/modals/ dynamic import 래퍼 - ProductionOrders 타입/액션 → lib/api/production-orders/ 공유 영역 분리 - 결재(ApprovalBox), 품질(QMS), 영업(production-orders) import 경로 수정 - 하드코딩 경로 /production/work-orders → 영업 내부 경로로 변경 - dashboard-invalidation DomainKey 하드코딩 → registerDashboardDomain() 동적 레지스트리 공통 ERP에서 테넌트(생산) 직접 import 0건 달성 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ import {
|
||||
} from './types';
|
||||
import { isNextRedirectError } from '@/lib/utils/redirect-error';
|
||||
import { usePermission } from '@/hooks/usePermission';
|
||||
import { InspectionReportModal } from '@/components/production/WorkOrders/documents/InspectionReportModal';
|
||||
import { InspectionReportModal } from '@/components/document-system/modals';
|
||||
|
||||
export function ApprovalBox() {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
/**
|
||||
* AssigneeSelectModal — 공유 래퍼
|
||||
*
|
||||
* 원본: @/components/production/WorkOrders/AssigneeSelectModal
|
||||
* 목적: 공통 ERP(영업)에서 생산 모듈을 직접 import하지 않도록
|
||||
* dynamic import로 정적 의존성 체인을 끊음
|
||||
*/
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { Loader2 } from 'lucide-react';
|
||||
|
||||
const AssigneeSelectModalImpl = dynamic(
|
||||
() =>
|
||||
import('@/components/production/WorkOrders/AssigneeSelectModal').then(
|
||||
(mod) => mod.AssigneeSelectModal,
|
||||
),
|
||||
{
|
||||
loading: () => (
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
),
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
|
||||
export { AssigneeSelectModalImpl as AssigneeSelectModal };
|
||||
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
/**
|
||||
* InspectionReportModal — 공유 래퍼
|
||||
*
|
||||
* 원본: @/components/production/WorkOrders/documents/InspectionReportModal
|
||||
* 목적: 공통 ERP(결재, 품질)에서 생산 모듈을 직접 import하지 않도록
|
||||
* dynamic import로 정적 의존성 체인을 끊음
|
||||
*/
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { Loader2 } from 'lucide-react';
|
||||
|
||||
const InspectionReportModalImpl = dynamic(
|
||||
() =>
|
||||
import('@/components/production/WorkOrders/documents/InspectionReportModal').then(
|
||||
(mod) => mod.InspectionReportModal,
|
||||
),
|
||||
{
|
||||
loading: () => (
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
),
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
|
||||
export { InspectionReportModalImpl as InspectionReportModal };
|
||||
29
src/components/document-system/modals/WorkLogModal.tsx
Normal file
29
src/components/document-system/modals/WorkLogModal.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
/**
|
||||
* WorkLogModal — 공유 래퍼
|
||||
*
|
||||
* 원본: @/components/production/WorkOrders/documents/WorkLogModal
|
||||
* 목적: 공통 ERP(품질 QMS)에서 생산 모듈을 직접 import하지 않도록
|
||||
* dynamic import로 정적 의존성 체인을 끊음
|
||||
*/
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { Loader2 } from 'lucide-react';
|
||||
|
||||
const WorkLogModalImpl = dynamic(
|
||||
() =>
|
||||
import('@/components/production/WorkOrders/documents/WorkLogModal').then(
|
||||
(mod) => mod.WorkLogModal,
|
||||
),
|
||||
{
|
||||
loading: () => (
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
),
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
|
||||
export { WorkLogModalImpl as WorkLogModal };
|
||||
9
src/components/document-system/modals/index.ts
Normal file
9
src/components/document-system/modals/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* document-system/modals — 모듈 경계를 넘는 공유 모달 래퍼
|
||||
*
|
||||
* 공통 ERP 코드에서 테넌트 전용 모달을 사용할 때
|
||||
* 직접 import 대신 이 래퍼를 통해 dynamic import로 접근
|
||||
*/
|
||||
export { InspectionReportModal } from './InspectionReportModal';
|
||||
export { WorkLogModal } from './WorkLogModal';
|
||||
export { AssigneeSelectModal } from './AssigneeSelectModal';
|
||||
Reference in New Issue
Block a user