Repository navigation
fix(tags): list planning tags in Danish alphabetical order (#2126) - #2127
Merged
Merged
Conversation
GetItemsPlanningTags sorted in SQL, so the order came from the column collation (utf8mb4_general_ci), which folds Å to A. Materialise the tags and sort them in memory with TagNameComparer.Danish (da-DK, case-insensitive, always Danish regardless of UI language), the same rule backend-configuration uses for task tags. Adds a Testcontainers MariaDB integration test: tags created as Øko, Beta, Åben, Alfa, Æble come back as Alfa, Beta, Æble, Øko, Åben. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017kbiaVNigNkVARtq94xkDa
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Review effort: Lite
Findings: None
What changed in this PR
Updates planning tag retrieval to use deterministic Danish alphabetical ordering.
Changes:
- Moves sorting from SQL to in-memory Danish collation.
- Adds a reusable Danish tag comparer.
- Adds MariaDB-backed integration coverage.
| File | Description |
|---|---|
| eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Services/ItemsPlanningTagsService/ItemsPlanningTagsService.cs | Updated as part of this pull request. |
| eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Helpers/TagNameComparer.cs | Updated as part of this pull request. |
| eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn.Test/ItemsPlanningTagsServiceOrderTests.cs | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
Copilot review considered: it recommends approval, with no findings. With |
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.
Closes #2126
What
GET …/items-planning-pn/tags(ItemsPlanningTagsService.GetItemsPlanningTags) sorted in SQL, so the order came from the column collation (utf8mb4_general_ci), which folds Å to A. The tags are now loaded and then sorted in memory with a new sharedTagNameComparer.Danish(StringComparer.Create(CultureInfo.GetCultureInfo("da-DK"), ignoreCase: true)). The order is always da-DK, whatever the user's UI language, which gives a…z, æ, ø, å. This is the same rule microting/eform-backendconfiguration-plugin#1334 uses for task tags (TagNameComparer.Danish, PR #1343 there). Every picker built on this endpoint, including backend-configuration's "Redigér etiketter", the tag filters and the task wizard, gets the new order.Note: da-DK collation sorts "aa" as "å", so a tag that starts with "Aa" is listed after Ø. This is intended.
Audit of other tag endpoints
Changed:
ItemsPlanningTagsService.GetItemsPlanningTags. It was the only place in the plugin that sorted tag names (OrderBy(x => x.Name)onPlanningTags).Left as is: these return tag names but do not sort them:
PlanningService: the planning list/readTagsprojection.ItemsPlanningReportService:NameTagsInEndPage.PlanningImportServiceandPairingServicelook tags up by name or id only.Adding an order to these would be a separate change.
Tests
eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn.Test/ItemsPlanningTagsServiceOrderTests.cs. It starts a real MariaDB through Testcontainers (the package was already referenced) and builds the schema withEnsureCreated. It creates tags in the order Øko, Beta, Åben, Alfa, Æble and asserts the result is Alfa, Beta, Æble, Øko, Åben. Because the database is real, the test also fails if the sort moves back into SQL.test-dotnetjob of.github/workflows/dotnet-core-pr.yml(dotnet test -c Release … ItemsPlanning.Pn.Test.csprojon ubuntu-latest, where Docker is available).dotnet buildof the solution and of the test project in Release. No tests were run locally; they run in CI only.🤖 Generated with Claude Code
https://claude.ai/code/session_017kbiaVNigNkVARtq94xkDa