feat(settings): expose OverMidnight toggle in the assigned-site dialog - #1659
Merged
Conversation
Add a "Shifts across midnight" checkbox under the punch-clock entry method (the flag has no effect for other entry methods), with help text explaining the automatic midnight split (day 1: 22:00-00:00, day 2: 00:00-06:00 — handled by the app). Value is retained when the entry method changes. Fix the write path: UpdateAssignedSite never persisted OverMidnight, so the field was silently dropped on save even though the DTO and entity both carry it. Adds 2 i18n keys across all 26 locales, a backend persistence round-trip test, and dialog spec tests for visibility and model sync. Includes the design spec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an “OverMidnight / Shifts across midnight” setting to assigned-site configuration, ensuring the flag is both editable in the Angular dialog (with full i18n coverage) and correctly persisted by the backend update path.
Changes:
- Backend: persist
OverMidnightinUpdateAssignedSite, plus a regression test to verify true/false round-trips. - Frontend: add
overMidnightto the assigned-site model, wire it into the dialog form + UI, and add unit tests for visibility/init/sync. - i18n/docs: add 2 new translation keys across all locales and include a design spec document.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningSettingService/TimeSettingService.cs | Persists OverMidnight during assigned-site updates. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/SettingsServiceTests.cs | Adds regression test ensuring OverMidnight is saved on update. |
| eform-client/src/app/plugins/modules/time-planning-pn/models/assigned-sites/assigned-site.model.ts | Extends client-side assigned-site model with overMidnight. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.ts | Registers overMidnight as a dialog form control and syncs it to the model. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.html | Adds the “Shifts across midnight” checkbox (shown only under punch clock). |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.spec.ts | Adds unit tests for visibility, initialization, and toggle-to-model sync. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/bgBG.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/csCZ.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/da.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/deDE.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/elGR.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/enUS.ts | Adds new “Shifts across midnight” label + help-text translations (source keys). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/esES.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/etET.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/fiFI.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/frFR.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/hrHR.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/huHU.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/isIS.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/itIT.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ltLT.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/lvLV.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/nlNL.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/noNO.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/plPL.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptBR.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptPT.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/roRO.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/skSK.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/slSL.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/svSE.ts | Adds new “Shifts across midnight” label + help-text translations. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ukUA.ts | Adds new “Shifts across midnight” label + help-text translations. |
| docs/superpowers/specs/2026-07-22-assigned-site-overmidnight-design.md | Documents the UI placement, data flow, and testing approach for the toggle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
180
to
183
| usePunchClock: new FormControl(this.data.usePunchClock), | ||
| usePunchClockWithAllowRegisteringInHistory: new FormControl(this.data.usePunchClockWithAllowRegisteringInHistory), | ||
| overMidnight: new FormControl(this.data.overMidnight), | ||
| allowAcceptOfPlannedHours: new FormControl(this.data.allowAcceptOfPlannedHours), |
Comment on lines
+693
to
+700
| function isOverMidnightVisible(c: AssignedSiteDialogComponent): boolean { | ||
| let isAdmin = false; | ||
| c['selectCurrentUserIsAdmin$']?.subscribe((v: boolean) => (isAdmin = v)); | ||
| return !c.data.resigned | ||
| && c.data.allowPersonalTimeRegistration | ||
| && isAdmin | ||
| && c.data.usePunchClock; | ||
| } |
Comment on lines
+3
to
+5
| **Date:** 2026-07-22 | ||
| **Repos:** `/home/rene/Documents/workspace/microting/eform-angular-timeplanning-plugin` (all changes; base repo untouched) | ||
|
|
Comment on lines
+8
to
+11
| `AssignedSites.OverMidnight` (bool, default false) has existed since migration | ||
| `20260619120000_AddOverMidnightToAssignedSite` in | ||
| `/home/rene/Documents/workspace/microting/eform-timeplanning-base`. The read side is | ||
| fully wired: entity → REST DTO (`Infrastructure/Models/Settings/AssignedSite.cs:59`) |
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.
Summary
UpdateAssignedSitenever persistedOverMidnight— the DTO and entity both carry the field, but the update service silently dropped it. One assignment added.Tests
UpdateAssignedSite_PersistsOverMidnight— true→persisted, false→persisted round-trip in the existing SettingsServiceTests fixture.assigned-site-dialog.component.spec.ts— visibility per entry method (punch clock / manual / accept-planned), form-control init from model, model sync on toggle.Verification
Verified live against the local environment and real DB: checkbox renders with correct Danish help text under the punch-clock option; hides on "Manuel indtastning" and returns on punch clock (same as the sibling sub-option); saving true then false round-trips to
AssignedSites.OverMidnightwith version rows recorded (v9: 0→1, v10: 1→0). Design spec included atdocs/superpowers/specs/2026-07-22-assigned-site-overmidnight-design.md.Note (out of scope, pre-existing)
While verifying,
plannings/indexfor the full site list was found to fail intermittently-by-volume on the local env: the GET path recomputes SumFlex per site in aTask.WhenAllfan-out and concurrentPlanRegistrationVersionsinserts hit InnoDB write contention; the catch atPlanRegistrationHelper.cs:1064-1073then mislabels the save exception as "Could not parse PlanText" and swallows the inner error. Unrelated to this PR (single-site requests work); worth a separate fix (narrow the catch + log inner exception, and serialize/bound the per-site writes).🤖 Generated with Claude Code