Skip to content

feat(planner): web planner "Planlægning (beta)" screens and Playwright shard t (#5489) - #1792

Merged
renemadsen merged 6 commits into
stablefrom
feat/5489-planner-web
Nov 16, 2026
Merged

renemadsen merged 6 commits into
stablefrom
feat/5489-planner-web

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Why

Kanban card #5489, "Timeplaner på web". Managers plan their staff on the web instead of in the Google Sheet. The backend (planner API, time_planning_planner permission, menu entry) is already on stable (#1790). This PR adds the Angular screens (task 1766) and their Playwright shard t (task 1769).

What

A new lazy-loaded route, /plugins/time-planning-pn/planner, guarded by time_planning_planner. Existing files only gain the route, the claim constant and i18n keys; no existing component, dialog or service changes.

  1. Grid: workers × 7/14 days with a department filter. Cells show plan, absence (amber fill), a manual-change dot and a lock icon. Each worker gets ISO-week hours against the norm. Each day gets a headcount, with an amber hatch where vacation requests are pending.
  2. Bulk edit: select cells by click, shift-click or drag, then enter a short form (7-15/0,5, Fri, Ryd, an absence type). Choose between "kun disse dage" and "alle [ugedag] fra [dato]". Locked days are reported.
  3. Pattern editor: a 1–8 week rotation, with anchor Monday, valid-from date, copy from a colleague, and a prefill from the template. On save you choose whether to keep or overwrite manually changed days.
  4. Absence over a period: locked dates are listed if the request is refused.
  5. Vacation-requests panel: the existing inbox and approve/reject dialogs, plus "Vis i planen" and a headcount-0 warning.
  6. One-off Google Sheet import wizard (preview → review → apply), and the "Brug Google Sheet igen" toggle.

Shard t covers:

  • the menu entry following the permission (a real group toggle)
  • multi-cell edit
  • a 6-week rotation
  • copy from a colleague
  • absence over a period
  • the import wizard

t is added to the matrix in both workflows. Its post-migration.sql only applies to shard t. The patch step now also waits for the AssignedSiteManagingTags table before applying a patch; b1m–l1m only gain that extra wait. Shards a–s are otherwise untouched; they are the proof that existing views did not move.

Verified

  • ng build and the plugin unit specs pass (609 + new planner specs), and so does the button-convention check, all in a throwaway host.
  • Shard t passes 8/8, three times on reset databases, on a local stack built like CI.
  • Screens were screenshotted in light and dark mode and compared with the design canvas. Table rows are uniform (checked with getComputedStyle).

Known and set aside (follow-up cards)

  • Canvas extras not built yet:
    • absence per-day preview
    • grid help panel, avatars, "n / N" headcount, a global "Ugemønstre" button
    • requests card details
    • import confidence column
    • hours preview while typing, the "37 t" preset, Helligdage and "Gælder også for" rows, month view
  • After switching "Brug Google Sheet igen" back on, the import wizard is empty until the next service start. This is by design in SheetWorkersInScopeAsync, but it is confusing.

🤖 Generated with Claude Code

renemadsen and others added 2 commits November 15, 2026 13:36
A new lazy-loaded planner route at /plugins/time-planning-pn/planner,
guarded by time_planning_planner, over the merged planner API:

- grid: workers x 7/14 days, department filter, plan/absence/manual/lock
  marks, ISO-week hours against the norm, headcount per day with pending
  vacation hatched
- multi-cell select (click, shift-click, drag) and a short-form editor:
  "kun disse dage" or "alle <ugedag> fra <dato>"; locked days reported
- pattern editor: 1-8 week rotation, anchor Monday, valid-from, copy from a
  colleague, prefill from the template, keep-or-overwrite manual days
- absence over a period, vacation-requests panel (existing inbox and
  approve/reject dialogs), one-off Google Sheet import wizard and the
  "Brug Google Sheet igen" toggle

Existing files only gain the route, the claim constant and i18n keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shard t (task 1769) covers the planner beta end to end: the menu entry
follows the time_planning_planner permission, multi-cell grid edits, a
6-week rotation pattern, copy from a colleague, absence over a period and
the Google Sheet import wizard. A shard-only post-migration patch makes
admin a manager of the test workers. The patch step now also waits for the
AssignedSiteManagingTags table it writes to.

Fixes found running it on a real host:
- the grid crashed and showed no workers: the host's DateInterceptor hands
  Date objects where the planner expected strings
- the requests drawer clipped the panel's left 120px
- text typed right after changing the rotation length was saved as empty
- import ticked workers with no plan as "same week every week"; they now
  show "Ingen plan (timelønnet)", unticked
- the step label ran into the import title
- pending vacation now has an amber hatch, distinct from locked days, and
  absence days the canvas's amber fill; selection keeps the hatch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 07:05

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.

🟡 Changes recommended

Client validation accepts a server-rejected shift format, while Cancel remains enabled during absence and pattern saves, allowing completed writes to leave the displayed plan stale.

3 open issues
What changed in this PR

Adds the Angular “Planlægning (beta)” interface on top of the planner API introduced in #1790, letting managers plan staff on the web rather than in Google Sheets.

Changes:

  • Adds permission-guarded planner routing, shared utilities, and screens for patterns, absence, vacation requests, and imports.
  • Adds planner interface strings, shared styling, and editor guard tests.
  • Adds Playwright shard t with manager fixtures and includes it in both CI workflows.
File Description
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​time-planning-pn.routing.ts Adds the guarded lazy-loaded planner route.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​services/​time-planning-pn-planner.service.ts Wraps planner API operations.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​services/​index.ts Exports the planner service.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner.utils.ts Adds calendar, formatting, and pattern helpers.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner.routing.ts Routes to the planner container.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner.module.ts Defines the lazy-loaded planner module.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner-shared.scss Provides shared planner layout styles.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner-absence-types.ts Maps existing absence types to planner options.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​models/​index.ts Exports planner models.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-requests-panel/​planner-requests-panel.component.ts Loads requests and connects decision dialogs.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-requests-panel/​planner-requests-panel.component.scss Styles request cards and panel layout.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-requests-panel/​planner-requests-panel.component.html Displays requests, warnings, and actions.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-dialog/​planner-pattern-dialog.component.scss Applies shared dialog styles.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-dialog/​planner-pattern-dialog.component.html Provides pattern editing and confirmation controls.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-days/​planner-pattern-days.component.ts Organizes editable rotation days by week.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-days/​planner-pattern-days.component.scss Styles the scrollable rotation table.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-days/​planner-pattern-days.component.html Renders labeled daily shift inputs.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-import-dialog/​planner-import-dialog.component.scss Styles import steps and review rows.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.spec.ts Tests short-form submission guards.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.scss Styles the grid, status markers, and editor.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.ts Submits period absence and displays locked dates.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.scss Applies shared absence-dialog styles.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.html Provides worker, absence, and date-range inputs.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​index.ts Exports planner components.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ukUA.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​svSE.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​slSL.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​skSK.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​roRO.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ptPT.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ptBR.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​plPL.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​noNO.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​nlNL.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​lvLV.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ltLT.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​itIT.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​isIS.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​huHU.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​hrHR.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​frFR.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​fiFI.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​etET.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​esES.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​enUS.ts Adds English planner interface strings.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​elGR.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​deDE.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​da.ts Adds Danish planner interface strings.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​csCZ.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​bgBG.ts Adds English planner strings to this locale.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​enums/​time-planning-pn-claims.const.ts Defines the planner permission constant.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​post-migration.sql Establishes manager relationships for shard t.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-pattern-rotation.spec.ts Tests six-week rotation editing and grid results.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-pattern-copy.spec.ts Tests copying a colleague’s pattern.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-menu-permission.spec.ts Tests menu visibility through permission changes.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-import.spec.ts Tests import steps and restoring Sheet use.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-grid-edit.spec.ts Tests bulk editing across workers and days.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-absence.spec.ts Tests period absence and skipped days off.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​assert-true.spec.ts Adds a shard canary test.
.github/​workflows/​dotnet-core-pr.yml Adds shard t and a migration-table wait.
.github/​workflows/​dotnet-core-master.yml Adds shard t and a migration-table wait.

Review effort: Balanced

…t form

Copilot review on #1792:
- Cancel/Back in the absence, pattern and import dialogs are disabled while
  a request is in flight, so a completed write can't look like a cancel and
  skip the grid reload
- the client short-form check now applies PlanTextParser's value rules
  (minutes 00-59, single decimal only 0/3/5, nothing past 24:00, start !=
  end), so it no longer calls valid what the server refuses (e.g. 7.7-15)

CI: ubuntu-latest became 26.04, where Playwright cannot install chromium;
pin the Playwright job to ubuntu-24.04.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 07:22

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.

🟡 Changes recommended

HTTP requests that complete without emitting can leave both planner dialogs permanently busy and undismissable; empty-completion handling and regression coverage are needed, with grid refreshes when write outcomes are unknown.

2 open issues
3 resolved since last review

Review effort: Balanced

</div>
<div mat-dialog-actions class="d-flex flex-row justify-content-end">
@if (step === 'edit') {
<button type="button" class="btn-cancel" id="planner-pattern-cancel" data-testid="planner-pattern-cancel" [disabled]="busy" (click)="cancel()">
Copilot review on #1792: the host's http-error interceptor answers a 401,
a 403 whose refresh failed, and exhausted retries with EMPTY, so a request
can complete without next or error. With Cancel disabled while busy and
disableClose on, that trapped the user in the dialog.

A small onNoReply operator (per-subscription flag) now handles it:
- writes whose outcome is unknown (absence, pattern save/delete, import
  apply, bulk cell edit) release busy, warn "plannerOutcomeUnknown" and
  close as changed / reload the grid
- reads release busy; the initial pattern and import loads close as on a
  refusal; the grid and requests-panel loads stop their spinners

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 07:48

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.

🔵 Needs a closer look

Date edits during the pending lookup can bypass confirmation for manually changed days, and Blank messages are incorrectly displayed as absences.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Disable date inputs while manual-day lookup is pending

eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-dialog/​planner-pattern-dialog.component.html:80

Changing the valid-from date while the manual-days lookup is pending makes persist() save a different range from the one checked, potentially skipping the confirmation for earlier manually changed days. Disable both date inputs while busy so the validated dates remain stable through the lookup and save; the anchor input at line 67 has the same issue.

Medium severity Treat Blank messages as non-absence

eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner-absence-types.ts:14

This still returns 'Blank' for message id 6, although the list above explicitly excludes Blank because it is not an absence. The grid uses this helper's truthiness to apply the amber absence fill and to show an absence badge instead of the planned hours, so a Blank message is displayed as an absence with the untranslated label 'Blank'. Please return null for Blank too.

1 resolved since last review

Review effort: Balanced

Copilot review on #1792: the anchor and valid-from dates (and the form and
rotation toggles) stayed editable during the manual-days lookup, so the
save could cover a different range than the one checked, or save a
pattern after switching to "Ingen fast plan". They are now disabled while
busy; the day texts stay editable, since what is typed is what is saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 08:10

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.

🔵 Needs a closer look

Human assessment is needed because overlapping inbox refreshes can restore already-decided requests and overwrite pending counts with stale responses.

1 open issue

Review effort: Balanced

Copilot review on #1792: the panel's load() did not cancel an older inbox
read, so a slow reply could land last and bring back requests decided in
the meantime, with a stale pending count. It now cancels the previous read,
as the container's own count refresh already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 08:29

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.

🔵 Needs a closer look

Human assessment is needed because date validation, edits during pending requests, and inbox error handling introduce risks of rejected submissions, lost edits, and misleading empty states.

1 open issue

Review effort: Balanced

@renemadsen
renemadsen merged commit 9f3a736 into stable Nov 16, 2026
46 checks passed
@renemadsen
renemadsen deleted the feat/5489-planner-web branch November 16, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants