Repository navigation
feat(planner): explain disabled absence button, admin rights, design parity - #1794
Merged
Merged
Conversation
…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>
There was a problem hiding this comment.
🟢 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.DecidedBySdkSitId/AbsenceApprovedBySdkSitId).POST planner/absence/preview. It shares create-absence's scope and per-day decision, with outcomeslocked/overlap/apply/dayOff.pendingRequestCount. The error keyPlannerGridDaysMustBe7Or14is renamed toPlannerGridRangeInvalid.Client
.segmentedradiogroup from the compliance report.Tests
PlannerAdminAndPreviewTestscover 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.planner-absence-no-leader.spec.tscovers a user who can approve nobody.planner-absence.spec.tsnow covers preview → register.🤖 Generated with Claude Code