Skip to content

feat(planner): explain disabled absence button, admin rights, design parity - #1794

Merged
renemadsen merged 2 commits into
stablefrom
feat/5489-absence-explain-grid-parity
Nov 18, 2026
Merged

renemadsen merged 2 commits into
stablefrom
feat/5489-absence-explain-grid-parity

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Follow-up to #1792 (kanban #5489, "Planlægning (beta)").

Why

On tenant 855 the "Registrér fravær" button never enabled: the admin was manager of nobody, so every worker was a disabled option, and the only explanation ("not manager of this worker") could never appear. No test covered it.

What

Server

  • Admins (EformRole.Admin / "eForm admins") may register absence and approve/reject requests for any worker from the web planner. Managers stay limited to their tags. The app's gRPC path is unchanged, and a test checks that.
  • An admin without an SDK site is stored with a null decider (DecidedBySdkSitId / AbsenceApprovedBySdkSitId).
  • New read-only POST planner/absence/preview. It shares create-absence's scope and per-day decision, with outcomes locked / overlap / apply / dayOff.
  • The grid accepts a whole calendar month and returns pendingRequestCount. The error key PlannerGridDaysMustBe7Or14 is renamed to PlannerGridRangeInvalid.

Client

  • Absence dialog, rebuilt per design screen 4:
    • type chips with Ferie preselected
    • Fra / Til og med fields
    • debounced, cancellable day-by-day preview
    • the button text follows the chosen type
    • a "Mangler: …" line, and a message explaining how to become leader
    • non-approvable workers can be selected, so their hint shows
  • Grid:
    • help panel and initials avatars
    • Måned view, and the Ugemønstre button (with a worker picker)
    • Ferieønsker badge and the new legend items
    • a compact, fixed selection bar with a Ferie action
    • 2 weeks fit at 1920px with the sidebar
  • Toggles: all planner toggles use the workspace .segmented radiogroup from the compliance report.

Tests

  • C#: the new PlannerAdminAndPreviewTests cover the admin rule, preview = create parity, a read-only preview, the month grid, and the pending count. The assertion "an admin who is no manager cannot decide" is flipped, because that rule changed.
  • Unit: 707 specs pass, including every reason the button is disabled, the stale-preview race, and month navigation.
  • Playwright shard t: planner-absence-no-leader.spec.ts covers a user who can approve nobody. planner-absence.spec.ts now covers preview → register.
  • Visual check against a real backend in the workspace theme, compared with the design artifact.

🤖 Generated with Claude Code

…parity

"Registrér fravær" never enabled on a tenant where the admin was manager
of nobody: every worker was a disabled option and the only hint could not
show. Now:

- Server: admins may register absence and approve/reject requests for any
  worker from the web planner (mobile/gRPC keeps the manager rule). An
  admin without an SDK site is stored with a null decider.
- New read-only POST planner/absence/preview sharing create-absence's
  per-day decision (locked / overlap / apply / dayOff).
- Grid accepts a whole calendar month and returns pendingRequestCount.
- Absence dialog rebuilt per design screen 4: type chips (Ferie
  preselected), Fra / Til og med, day-by-day preview, CTA follows type,
  "Mangler: ..." line and leader explanation; non-approvable workers are
  selectable so their hint shows.
- Grid: help panel, avatars, Måned view, Ugemønstre button with worker
  picker, Ferieønsker badge, legend items, compact fixed selection bar
  with a Ferie action, 2 weeks fit at 1920px.
- All planner toggles use the workspace .segmented radiogroup from the
  compliance report.
- Tests: C# admin/preview/month tests, component specs for every disabled
  reason, shard t specs for a user who can approve nobody and for
  preview + register.

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

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.

🟢 Approval recommended

The review identifies no active issues requiring changes.

No open issues 🎉

What changed in this PR

This follow-up to #1792 improves absence registration in the Time Planning beta planner, explains disabled actions, and brings the interface closer to the planned design.

Changes:

  • Allows web administrators to decide absences for any worker while preserving manager-only app behavior, and adds the absence-preview API contract.
  • Rebuilds the absence dialog and adds month navigation, help, worker pickers, request badges, and compact grid controls.
  • Expands server, unit, and browser coverage and updates planner text across locale files.
