feat(dashboard): show site tags and time-settings icon strip on worker rows - #1672
Merged
Conversation
…r rows The Navn column now surfaces what previously required opening each worker's assigned-site dialog: - tag chips (shared app-eform-tag; the same SDK SiteTags the Etiketter filter uses) — clicking a chip adds the tag to the Etiketter filter - a fixed-order six-icon settings strip (pay rule set, mobile registration mode, shifts across midnight, auto break, 1-minute intervals, extra shifts) with full-text matTooltips; active vs dimmed states Backend: plannings/index row DTO enriched with tags, pay-rule-set id+name and eight AssignedSite booleans via two batched queries (no per-row queries); removed tags excluded like the sites page does. Tests: three Index() integration tests (tags, pay rule set, settings booleans) in PlanningServiceMultiShiftTests (existing CI shard c) plus a Playwright e2e in shard n (API-seeded: chip rendering, icon states, chip-click filtering without opening the edit dialog). i18n: three new keys (No pay rule set selected / Mobile time registration disabled / Extra shifts) hand-translated across all 26 locales. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds dashboard row enrichment for the Time Planning “Navn” column by surfacing per-site tag chips and a fixed-order settings icon strip, backed by new DTO fields and batched backend lookups.
Changes:
- Backend: enriches
plannings/indexrows with SDK site tags, pay rule set id/name, and assigned-site settings booleans using batched queries. - Frontend: renders tag chips (click-to-filter) and the settings icon strip with tooltips on each worker row.
- Tests/i18n: adds integration + Playwright coverage and introduces 3 new translation keys across locales.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningPlanningService/TimePlanningPlanningService.cs | Batch-resolves tags and pay rule set names; adds new per-row fields to the Index DTO mapping. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Models/Planning/TimePlanningPlanningModel.cs | Extends row DTO with tags, pay-rule-set fields, and assigned-site settings booleans. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/TestBaseSetup.cs | Adds helper contexts for BaseDbContext and “fresh-per-call” plugin DbContext creation. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/PlanningServiceMultiShiftTests.cs | Adds integration tests exercising the full Index() path for tags/pay rules/settings booleans. |
| eform-client/src/app/plugins/modules/time-planning-pn/models/plannings/time-planning.model.ts | Extends frontend planning row model with tags and settings/pay-rule-set fields. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.ts | Emits tag-click events and adds tooltip helpers for the new icon strip. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.scss | Adds styling for tag chip row and fixed-order settings icon strip. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.html | Renders tag chips and the settings icon strip in the first column (admin + non-admin templates). |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-container/time-plannings-container.component.ts | Handles tag chip click by updating Etiketter filter + reloading. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-container/time-plannings-container.component.html | Wires tagSelected from table to container handler. |
| eform-client/playwright/e2e/plugins/time-planning-pn/n/dashboard-row-tags-settings.spec.ts | Adds Playwright e2e coverage for chip render/filtering and icon on/off states. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/enUS.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/da.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/bgBG.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/csCZ.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/deDE.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/elGR.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/esES.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/etET.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/fiFI.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/frFR.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/hrHR.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/huHU.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/isIS.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/itIT.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ltLT.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/lvLV.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/nlNL.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/noNO.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/plPL.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptBR.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptPT.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/roRO.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/skSK.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/slSL.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/svSE.ts | Adds new tooltip/label keys. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ukUA.ts | Adds new tooltip/label keys. |
Suppressed comments (2)
eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.html:75
- Clicks on the settings icon strip will bubble to the surrounding
.first-column (click)handler and can open the assigned-site edit dialog unintentionally (especially when users click to read a tooltip).
<div class="settings-strip">
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Models/Planning/TimePlanningPlanningModel.cs:67
PayRuleSetNameis set tonullwhen no pay rule set is selected (see Index()), but the DTO property is declared as non-nullablestring. Mark it nullable to reflect actual API behavior.
public string PayRuleSetName { get; set; }
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div class="row-tags" *ngIf="row['tags']?.length" (click)="$event.stopPropagation()"> | ||
| <app-eform-tag [tags]="row['tags']" (clickOnTag)="onTagClicked($event)"></app-eform-tag> | ||
| </div> | ||
| <div class="settings-strip"> |
| // Batch-resolve SDK site tags for the listed sites (one query, | ||
| // same shape as the Etiketter filter query above), grouped per | ||
| // site MicrotingUid. | ||
| var siteMicrotingUids = assignedSites.Select(x => x.SiteId).ToList(); |
Comment on lines
+72
to
+83
| <div class="row-tags" *ngIf="row['tags']?.length" (click)="$event.stopPropagation()"> | ||
| <app-eform-tag [tags]="row['tags']" (clickOnTag)="onTagClicked($event)"></app-eform-tag> | ||
| </div> | ||
| <div class="settings-strip"> | ||
| <span class="setting-ico txt" id="settingPayRule{{index}}" | ||
| [class.active]="row['payRuleSetId'] != null" | ||
| [class.off]="row['payRuleSetId'] == null" | ||
| [matTooltip]="row['payRuleSetName'] ? row['payRuleSetName'] : ('No pay rule set selected' | translate)">kr</span> | ||
| <span class="setting-ico" id="settingMobileReg{{index}}" | ||
| [class.active]="row['allowPersonalTimeRegistration']" | ||
| [class.off]="!row['allowPersonalTimeRegistration']" | ||
| [matTooltip]="getMobileRegTooltip(row)"> |
| /// dashboard's Etiketter filter operates on. Empty list when the site | ||
| /// has no tags. | ||
| /// </summary> | ||
| public List<CommonDictionaryModel> Tags { get; set; } |
Comment on lines
+29
to
+30
| payRuleSetId: number | null; | ||
| payRuleSetName: string; |
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.
What
Implements Option A of the approved design (mockup: variant A): the Dashboard's Navn column now shows, per worker row:
SiteTags(the same tags set in backend-configuration's "Rediger medarbejder" modal and used by this page's own Etiketter filter), rendered with the sharedapp-eform-tagcomponent. Clicking a chip adds that tag to the Etiketter filter; the click does not open the edit dialog.kr, mobile-registration mode clock/check/pencil, shifts-across-midnight moon, auto-break,1m, extra shifts3v), active vs dimmed, each with a full-textmatTooltip(pay-rule tooltip shows the rule set's name). Fixed order makes the whole list auditable by scanning vertically.Backend
plannings/indexrow DTO (TimePlanningPlanningModel) gainstags,payRuleSetId/payRuleSetName, and eight AssignedSite booleans — populated by two batched queries (PayRuleSets by id, SiteTags grouped per site; no N+1, dictionaries only read inside the per-site fan-out). Removed tags are excluded (bothSiteTagandTagworkflow state), matching the sites page.Tests
PlanningServiceMultiShiftTests, existing CI shard c — first tests to exercise the fullIndex()path): tags present/empty-not-null, pay-rule-set id+name resolved/null, settings booleans mirrored.tagIdscontaining the tag and opens no dialog.i18n
Three new keys across all 26 locales, hand-translated (existing keys reused for all other tooltips).
Verified locally
Full-solution build clean; browser-verified against live data: chips + strip render (matching the two workers that have
site tag 1), settings states match each worker's assigned-site config, chip click filters the list to the tagged workers and populates the Etiketter select.Code-reviewed; review's critical finding (e2e originally authored for the unused Cypress tree) fixed by porting to Playwright shard n, plus seed-payload and translation fixes.
🤖 Generated with Claude Code