260710_1
This commit is contained in:
@@ -380,12 +380,22 @@ function workflow(project: ProjectItem): HTMLElement {
|
||||
];
|
||||
const box = document.createElement("div");
|
||||
box.className = "b01-dashboard__workflow";
|
||||
|
||||
const stages = project.workflow_state?.stages;
|
||||
|
||||
routes.forEach((route, index) => {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = "b01-dashboard__step";
|
||||
button.textContent = `B${String(index + 3).padStart(2, "0")}`;
|
||||
const enabled = index + 1 <= Math.max(activeStage, 1);
|
||||
|
||||
let enabled = false;
|
||||
if (stages && stages.length > 0) {
|
||||
enabled = index === 0 || stages[index - 1]?.state === "COMPLETE";
|
||||
} else {
|
||||
enabled = index + 1 <= Math.max(activeStage, 1);
|
||||
}
|
||||
|
||||
button.disabled = !enabled;
|
||||
if (enabled) {
|
||||
button.classList.add("is-enabled");
|
||||
@@ -394,6 +404,23 @@ function workflow(project: ProjectItem): HTMLElement {
|
||||
navigateTo(route);
|
||||
});
|
||||
}
|
||||
|
||||
if (stages && stages[index]) {
|
||||
const state = stages[index].state;
|
||||
button.classList.add(`state-${state.toLowerCase()}`);
|
||||
if (state === "STALE") {
|
||||
button.title = "Stale (하위 단계 변경으로 무효화됨)";
|
||||
} else if (state === "FAILED") {
|
||||
button.title = "Failed (실패)";
|
||||
} else if (state === "COMPLETE") {
|
||||
button.title = "Complete (완료)";
|
||||
} else if (state === "IN_PROGRESS") {
|
||||
button.title = "In Progress (진행 중)";
|
||||
} else {
|
||||
button.title = "Not Started (미실행)";
|
||||
}
|
||||
}
|
||||
|
||||
box.append(button);
|
||||
});
|
||||
return box;
|
||||
|
||||
Reference in New Issue
Block a user