Lesson plan: generate PDFs from activity markdowns, redesign cover page with HTML template, and open via blob in new tab#36
Conversation
- Add lesson-plan-cover.html template with LEARN-Hub branding - PDFService: inject MarkdownToHtmlService & MarkdownToPdfService - PDFService: replace iText programmatic cover page with HTML template - PDFService: generate activity PDFs from markdowns (deckblatt, artikulationsschema, hintergrundwissen); fallback to SOURCE_PDF - PDFService: getLessonPlanInfo checks for markdowns first - MarkdownToHtmlService: add getLogoDataUri() getter - PDFServiceTest: add mocks and 2 new tests for updated info logic Co-authored-by: milljoniaer <78978542+milljoniaer@users.noreply.github.com>
|
@copilot , so right now only the cover page of the lesson plan gets rendered, the concateneted merged pdfs are missing. also please dont download directly, but do it via this blob we also have in the activity download section |
Backend: - getActivityPdfs(): use request-map markdowns as primary source (frontend sends full activity objects incl. content + landscape), fall back to DB markdowns, then SOURCE_PDF - hasMarkdownsOrSourcePdf(): check request-map markdowns first - Lesson plan controller: disposition "attachment" → "inline" - New test: requestMapHasMarkdowns path Frontend: - LessonPlanModal: replace <a download> with window.open blob URL to match ActivityDetails.tsx blob-in-new-tab pattern; revoke URL after 10 s to avoid memory leaks Co-authored-by: milljoniaer <78978542+milljoniaer@users.noreply.github.com>
Fixed in commit Missing activity PDFs (root cause): Blob / open in new tab: Disposition: Lesson plan controller changed from Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Lesson plan PDFs were concatenating the raw uploaded
SOURCE_PDFdocuments instead of the LLM-generated markdown content, the cover/TOC page was built with bare iText API calls producing a plain unstyled layout, and the download forced a file save instead of opening in the browser.Cover page — HTML template
Replaces the programmatic iText summary page with a new
lesson-plan-cover.htmltemplate rendered viaHtmlConverter, matching the existing activity PDF design language (LEARN-Hub logo,#2f70b3blue headings, styled tables with alternating rows).Placeholders populated at render time:
{{logoDataUri}},{{downloadDate}},{{totalDuration}},{{activityCount}},{{activitiesTableRows}},{{searchCriteriaSection}},{{breaksSection}}.Activity PDFs — request-map markdowns first, with DB and SOURCE_PDF fallback
The frontend already sends full activity objects (including
markdowns[].contentandmarkdowns[].landscape) in the lesson plan request body.PDFService.getActivityPdfs()now uses these request-map markdowns as the primary source, rendering each section (Deckblatt → Artikulationsschema → Hintergrundwissen) viaMarkdownToPdfService. Falls back to DB markdowns if the request map is empty, then toSOURCE_PDFfor older activities.getLessonPlanInfo— checks request markdowns firstThe availability check now inspects inline markdown content in the request map first, before performing DB lookups, and returns
canGenerateLessonPlan = truefor any activity that has markdowns (in request or DB) or aSOURCE_PDF.Open in new tab via blob URL
LessonPlanModal.handleDownload()now useswindow.URL.createObjectURL(blob)+window.open(url, "_blank"), matching theopenBlobInNewTabpattern fromActivityDetails.tsx. The blob URL is revoked after 10 seconds to release memory. The lesson plan controller response disposition is changed fromattachmenttoinline.Other
MarkdownToHtmlService.getLogoDataUri()getter added so the cover page renderer can embed the logo without duplicating the loading logic.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.