Skip to content

Connect the Presentations page, the presentation templates and the generation service - #2322

Draft
kaymeer wants to merge 15 commits into
alice-insights/devfrom
alice-insights/connect-presentations
Draft

kaymeer wants to merge 15 commits into
alice-insights/devfrom
alice-insights/connect-presentations

Conversation

@kaymeer

@kaymeer kaymeer commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ALICE Insights project. This pull request is part of ALICE Insights, a project by students of the Amsterdam University of Applied Sciences (AUAS) for ALICE. It builds on #2308 and #2316 and is merged after them, into the project's base branch alice-insights/dev, not main.

Merge order. This branch holds the commits of #2308 and #2316. Until both are merged, the diff shows their changes too, and this pull request stays a draft so it cannot be merged before them. The last five commits are the ones to review.

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

These changes come from running the three parts as one path: the presentation templates (#2308), the Presentations page (#2316) and the generation service. Both pull requests follow the agreements of their own task, so nothing here is a mistake in them.

  1. The name presentation template. The tables are presentation_templates and presentation_template_modules, and the endpoints are GET /api/presentationTemplates and GET /api/presentationTemplates/{presentationTemplateId}. Template on its own is a general word in Bookkeeping. The code, the tests and the API documentation follow the same name, and the page reads the new endpoint.
  2. No options column. A module of a template has a position, a type and a title. No module of the generation service has a setting.
  3. The period is in Geneva time. The dates and times of the period picker mean Geneva time for every user, whatever the time zone of the browser, and the label says "Period (Geneva time)". The slides show days in Geneva time, so a week is Monday 00:00 up to Monday 00:00 in Geneva.
  4. The week of the period picker starts on the same Monday in every time zone. getStartOfWeek reads the weekday of its UTC date in UTC. Read on the local clock, a browser west of UTC gets a week that starts a day late. An emptied week field leaves the period as it is. Both hold for every page with the period picker.
  5. A finished presentation belongs to its template and period. Another template or period discards the finished download or the error of the request before it.
  6. The page shows why no presentation was made. The generation service explains every error in a sentence written for the user. Bookkeeping passes that sentence on, and uses its own only when the service gives none or cannot be reached. Add a Presentations page to generate PDFs #2316 shows Bookkeeping's own sentence for every error and has a test for that. That test is not part of this branch, because the sentence of the service says what the user can change, such as the period.
  7. The cause in the log. A request that gives no PDF writes one line to Bookkeeping's log: the answer of the generation service, or that it could not be reached at its address. Bookkeeping puts no token in the line: it holds the status, the template ID and the sentence of the service.
  8. The page says what a presentation covers. One paragraph under the title: a presentation covers every LHC fill with stable beams in the period, each in full with all its PHYSICS runs, so the slides can include time before and after the period.

Where to look

  • Points 1 and 2: the files of Add storage and read endpoints for presentation templates #2308 with their names after this pull request, such as lib/database/models/presentationTemplate.js and lib/server/routers/presentationTemplates.router.js.
  • Points 3 and 5: lib/public/views/Presentations/genevaTime.js and PresentationsPageModel.js.
  • Point 4: lib/public/utilities/dateUtils.mjs and lib/public/components/Filters/common/filters/timeRangeFilter.js.
  • Points 6 and 7: lib/server/services/presentation/generatePresentation.js.
  • Point 8: lib/public/views/Presentations/PresentationsPage.js.
  • Tests: test/api/presentationTemplates.test.js, test/api/presentations.test.js, test/lib/public/utilities/dateUtils.test.js and test/public/presentations/overview.test.js, which runs with a browser in New York and, for the day the clocks go forward, in Auckland.

The commits

Each commit passes the linter and the test suites it touches.

  1. Rename templates to presentation templates and drop the unused module options: points 1 and 2.
  2. Start the week of the period picker on the same Monday in every time zone and keep the period when the week is emptied: point 4.
  3. Read the period as Geneva time and drop a finished download when the selection changes: points 3 and 5.
  4. Show the error sentence of the generation service and log why no presentation was made: points 6 and 7.
  5. Explain on the Presentations page which fills and runs a presentation covers: point 8.

How to try it

  1. Start Bookkeeping from this branch with a fresh database and the example templates (npm run sequelize -- db:seed:all), and start the generation service.
  2. Open Presentations and choose week 47 in the period picker. The picker shows Monday 00:00 to Monday 00:00.
  3. Generate the presentation. The title slide reads "16 to 22 November 2026".
  4. Choose a period of two months and generate. The page shows "The period can be at most 31 days long."
  5. Stop the generation service and generate again. Bookkeeping's log has the line "ALICE Insights could not be reached at ...".

Notable changes for users:

  • The period of a presentation is in Geneva time, and the page says so.
  • The page shows why a presentation could not be made.
  • The page says which fills and runs a presentation covers.
  • On every page with the period picker, a week starts on Monday for a browser west of UTC.

Notable changes for developers:

  • Template is PresentationTemplate in models, adapters, repository, service, DTOs and endpoints. The field templateId of POST /api/presentations keeps its name.
  • New lib/public/views/Presentations/genevaTime.js.
  • getStartOfWeek gives the same Monday in every time zone, and the week field of the period picker ignores an empty value.

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.
@kaymeer
kaymeer requested a review from Remzi1993 November 25, 2026 22:19
@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.82748% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.21%. Comparing base (743fe7f) to head (3e9b487).

Files with missing lines Patch % Lines
...blic/views/Presentations/PresentationsPageModel.js 0.00% 86 Missing ⚠️
...ib/public/views/Presentations/PresentationsPage.js 0.00% 20 Missing ⚠️
lib/public/views/Presentations/genevaTime.js 0.00% 14 Missing ⚠️
lib/public/Model.js 0.00% 5 Missing ⚠️
...v1/20261028100000-create-presentation-templates.js 62.50% 3 Missing ⚠️
...mponents/Filters/common/filters/timeRangeFilter.js 0.00% 3 Missing ⚠️
...er/controllers/presentationTemplates.controller.js 94.73% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           alice-insights/dev    #2322      +/-   ##
======================================================
+ Coverage               46.00%   46.21%   +0.20%     
======================================================
  Files                    1070     1091      +21     
  Lines                   17610    17922     +312     
  Branches                 3261     3307      +46     
======================================================
+ Hits                     8102     8283     +181     
- Misses                   9508     9639     +131     

☔ 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.

@kaymeer
kaymeer force-pushed the alice-insights/connect-presentations branch from 8fecbec to 3e9b487 Compare November 25, 2026 23:09

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.

2 participants