Skip to content

feat(export): add Tags (Etiketter) column to all Excel export sheets - #1660

Merged
renemadsen merged 1 commit into
stablefrom
feat/excel-export-tags-column
Jul 22, 2026
Merged

feat(export): add Tags (Etiketter) column to all Excel export sheets#1660
renemadsen merged 1 commit into
stablefrom
feat/excel-export-tags-column

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

  • Every Excel export sheet with a site in scope gets one Tags (Etiketter) column immediately after the worker/site name: single-site Dashboard + Day overview, all-workers Day overview + Total (one row per site) + per-site tabs.
  • Cell value = the site's SDK tag names (SiteTags/Tags, the same join the planning page's Etiketter filter uses), sorted case-insensitively, joined with ", " (e.g. Nathold, Team 1); untagged sites render empty. One query per export via an internal GetSiteTagNames helper — no N+1.
  • Header localized the same way as the neighboring headers (resx): da Etiketter, neutral Tags (other locales fall back to English, matching existing resx coverage).
  • All derived structures verified: Excel Table/AutoFilter ranges and column widths are computed from the header list or re-anchored; the Import path is unaffected (parses its own 3-column upload shape).

Tests

  • New WorkingHoursExcelExportTagsColumnTests: tag-map sorting (OrdinalIgnoreCase), removed-SiteTags exclusion, untagged omission; workbook-level assertions (OpenXml) that the Etiketter header sits immediately after the name header and cell values are correct on the Total, per-site, Dashboard and Dagsoversigt sheets. Culture pinned via the mocked user-language service (matches existing export-test pattern).
  • Two existing export tests re-anchored mechanically for the inserted column (column counts 21→22, cell coordinates shifted by one; no assertion weakened, one strengthened with an Etiketter header check). This was required — they hard-code column coordinates that the feature legitimately shifts.

Verification

Verified live against the local environment with real data: downloaded both export endpoints and parsed the xlsx — all five sheets show Etiketter after the name column; a two-tag site renders Nathold, Team 1; untagged sites empty; Danish header via the rebuilt satellite assembly. Design spec at docs/superpowers/specs/2026-07-22-excel-export-tags-column-design.md.

🤖 Generated with Claude Code

Every sheet with a site in scope gets one Tags column immediately after
the worker/site name: single-site Dashboard + Day overview, all-workers
Day overview + Total + per-site tabs. Values are the site's SDK tag
names, sorted case-insensitively and joined with ", "; untagged sites
render empty. One SiteTags query per export via an internal
GetSiteTagNames helper (same join idiom as the planning Etiketter
filter). Header localized via resx (da: Etiketter, neutral: Tags).

Tests: new WorkingHoursExcelExportTagsColumnTests (tag-map sorting /
removed-exclusion / untagged omission, plus workbook-level position and
value assertions on the Total, per-site and day-overview sheets). Two
existing export tests re-anchored mechanically for the inserted column
(counts and cell coordinates only; no assertion weakened, one added).
Includes the design spec.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 14:01

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 localized “Tags (Etiketter)” column to the TimePlanning working-hours Excel exports, populated from the SDK Site↔Tag relation and emitted consistently across all relevant sheets.

Changes:

  • Introduces a single-query GetSiteTagNames helper and threads tag values into the single-site and all-workers export writers.
  • Inserts a new Translations.Tags resource (neutral + da) and updates export headers/column layout (including Day overview/table metadata) to accommodate the new column.
  • Adds/updates OpenXml-based tests to assert header placement and tag-cell values across Total, per-site, Dashboard, and Dagsoversigt sheets.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningWorkingHoursService/TimePlanningWorkingHoursService.cs Adds tag lookup helper + injects a Tags column/value into all Excel export sheet shapes.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.resx Adds neutral “Tags” resource string.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.Designer.cs Exposes Translations.Tags accessor for the new resx entry.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.da.resx Adds Danish translation “Etiketter” for the Tags header.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/WorkingHoursExcelExportTagsColumnTests.cs New test fixture covering tag-map logic + workbook assertions for the inserted column.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/WorkingHoursExcelExportE2ETests.cs Re-anchors positional column assertions to account for the inserted Tags column.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/DagsoversigtWorksheetExportTests.cs Updates expected header/table ranges and cell references for the new column.
docs/superpowers/specs/2026-07-22-excel-export-tags-column-design.md Adds design spec describing feature, implementation, and test intent.
Files not reviewed (1)
  • eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.Designer.cs: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +5
**Date:** 2026-07-22
**Repo:** `/home/rene/Documents/workspace/microting/eform-angular-timeplanning-plugin` (backend only; frontend, endpoints, and request models unchanged)

Comment on lines +64 to +78
## Tests (CI-only — never run locally)

In the existing `TimePlanning.Pn.Test` project, following whatever pattern exists
for the working-hours/export service (or creating a focused test class if none
covers the generator):

1. **Tag-map correctness**: sites with two tags produce the sorted, comma-joined
string; untagged sites are absent/empty; removed `SiteTags` rows are excluded.
2. **Workbook-level assertion** (via `DocumentFormat.OpenXml` reading the
generated stream): the Tags header appears immediately after the name header,
and a tagged site's row carries the joined value while an untagged site's cell
is empty — covering at least the Total sheet and one per-day sheet.

Existing tests untouched. The C# build must pass locally before push; tests run
only in CI.
@renemadsen
renemadsen merged commit 226d14d into stable Jul 22, 2026
37 of 39 checks passed
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