기타 수정사항 적용

This commit is contained in:
hyeonsu
2025-09-11 10:45:16 +09:00
parent fe6c0af5a8
commit 8e64b338a1
4 changed files with 36 additions and 82 deletions

View File

@@ -15,7 +15,6 @@ export default function DataFlowPage() {
const { user } = useAuth();
const router = useRouter();
const [currentStep, setCurrentStep] = useState<Step>("list");
const [selectedDiagram, setSelectedDiagram] = useState<DataFlowDiagram | null>(null);
const [stepHistory, setStepHistory] = useState<Step[]>(["list"]);
// 단계별 제목과 설명
@@ -26,10 +25,8 @@ export default function DataFlowPage() {
icon: "📊",
},
design: {
title: selectedDiagram ? `${selectedDiagram.diagramName} 관계도 설계` : "새 관계도 설계",
description: selectedDiagram
? "기존 관계도를 수정하거나 새로운 관계를 추가하세요"
: "테이블 간 데이터 관계를 시각적으로 설계하세요",
title: "새 관계도 설계",
description: "테이블 간 데이터 관계를 시각적으로 설계하세요",
icon: "🎨",
},
};
@@ -47,11 +44,6 @@ export default function DataFlowPage() {
const previousStep = newHistory[newHistory.length - 1];
setStepHistory(newHistory);
setCurrentStep(previousStep);
// list로 돌아갈 때 선택된 관계도 초기화
if (previousStep === "list") {
setSelectedDiagram(null);
}
}
};
@@ -63,11 +55,6 @@ export default function DataFlowPage() {
if (stepIndex !== -1) {
setStepHistory(stepHistory.slice(0, stepIndex + 1));
}
// list로 이동할 때 선택된 관계도 초기화
if (step === "list") {
setSelectedDiagram(null);
}
};
const handleSave = (relationships: TableRelationship[]) => {
@@ -78,17 +65,12 @@ export default function DataFlowPage() {
}, 0);
};
const handleDiagramSelect = (diagram: DataFlowDiagram) => {
setSelectedDiagram(diagram);
};
const handleDesignDiagram = (diagram: DataFlowDiagram | null) => {
if (diagram) {
// 기존 관계도 편집 - 새로운 URL로 이동
router.push(`/admin/dataflow/edit/${diagram.diagramId}`);
} else {
// 새 관계도 생성 - 현재 페이지에서 처리
setSelectedDiagram(null);
goToNextStep("design");
}
};
@@ -121,11 +103,7 @@ export default function DataFlowPage() {
{/* 관계도 목록 단계 */}
{currentStep === "list" && (
<div className="h-full p-6">
<DataFlowList
onDiagramSelect={handleDiagramSelect}
selectedDiagram={selectedDiagram}
onDesignDiagram={handleDesignDiagram}
/>
<DataFlowList onDesignDiagram={handleDesignDiagram} />
</div>
)}
@@ -135,7 +113,7 @@ export default function DataFlowPage() {
<DataFlowDesigner
companyCode={user?.company_code || "COMP001"}
onSave={handleSave}
selectedDiagram={selectedDiagram}
selectedDiagram={null}
onBackToList={() => goToStep("list")}
/>
</div>