Skip to content

FIX: Sorting issues case directory#14173

Merged
Pa-Touche merged 2 commits into
developmentfrom
fix/14093-case-sorting
Jul 9, 2026
Merged

FIX: Sorting issues case directory#14173
Pa-Touche merged 2 commits into
developmentfrom
fix/14093-case-sorting

Conversation

@Pa-Touche

@Pa-Touche Pa-Touche commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #14093

Summary by CodeRabbit

  • Bug Fixes
    • Fixed sorting for case lists so case fields, person fields, and disease variant values are ordered correctly and consistently.
    • Improved case-insensitive sorting for external identifiers and reference-style fields.
    • Updated the survey token grid to display response status more clearly using a checkbox-style indicator.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Restructures the sort-property switch in CaseListCriteriaBuilder#getIndexOrders so case fields map to their own property instead of incorrectly falling through to DISEASE_VARIANT_VALUE, fixing case directory sorting. Separately, SurveyTokenGrid now renders its RESPONSE_RECEIVED column using BooleanRenderer.

Changes

Case Directory Sorting Fix

Layer / File(s) Summary
Fix sort property mapping
sormas-backend/.../caze/CaseListCriteriaBuilder.java
Separates DISEASE_VARIANT into its own mapping to Case.DISEASE_VARIANT_VALUE, routes other case properties directly to caze.get(sortProperty.propertyName), and retains lowercasing only for external id/token/reference/details fields, while person-related mappings stay unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Survey Token Grid Boolean Rendering

Layer / File(s) Summary
Render boolean column with BooleanRenderer
sormas-ui/.../survey/SurveyTokenGrid.java
Imports BooleanRenderer and applies it to the RESPONSE_RECEIVED column in initColumns.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning SurveyTokenGrid's BooleanRenderer change is unrelated to the linked case-directory sorting fix. Remove or justify the SurveyTokenGrid change in this PR, or split it into a separate pull request.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: fixing case directory sorting issues.
Description check ✅ Passed The description follows the template by including the required issue reference with Fixes #14093.
Linked Issues check ✅ Passed The code changes address the reported case directory sorting bugs by correcting the sort-field mappings in CaseListCriteriaBuilder.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/14093-case-sorting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Pa-Touche Pa-Touche self-assigned this Jul 8, 2026
@Pa-Touche Pa-Touche changed the title 🐛: FIXED: Sorting issues case FIX: Sorting issues case directory Jul 9, 2026
@Pa-Touche Pa-Touche requested a review from raulbob July 9, 2026 04:36
@Pa-Touche Pa-Touche marked this pull request as ready for review July 9, 2026 04:36

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java (1)

298-324: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Sort mapping fix looks correct.

Breaking the previous fall-through to DISEASE_VARIANT_VALUE and mapping each case field to its own property via caze.get(sortProperty.propertyName) directly addresses the reported sorting issues. The split between direct mapping and cb.lower() for identifier-type text fields (external ID, tokens, case reference number) is consistent with the case-insensitive sorting already applied to person name fields. The DISEASE_VARIANTCase.DISEASE_VARIANT_VALUE mapping is correctly isolated.

Minor nit: the comment on line 302 (// case normal fields) has irregular leading whitespace.

✏️ Minor comment formatting cleanup
-		// 		case normal fields
+		// case normal fields
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java`
around lines 298 - 324, Clean up the inline comment formatting in
CaseListCriteriaBuilder’s sort-property switch by removing the irregular leading
whitespace in the “case normal fields” comment near the CaseIndexDto mappings;
keep the existing CaseIndexDto and CaseIndexDetailedDto branches unchanged and
only normalize the comment text/indentation for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java`:
- Around line 298-324: Clean up the inline comment formatting in
CaseListCriteriaBuilder’s sort-property switch by removing the irregular leading
whitespace in the “case normal fields” comment near the CaseIndexDto mappings;
keep the existing CaseIndexDto and CaseIndexDetailedDto branches unchanged and
only normalize the comment text/indentation for consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 27402158-71a2-4875-a696-8ab213e2b477

📥 Commits

Reviewing files that changed from the base of the PR and between 24f9e42 and 9fb3968.

📒 Files selected for processing (2)
  • sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/survey/SurveyTokenGrid.java

@Pa-Touche Pa-Touche merged commit 6d2eebe into development Jul 9, 2026
7 checks passed
@Pa-Touche Pa-Touche deleted the fix/14093-case-sorting branch July 9, 2026 10:02
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.

Sorting doesnt seem to sort properly for any categories - Case directory

2 participants