File Description
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Services/​PlannerService/​IPlannerService.cs Declares read-only absence preview and documents admin authority.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Services/​AbsenceRequestService/​IAbsenceRequestService.cs Adds explicit web-admin decision options.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Services/​AbsenceRequestService/​AbsenceRequestService.cs Supports admin decisions, nullable deciders, and expanded inbox access.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Services/​AbsenceRequestService/​AbsenceDecisionRules.cs Centralizes admin and manager decision checks.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Resources/​localization.json Updates grid-range validation text for month support.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Infrastructure/​Models/​Planner/​PlannerGridModels.cs Documents month ranges and adds pending-request count.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Infrastructure/​Models/​Planner/​PlannerEditModels.cs Defines per-day absence-preview results.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Controllers/​TimePlanningPlannerController.cs Exposes the absence-preview endpoint.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn/​Controllers/​AbsenceRequestsController.cs Enables admin authority for web request actions.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn.Test/​PlannerGridAndEditTests.cs Updates admin and invalid-range expectations.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn.Test/​PlannerAdminAndPreviewTests.cs Covers permissions, preview parity, month ranges, and counts.
eFormAPI/​Plugins/​TimePlanning.Pn/​TimePlanning.Pn.Test/​PlannerAccessWiringTests.cs Includes the preview endpoint in authorization checks.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​services/​time-planning-pn-planner.service.ts Adds preview requests and removes separate badge fetching.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner.utils.ts Adds month helpers, initials, and radiogroup keyboard handling.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner.utils.spec.ts Tests absence ordering, initials, and keyboard navigation.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner-shared.scss Adds shared segmented controls and avatar styles.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​planner-absence-types.ts Prioritizes common types and defaults to vacation.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​models/​planner.models.ts Adds preview and pending-count client models.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-requests-panel/​planner-requests-panel.component.ts Removes the panel’s badge-count output.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-requests-panel/​planner-requests-panel.component.spec.ts Adjusts stale-response coverage after count-output removal.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-dialog/​planner-pattern-dialog.component.ts Adds worker selection and segmented-control handling.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-pattern-dialog/​planner-pattern-dialog.component.html Renders the worker picker and pattern radiogroups.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-dialogs-no-reply.spec.ts Adds a preview stub to no-reply tests.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.ts Adds month navigation, help state, dialog entry points, and editor positioning.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.spec.ts Covers navigation, badges, help, positioning, and dialog prefills.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.scss Compacts the grid and styles help, badges, and selection bar.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-container/​planner-container.component.html Adds month controls, help, avatars, and selection actions.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.ts Adds cancellable previews and disabled-action explanations.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.scss Styles absence chips, preview rows, and validation text.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​modules/​planner/​components/​planner-absence-dialog/​planner-absence-dialog.component.html Rebuilds absence selection, dates, preview, and submit feedback.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ukUA.ts Adds English planner strings to the Ukrainian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​svSE.ts Adds English planner strings to the Swedish catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​slSL.ts Adds English planner strings to the Slovenian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​skSK.ts Adds English planner strings to the Slovak catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​roRO.ts Adds English planner strings to the Romanian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ptPT.ts Adds English planner strings to the Portuguese catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ptBR.ts Adds English planner strings to the Brazilian Portuguese catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​plPL.ts Adds English planner strings to the Polish catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​noNO.ts Adds English planner strings to the Norwegian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​nlNL.ts Adds English planner strings to the Dutch catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​lvLV.ts Adds English planner strings to the Latvian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​ltLT.ts Adds English planner strings to the Lithuanian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​itIT.ts Adds English planner strings to the Italian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​isIS.ts Adds English planner strings to the Icelandic catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​huHU.ts Adds English planner strings to the Hungarian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​hrHR.ts Adds English planner strings to the Croatian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​frFR.ts Adds English planner strings to the French catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​fiFI.ts Adds English planner strings to the Finnish catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​etET.ts Adds English planner strings to the Estonian catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​esES.ts Adds English planner strings to the Spanish catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​enUS.ts Adds English preview, help, month, and permission text.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​elGR.ts Adds English planner strings to the Greek catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​deDE.ts Adds English planner strings to the German catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​da.ts Adds Danish preview, help, month, and permission text.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​csCZ.ts Adds English planner strings to the Czech catalogue.
eform-client/​src/​app/​plugins/​modules/​time-planning-pn/​i18n/​bgBG.ts Adds English planner strings to the Bulgarian catalogue.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-pattern-copy.spec.ts Checks the replacement control’s selected accessibility state.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-helpers.ts Adds plain-user setup, permission grants, and login helpers.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-absence.spec.ts Covers preview followed by vacation registration.
eform-client/​playwright/​e2e/​plugins/​time-planning-pn/​t/​planner-absence-no-leader.spec.ts Covers disabled-action explanations and selectable workers.

Review effort: Balanced

ShardCoverageTests failed on #1794: the new DB fixture was in no shard
filter. Planner DB fixtures re-migrate per test, so it gets its own
shard (k2) in both workflows.

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

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.

🟢 Approval recommended

No active review issues require changes to the planner update.

No open issues 🎉

Review effort: Balanced

@renemadsen
renemadsen merged commit 9cfd19a into stable Nov 18, 2026
47 checks passed
@renemadsen
renemadsen deleted the feat/5489-absence-explain-grid-parity branch November 18, 2026 18:38
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