fix: show comprehensive training in student navigation

dev-QQq
chenyuan 3 weeks ago
parent 3b44d0174b
commit 98a7bfe620

@ -47,6 +47,18 @@ export function buildStudentTaskSections(tasks = []) {
path: taskPath(task.taskKey),
});
});
const comprehensiveTask = tasks.find((task) => task?.taskKey === COMPREHENSIVE_TASK_KEY);
if (comprehensiveTask) {
sections.set("综合实训", {
title: "综合实训",
children: [
{
title: comprehensiveTask.taskName || "综合案例实训",
path: "/comprehensive/index",
},
],
});
}
return [...sections.values()];
}

@ -17,6 +17,20 @@ assert.deepEqual(sections, [
},
]);
assert.deepEqual(buildStudentTaskSections([
{
taskKey: "comprehensive-case-training",
taskName: "综合案例实训",
projectName: "综合实训",
sort: 99,
},
]), [
{
title: "综合实训",
children: [{ title: "综合案例实训", path: "/comprehensive/index" }],
},
]);
assert.deepEqual(getComprehensiveTopTask([{ taskKey: "comprehensive-case-training", taskName: "综合实训" }]), {
title: "综合实训",
path: "/comprehensive/index",

Loading…
Cancel
Save