feat(export): add Tags (Etiketter) column to all Excel export sheets - #1660
Merged
Conversation
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>
There was a problem hiding this comment.
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
GetSiteTagNameshelper and threads tag values into the single-site and all-workers export writers. - Inserts a new
Translations.Tagsresource (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. |
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
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 internalGetSiteTagNameshelper — no N+1.Tests
WorkingHoursExcelExportTagsColumnTests: tag-map sorting (OrdinalIgnoreCase), removed-SiteTagsexclusion, 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).Verification
Verified live against the local environment with real data: downloaded both export endpoints and parsed the xlsx — all five sheets show
Etiketterafter the name column; a two-tag site rendersNathold, Team 1; untagged sites empty; Danish header via the rebuilt satellite assembly. Design spec atdocs/superpowers/specs/2026-07-22-excel-export-tags-column-design.md.🤖 Generated with Claude Code