260710_1
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* 텍스트는 ui_template_locale에 선(先) 등록 후 참조 (frontend.md §3).
|
||||
* ========================================================================== */
|
||||
|
||||
import { CURRENT_PROJECT_ID_KEY } from "@config/config_frontend";
|
||||
import { CURRENT_PROJECT_ID_KEY, ROUTES, type RoutePath } from "@config/config_frontend";
|
||||
import { currentLanguageIndex, ui_locales } from "@ui/ui_template_locale";
|
||||
import {
|
||||
createButton,
|
||||
@@ -22,8 +22,9 @@ import {
|
||||
showToast,
|
||||
type InputFieldHandle,
|
||||
} from "@ui/ui_template_elements";
|
||||
import { createWorkflowLayout } from "@ui/ui_template_workflow_layout";
|
||||
import { createWorkflowLayout, type WorkflowStage } from "@ui/ui_template_workflow_layout";
|
||||
import { workflowSteps } from "../A00_Common/b_page_scaffold";
|
||||
import { navigateTo } from "../A00_Common/router";
|
||||
import {
|
||||
confirmRoute,
|
||||
solveRoute,
|
||||
@@ -318,12 +319,44 @@ export function renderB05Route(root: HTMLElement): void {
|
||||
}
|
||||
|
||||
renderEmptyResult();
|
||||
|
||||
const workflowRoutes = [
|
||||
ROUTES.B03_FILE_INPUT,
|
||||
ROUTES.B04_WF1_SURFACE,
|
||||
ROUTES.B05_WF2_ROUTE,
|
||||
ROUTES.B06_WF3_PROFILE_CROSS,
|
||||
ROUTES.B07_WF4_DESIGN_DETAIL,
|
||||
ROUTES.B08_WF5_QUANTITY,
|
||||
ROUTES.B09_WF6_ESTIMATION,
|
||||
];
|
||||
|
||||
let workflowStages: WorkflowStage[] = [];
|
||||
const projectId = localStorage.getItem(CURRENT_PROJECT_ID_KEY);
|
||||
if (projectId) {
|
||||
fetch(`/api/projects/${projectId}/workflow-state`)
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
workflowStages = data.stages || [];
|
||||
})
|
||||
.catch(() => {
|
||||
/* silently fail */
|
||||
});
|
||||
}
|
||||
|
||||
const layout = createWorkflowLayout({
|
||||
title: L("B05_Route_Title"),
|
||||
steps: workflowSteps(),
|
||||
activeStep: 2,
|
||||
leftPanel: leftForm,
|
||||
mainContent: resultCard,
|
||||
stages: workflowStages,
|
||||
routes: workflowRoutes,
|
||||
onStepClick: (_stepIndex, route) => {
|
||||
if (projectId) {
|
||||
localStorage.setItem(CURRENT_PROJECT_ID_KEY, projectId);
|
||||
navigateTo(route as RoutePath);
|
||||
}
|
||||
},
|
||||
});
|
||||
root.replaceChildren(layout.root);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user