Skip to content

feat(calendar): Opgaver og handlinger — calendar task list page#994

Merged
renemadsen merged 19 commits into
stablefrom
feat/calendar-task-list
Jun 10, 2026
Merged

feat(calendar): Opgaver og handlinger — calendar task list page#994
renemadsen merged 19 commits into
stablefrom
feat/calendar-task-list

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

Adds a new "Opgaver og handlinger" page to the BackendConfiguration plugin — the tabular counterpart to the calendar (/plugins/backend-configuration-pn/calendar). It lists calendar tasks (one row per series) with a filter bar, sortable columns, client-side pagination, and CSV export, and reuses the calendar's existing TaskCreateEditModalComponent for editing (row-click → edit modal). It is distinct from the legacy task-wizard (which is built on the old item-planning system); this is backed by the calendar's task model.

Route: /plugins/backend-configuration-pn/calendar-task-list. New endpoint: POST api/backend-configuration-pn/calendar/tasks/index.

Design spec & implementation plan: docs/superpowers/specs/2026-06-09-calendar-task-list-design.md and docs/superpowers/plans/2026-06-09-calendar-task-list.md (in the flutter-eform repo).

Backend

  • New Index on BackendConfigurationCalendarService (+ interface) querying AreaRulePlanning (one row per series, no occurrence expansion), mirroring the task-wizard Index pattern. Returns the existing CalendarTaskResponseModel.
  • Filters: property, board (via CalendarConfiguration), eForm, assignee, tags, active, compliance, free-text. Sort via QueryHelper.AddSortToQuery; pagination is client-side (documented on the model, matching the task-wizard reference).
  • New request/filter/pagination models; POST calendar/tasks/index controller action.
  • New menu entry in GetNavigationMenu (EN "Tasks and actions" / DA "Opgaver og handlinger").
  • Integration test (passes against MariaDB Testcontainer) verifying the status filter.

Frontend

  • New lazy module modules/calendar-task-list/ (filters + table + page components).
  • Gentagelse column shows the full humanized recurrence via the calendar's existing CalendarRepeatService (reconstructMetaFromTask + formatCustomRepeatLabel) — identical wording to the recurrence picker (e.g. "Ugentligt hver mandag", "Månedligt på den 2. torsdag", "Gentages ikke").
  • Tavle column shows the board color swatch + name (board metadata is property-scoped, so name/swatch resolve when a single property is filtered; the swatch falls back to the task color).
  • Ja/Nej badges for Aktiv/Compliance; clickable Opgavenavn opens the calendar edit modal; CSV built client-side (BOM + ;, humanized Gentagelse).
  • Reuses the calendar modal, mapResponseToCalendarTask, and option-list services; extracted a shared formatRepeatText helper.
  • Jest specs for the table + page (11 tests, pass).

Verification

  • dotnet build green; integration test passes (real MariaDB).
  • Frontend production build green; 11 Jest tests pass.
  • Live smoke against the local stack (real 420 data): page + table render, Gentagelse full descriptions, Ja/Nej badges, Tavle swatch (single-property), Aktiv filter changes the row set, edit modal opens populated, CSV downloads correctly.

⚠️ Deployment note — menu re-seed

The host syncs plugin menu items into MenuItems only on plugin install/enable, not on every startup. On an already-seeded DB, the new "Opgaver og handlinger" entry will not appear in the left nav until the plugin is re-enabled / the menu is re-seeded. The page is reachable by route in the meantime. The menu code itself follows the exact task-wizard entry pattern.

🤖 Generated with Claude Code

renemadsen and others added 19 commits June 9, 2026 15:35
…ination

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add navigation entry for the new calendar task list page at
/plugins/backend-configuration-pn/calendar-task-list (Position=3),
and shift all sibling positions >=3 up by one to maintain ordering.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… badges, swatch)

Surfaces eformId + itemPlanningTagId on CalendarTaskModel so the table can
resolve the eForm label and Overskrift from the option lists. Board swatch,
Ja/Nej badges and the clickable task-name link use mtx-grid cellTemplate
refs (matching task-wizard-table); plain columns use formatter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Loads option lists (properties, planning tags, eForm templates; boards +
workers per single selected property), calls getTasksIndex and maps rows via
mapResponseToCalendarTask (same as the week grid). Row link opens the
calendar's TaskCreateEditModalComponent via MatDialog + dialogConfigHelper
with the full row as data.task; reloads on save-close. CSV is built
client-side with BOM, ';' separator and the humanized Gentagelse string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lazy route 'calendar-task-list' registered next to 'calendar' with AuthGuard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 9, 2026 15:17

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.

Pull request overview

Adds a new “Opgaver og handlinger / Tasks and actions” task-list page to the BackendConfiguration calendar feature set. The change introduces a backend index endpoint that returns one row per recurrence series (no occurrence expansion) and a new Angular lazy module that lists, filters, sorts, paginates (client-side), exports CSV, and opens the existing calendar edit modal for a selected row.

