Skip to content

Add a Presentations page to generate PDFs - #2316

Open
Remzi1993 wants to merge 10 commits into
alice-insights/devfrom
alice-insights/feature/40-presentation-page
Open

Remzi1993 wants to merge 10 commits into
alice-insights/devfrom
alice-insights/feature/40-presentation-page

Conversation

@Remzi1993

Copy link
Copy Markdown
Collaborator

ALICE Insights project. This pull request is part of the Amsterdam University of Applied Sciences student project for ALICE. It targets alice-insights/dev and implements school GitLab issue #40.

This branch builds on #2308 for the template list. The current GitHub diff includes that dependency while it is open. Review the seven commits for issue 40.

I DON'T have JIRA ticket

  • explain what this PR does
  • if it is a new feature, explain how you plan to use it
  • tests are added
  • documentation was updated or added

What this PR does

Adds a Presentations page to Bookkeeping’s navigation. A signed-in user chooses a template and a reporting period with Bookkeeping’s existing date picker, then generates a PDF.

How to try it

  1. Start Bookkeeping with the example templates from Add storage and read endpoints for presentation templates #2308 and start the ALICE Insights generation service with test data.
  2. Set ALICE_INSIGHTS_URL to the service origin reachable from the Bookkeeping backend.
  3. Open Presentations, select a template and period, and click Generate presentation. Click Download PDF when the file is ready.

Where to look

  • lib/public/views/Presentations/ contains the page and its state.
  • lib/server/controllers/presentations.controller.js handles the Bookkeeping route. lib/server/services/presentation/generatePresentation.js calls ALICE Insights.
  • The API and browser tests cover the request and download. The laptop navbar regression has its own test and fix commits.

Notable changes for users

  • The page shows a spinner and status message during generation and explains failures in place so the user can retry.

Notable changes for developers

  • POST /api/presentations validates the template and period, then forwards the signed-in user’s token and uses their name as the author.
  • Configuration and the HTTP API reference document the service URL, the PDF response, and the error statuses.
  • ESLint, Docker builds, and 46 focused tests passed. A browser run against the actual renderer downloaded a five-page PDF with test data. The broader suite was stopped after four filter test failures were reproduced on the starting branch.

Changes made to the database

kaymeer and others added 10 commits October 28, 2026 21:08
The templates table holds the name, title and description of a template.
The template_modules table holds its modules in presentation order, each
with a module type, an optional slide title and its options as JSON.
Deleting a template deletes its modules, and each position is used once
per template.

The seeder adds two example templates for the tests and for development.
GET /api/templates lists the templates sorted by title, without their
modules. GET /api/templates/:templateId returns one template with its
modules in presentation order, or a 404 naming the id. The endpoints
follow the layers of the run types endpoints.
openapi.yaml is written by hand, and API.md and index.html are generated
from it with npm run docs:api.
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.71004% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.24%. Comparing base (743fe7f) to head (a1d99f5).

Files with missing lines Patch % Lines
...blic/views/Presentations/PresentationsPageModel.js 0.00% 72 Missing ⚠️
...ib/public/views/Presentations/PresentationsPage.js 0.00% 19 Missing ⚠️
lib/public/Model.js 0.00% 5 Missing ⚠️
...e/migrations/v1/20261028100000-create-templates.js 62.50% 3 Missing ⚠️
...rver/services/presentation/generatePresentation.js 90.00% 3 Missing ⚠️
lib/server/controllers/templates.controller.js 94.73% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           alice-insights/dev    #2316      +/-   ##
======================================================
+ Coverage               46.00%   46.24%   +0.23%     
======================================================
  Files                    1070     1090      +20     
  Lines                   17610    17879     +269     
  Branches                 3261     3299      +38     
======================================================
+ Hits                     8102     8268     +166     
- Misses                   9508     9611     +103     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Remzi1993 Remzi1993 closed this Nov 23, 2026
@Remzi1993 Remzi1993 reopened this Nov 23, 2026
@Remzi1993
Remzi1993 requested review from graduta and kaymeer November 23, 2026 19:36
@Remzi1993 Remzi1993 self-assigned this Nov 23, 2026
@Remzi1993
Remzi1993 marked this pull request as ready for review November 23, 2026 19:37
Copilot AI balanced review requested due to automatic review settings November 23, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants