From 355ca96467d7342d0816ba4f1f49ed9d3f1e5544 Mon Sep 17 00:00:00 2001 From: RSaarivuoriLUT <167883444+RSaarivuoriLUT@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:29:01 +0200 Subject: [PATCH] Fix project work export wrong headers --- package.json | 2 +- resource/texts.json | 12 ------------ src/mainHelpers/html.ts | 26 +++++++++----------------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 96047c8..f0df011 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "procasma", "productName": "Procasma", - "version": "1.7.13", + "version": "1.7.14", "description": "Dynamic Assignment Manager", "main": ".vite/build/main.js", "scripts": { diff --git a/resource/texts.json b/resource/texts.json index 0e3cd19..e84f49a 100644 --- a/resource/texts.json +++ b/resource/texts.json @@ -23,18 +23,6 @@ "FI": "Harjoitustyön tehtävänanto", "ENG": "Final work description" }, - "project_minimum_level_assignment_description": { - "FI": "Harjoitustyön minimitason tehtävänanto", - "ENG": "Basic level final work description" - }, - "project_basic_level_assignment_description": { - "FI": "Harjoitustyön perustason tehtävänanto", - "ENG": "Basic level final work description" - }, - "project_target_level_assignment_description": { - "FI": "Harjoitustyön tavoitetason tehtävänanto", - "ENG": "Target level final work description" - }, "assignment_description": { "FI": "Tehtävänanto", "ENG": "Assignment" diff --git a/src/mainHelpers/html.ts b/src/mainHelpers/html.ts index 6c5b4e9..824ef1f 100644 --- a/src/mainHelpers/html.ts +++ b/src/mainHelpers/html.ts @@ -358,7 +358,9 @@ export async function exportProjectFS( let moduleString = ""; const css = papercolorLight; - const mainHeader = formatMainHeaderProject(levelID); + const mainHeader = formatMainHeaderProject( + projectInput.variations[levelID].levelName + ); if (splitLevels || html.length === 0) { // HTML Base @@ -440,6 +442,7 @@ export async function exportProjectFS( log.info("HTML created."); const inlineHTML = juice(html); const inlineSolutionHTML = juice(solutionHtml); + log.debug(projectInput.format); await saveSetModuleFS( inlineHTML, @@ -810,22 +813,10 @@ function formatMainHeader(module: number, moduleType: SupportedModuleType) { */ function formatMainHeaderProject(level: string) { let title = ``; - const addToTitle = (ui_code: string) => { - title += parseUICodeMain(ui_code); - }; - switch (level) { - case "1": - addToTitle("project_minimum_level_assignment_description"); - break; - case "2": - addToTitle("project_basic_level_assignment_description"); - break; - case "3": - addToTitle("project_target_level_assignment_description"); - break; - default: - addToTitle("project_assignment_description"); - break; + title += parseUICodeMain("project_assignment_description"); + if (level !== "") { + title += " - "; + title += level; } return title; } @@ -1140,6 +1131,7 @@ function generateToCProject(html: string): string { block += `

${anchorIdAndText.text}`; block += `

`; }); + block += `
`; return block; } catch (err) {