Changes:

  • Backend: add POST /api/backend-configuration-pn/calendar/tasks/index with new filter/sort request models and service method to list calendar task series.
  • Frontend: add a new lazy-loaded calendar task-list module (filters + table + page) with CSV export and modal reuse.
  • Refactor: extract shared task-mapping helpers so week-grid and task-list derive repeat-rule identically.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationCalendarService/IBackendConfigurationCalendarService.cs Adds the new Index service contract for task-list indexing.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationCalendarService/BackendConfigurationCalendarService.cs Implements Index query/filters, enriches rows (boards/tags/workers), applies name filter and sorting.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Calendar/CalendarTaskListPaginationModel.cs New backend pagination/sort model (parity with other list endpoints).
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Calendar/CalendarTaskListFiltrationModel.cs New backend filtration model for the task-list endpoint.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Calendar/CalendarTaskIndexRequestModel.cs New backend request wrapper (filters + pagination) for /tasks/index.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/EformBackendConfigurationPlugin.cs Adds a new navigation menu entry for the task-list page and adjusts positions.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Controllers/CalendarController.cs Adds the POST calendar/tasks/index controller action.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.Integration.Test/CalendarTaskListIndexTest.cs Adds focused integration coverage for Index status filtering.
eform-client/src/app/plugins/modules/backend-configuration-pn/services/backend-configuration-pn-calendar.service.ts Adds a typed client method for calling the new /calendar/tasks/index endpoint.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar/services/calendar-task.mapper.ts Introduces shared DTO→model mapping helpers (mapRepeatType, mapResponseToCalendarTask).
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar/components/calendar-container/calendar-container.component.ts Reuses the extracted mapping helper instead of duplicating repeat-rule logic.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar/calendar.module.ts Re-exports the create/edit modal so sibling modules can open it without redeclaring.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/index.ts Barrel exports for new task-list components.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-table/calendar-task-list-table.component.ts New table component (columns, formatting, repeat text, edit event).
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-table/calendar-task-list-table.component.spec.ts Jest coverage for table helpers and edit-event emission.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-table/calendar-task-list-table.component.scss Styling for swatches, link/button, and yes/no badges.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-table/calendar-task-list-table.component.html Renders the grid with templates for board/title/status/compliance cells.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-page/calendar-task-list-page.component.ts New page container: loads option lists, calls index endpoint, opens modal, exports CSV.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-page/calendar-task-list-page.component.spec.ts Jest coverage for init loading, filter reload, and modal open behavior.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-page/calendar-task-list-page.component.scss Page header layout styling.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-page/calendar-task-list-page.component.html Page layout: header + filters + table.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-filters/calendar-task-list-filters.component.ts New filter-bar component (debounced search, property-dependent option handling).
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-filters/calendar-task-list-filters.component.scss Responsive grid layout for the filter bar.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/components/calendar-task-list-filters/calendar-task-list-filters.component.html Filter UI (property/eform/board/assignee/status/compliance/tags/search).
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/calendar-task-list.routing.ts Adds route configuration for the new lazy module.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/calendar-task-list.module.ts Declares the new task-list module and imports required dependencies.
eform-client/src/app/plugins/modules/backend-configuration-pn/modules/calendar-task-list/calendar-task-list-repeat.util.ts Shared repeat-label formatting helper (table + CSV).
eform-client/src/app/plugins/modules/backend-configuration-pn/models/calendar/calendar-task.model.ts Extends calendar task model + adds request model interfaces for /tasks/index.
eform-client/src/app/plugins/modules/backend-configuration-pn/i18n/enUS.ts Adds English translations for new page strings.
eform-client/src/app/plugins/modules/backend-configuration-pn/i18n/da.ts Adds Danish translations for new page strings.
eform-client/src/app/plugins/modules/backend-configuration-pn/backend-configuration-pn.routing.ts Registers the new lazy route calendar-task-list.

Comment on lines +37 to +39
boardColor(task: CalendarTaskModel): string {
return task.color || this.board(task.boardId)?.color || 'transparent';
}
Comment on lines +19 to +21
<ng-template #titleTpl let-row>
<a class="ctl-link" (click)="onEdit(row)">{{ row.title }}</a>
</ng-template>
Comment on lines +100 to +102
// Request models for the calendar "task list" page (POST /calendar/tasks/index).
// Mirrors the backend CalendarTaskListRequestModel: a filter block + pagination.
export interface CalendarTaskListFiltrationModel {
Comment on lines +113 to +116
export interface CalendarTaskListPaginationModel {
sort: string;
isSortDsc: boolean;
}
Comment on lines +135 to +140
loadTasks() {
this.calendarService.getTasksIndex({
filters: this.currentFilters,
pagination: {sort: 'Id', isSortDsc: false},
}).subscribe(res => {
if (res && res.success) {
@renemadsen renemadsen merged commit f94e802 into stable Jun 10, 2026
27 checks passed
@renemadsen renemadsen deleted the feat/calendar-task-list branch June 10, 2026 10:55
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