Skip to content

Fix sorting by dates#1033

Open
SzBeni2003 wants to merge 2 commits intostagingfrom
fix/sort-by-date
Open

Fix sorting by dates#1033
SzBeni2003 wants to merge 2 commits intostagingfrom
fix/sort-by-date

Conversation

@SzBeni2003
Copy link
Copy Markdown
Contributor

@SzBeni2003 SzBeni2003 commented Apr 25, 2026

I also changed every renderer of Int and Long properties to number

Summary by CodeRabbit

  • Bug Fixes
    • Improved numeric field rendering and display consistency across admin data tables (prices, scores, quantities, etc.).
    • Enhanced time field sorting and formatting for better accuracy and readability in admin overviews.
    • Fixed date sorting behavior to ensure proper chronological ordering in admin interfaces.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

The PR systematically updates @GenerateOverview annotations across 25+ entity and DTO files to explicitly specify numeric and temporal renderers. Additionally, the Tabulator sorter configuration for DATE and TIME types is adjusted from specialized sorters to numeric sorting while maintaining datetime/time formatters.

Changes

Cohort / File(s) Summary
Tabulator Sorter Configuration
backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt
Updated OverviewType.DATE sorter from "datetime" to "number" and OverviewType.TIME sorter from "time" to "number", while retaining datetime/time formatters.
Debt Component Entities
backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/DebtsByGroupVirtualEntity.kt, DebtsByUserVirtualEntity.kt, ProductEntity.kt, SoldProductEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for numeric amount/price fields (total, notPayed, notFinished, price).
Challenge & Task Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/challenge/ChallengeSubmissionEntity.kt, task/SubmittedTaskEntity.kt, task/TaskEntity.kt, task/TaskCategoryEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for score and categoryId fields.
Leaderboard DTOs
backend/src/main/kotlin/hu/bme/sch/cmsch/component/leaderboard/LeaderBoardAsGroupEntryDto.kt, LeaderBoardAsUserEntryDto.kt
Added OverviewType import and updated @GenerateOverview annotations for score fields (taskScore, riddleScore, challengeScore, tokenScore, totalScore) with explicit renderer = OverviewType.NUMBER.
Location Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/location/LocationEntity.kt, WaypointEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for coordinate and accuracy fields (longitude, latitude, accuracy).
Race Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/FreestyleRaceRecordEntity.kt, RaceRecordEntity.kt
Added explicit renderer = OverviewType.TIME to @GenerateOverview annotations for time fields.
Riddle Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleCategoryEntity.kt, RiddleMappingVirtualEntity.kt, RiddleStatsVirtualEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for numeric fields (categoryId, category, attempt, completed, hintsUsed).
Token Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenListByGroupVirtualEntity.kt, TokenListByUserVirtualEntity.kt, TokenStatVirtualEntity.kt, TokenVirtualEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for token/score fields (tokens, count, score).
Communities & Form Components
backend/src/main/kotlin/hu/bme/sch/cmsch/component/communities/TinderCommunityVirtualEntity.kt, form/FormVirtualEntity.kt
Added explicit renderer = OverviewType.NUMBER to @GenerateOverview annotations for numeric interaction and form submission fields (likes, dislikes, limit, submitted, accepted, rejected, validated).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • cmsch#1017: Both PRs apply the same pattern of explicitly setting renderer = OverviewType.NUMBER in @GenerateOverview annotations across entity files to standardize overview rendering configuration.

Suggested reviewers

  • albi005
  • Isti01

Poem

🐰 Numbers now render with clarity,
Dates sort numeric, no ambiguity,
Annotations precise, our overview shines bright,
Twenty-five files aligned just right!
A rabbit hops through consistent changes with glee ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fix sorting by dates' only addresses one aspect of the changeset (date/time sorting), but the PR predominantly adds NUMBER renderers to 40+ numeric fields across many entities. Consider a title like 'Add explicit NUMBER renderer to numeric fields and fix date/time sorting' to better reflect the primary scope of changes throughout the codebase.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/sort-by-date

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt (1)

107-107: Nit: missing space after comma.

OverviewType.NUMBER,columnName is inconsistent with the other annotation argument separators on the same line (and across the rest of the PR). Pure cosmetic.

✏️ Proposed fix
-    `@property`:GenerateOverview(renderer = OverviewType.NUMBER,columnName = "Pont", order = 5, centered = true)
+    `@property`:GenerateOverview(renderer = OverviewType.NUMBER, columnName = "Pont", order = 5, centered = true)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt`
at line 107, The annotation argument list for the property GenerateOverview is
missing a space after the comma between the renderer and columnName arguments;
update the annotation on SubmittedTaskEntity (the `@property`:GenerateOverview
entry) to use consistent spacing (renderer = OverviewType.NUMBER, columnName =
"Pont", order = 5, centered = true) so it matches the project's formatting
conventions.
backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt (1)

13-14: TIME and NUMBER are now functionally identical — consider consolidating or differentiating.

After this change both entries have sorter = "number" and the same formatSettings = arrayOf("vertAlign" to "middle"). Two equivalent enum values invite drift and confuse readers ("why is this field tagged TIME instead of NUMBER?").

Two reasonable directions:

  • If TIME is meant to be visually distinct (e.g., 12.34500:12.345), give it a real formatter via formatterParams so it differs from NUMBER.
  • Otherwise, drop TIME and switch the race time fields (RaceRecordEntity, FreestyleRaceRecordEntity, RaceEntryDto) to OverviewType.NUMBER.

Not blocking for this PR, but worth a follow-up so the enum stays meaningful.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt` around
lines 13 - 14, The enum entries TIME and NUMBER in OverviewType are currently
identical (both use sorter="number" and formatSettings arrayOf("vertAlign" to
"middle")), so either consolidate or differentiate: either remove TIME and
update callers (fields in RaceRecordEntity, FreestyleRaceRecordEntity,
RaceEntryDto that reference OverviewType.TIME) to use OverviewType.NUMBER, or
keep TIME and give it a distinct formatter by adding appropriate
formatterParams/formatSettings to OverviewType.TIME to render numeric seconds as
a clock string (e.g., minutes:seconds.millis) so it differs from NUMBER; locate
the enum entries TIME and NUMBER and then update the enum or the three
referencing types (RaceRecordEntity, FreestyleRaceRecordEntity, RaceEntryDto)
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt`:
- Line 9: The DATE column currently uses sorter="number" but formatValue passes
the raw Long (value ?: 0) which may be in milliseconds while the frontend
timestampFormatter (luxon.DateTime.fromSeconds) expects seconds; update the
backend to ensure DATE field values are seconds—either by converting
milliseconds to seconds (divide by 1000) inside the formatValue path for the
DATE enum entry or ensure the source that populates DATE already emits seconds;
locate the DATE enum entry and the formatValue handling around it in
GenerateOverview.kt and add the conversion/validation so the frontend receives
seconds-consistent timestamps.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.kt`:
- Line 48: The GenerateOverview annotation on the price property now correctly
sets renderer = OverviewType.NUMBER but there is an order collision: both the
price property and the name property use order = 1; update one of the
annotations (the `@property`:GenerateOverview on either the price or name property
in ProductEntity) to a unique order value to ensure deterministic column
ordering in the overview, e.g., increment one of the order values so each column
has a distinct order.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.kt`:
- Line 68: The OverviewType.TIME entry is missing a formatter so elapsed seconds
show raw floats; fix by adding a formatter (e.g., add `"formatter" to
"duration"`) to the TIME enum entry in the OverviewType declaration (so TIME
becomes something like TIME("time", "number", arrayOf("vertAlign" to "middle",
"formatter" to "duration"))), or alternatively change the `@GenerateOverview` use
on the RaceRecordEntity property to a different OverviewType that matches your
intended display (e.g., OverviewType.NUMBER) if a duration formatter isn't
supported.

---

Nitpick comments:
In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt`:
- Around line 13-14: The enum entries TIME and NUMBER in OverviewType are
currently identical (both use sorter="number" and formatSettings
arrayOf("vertAlign" to "middle")), so either consolidate or differentiate:
either remove TIME and update callers (fields in RaceRecordEntity,
FreestyleRaceRecordEntity, RaceEntryDto that reference OverviewType.TIME) to use
OverviewType.NUMBER, or keep TIME and give it a distinct formatter by adding
appropriate formatterParams/formatSettings to OverviewType.TIME to render
numeric seconds as a clock string (e.g., minutes:seconds.millis) so it differs
from NUMBER; locate the enum entries TIME and NUMBER and then update the enum or
the three referencing types (RaceRecordEntity, FreestyleRaceRecordEntity,
RaceEntryDto) accordingly.

In
`@backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt`:
- Line 107: The annotation argument list for the property GenerateOverview is
missing a space after the comma between the renderer and columnName arguments;
update the annotation on SubmittedTaskEntity (the `@property`:GenerateOverview
entry) to use consistent spacing (renderer = OverviewType.NUMBER, columnName =
"Pont", order = 5, centered = true) so it matches the project's formatting
conventions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc2428bf-431f-494c-93d7-ca7a7f10d73d

📥 Commits

Reviewing files that changed from the base of the PR and between 634dc59 and 5b86b97.

📒 Files selected for processing (24)
  • backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/challenge/ChallengeSubmissionEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/communities/TinderCommunityVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/DebtsByGroupVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/DebtsByUserVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/SoldProductEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/form/FormVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/leaderboard/LeaderBoardAsGroupEntryDto.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/leaderboard/LeaderBoardAsUserEntryDto.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/location/LocationEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/location/WaypointEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/FreestyleRaceRecordEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleCategoryEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleMappingVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/riddle/RiddleStatsVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/SubmittedTaskEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskCategoryEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenListByGroupVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenListByUserVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenStatVirtualEntity.kt
  • backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenVirtualEntity.kt

ID("id", "number", arrayOf("width" to 100, "vertAlign" to "middle", "visible" to false)),
TEXT("text", "string", arrayOf("vertAlign" to "middle")),
DATE("date", "datetime", arrayOf("vertAlign" to "middle", "formatter" to "datetime")),
DATE("date", "number", arrayOf("vertAlign" to "middle", "formatter" to "datetime")),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Look at how DATE/datetime columns are wired on the frontend side and whether
# any formatterParams / inputFormat is supplied for Tabulator.
fd -t f -e ts -e tsx -e js -e jsx | xargs rg -nP -C3 '\b(Tabulator|formatter\s*[:=]\s*["'\'']datetime|inputFormat)\b' 2>/dev/null

Repository: kir-dev/cmsch

Length of output: 50370


🌐 Web query:

Tabulator datetime formatter unix timestamp inputFormat formatterParams

💡 Result:

The Tabulator "datetime" formatter does not natively support Unix timestamps via inputFormat. Official docs for versions up to 6.4 show inputFormat expects Luxon format strings (e.g., "yyyy-MM-dd HH:mm") or "iso", but no "unix" option. In older versions using Moment.js (pre-5.0), "unix" worked unofficially due to Moment's flexible parsing of the 'x' token, but Luxon requires DateTime.fromMillis(value) for milliseconds since Unix epoch. Use a custom formatter function for Unix timestamps (assumed milliseconds; multiply by 1000 if seconds): { title: "Time", field: "timestamp", formatter: function(cell, formatterParams) { const value = cell.getValue; const dt = luxon.DateTime.fromMillis(value); return dt.isValid ? dt.toFormat(formatterParams.outputFormat || "yyyy-MM-dd HH:mm") : (formatterParams.invalidPlaceholder || "(invalid date)"); }, formatterParams: { outputFormat: "DD/MM/YY HH:mm", invalidPlaceholder: "(invalid date)" } } Include luxon.js before Tabulator. Ensure luxon.DateTime is globally available (e.g., window.DateTime = luxon.DateTime if using modules). This approach is confirmed in Stack Overflow discussions and GitHub issues for Tabulator 5.x+; no built-in Unix support in recent docs (6.4).

Citations:


🏁 Script executed:

# Find frontend files that might configure Tabulator columns
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -path "*/frontend/*" -o -path "*/src/main/resources/static/*" | head -20

Repository: kir-dev/cmsch

Length of output: 1159


🏁 Script executed:

# Search for column configurations that reference "DATE" or Tabulator column definitions
rg -i "column.*datetime|formatter.*datetime|DATE.*column" --type ts --type tsx --type js --type jsx -A 5 2>/dev/null | head -100

Repository: kir-dev/cmsch

Length of output: 39


🏁 Script executed:

# Look for where the column definitions from the backend are used in the frontend
rg -i "formatvalue|sorter|formatter" --type ts --type tsx --type js --type jsx -B 2 -A 2 2>/dev/null | head -150

Repository: kir-dev/cmsch

Length of output: 39


🏁 Script executed:

# Check if admin-script-4.js exists and read it
wc -l backend/src/main/resources/static/js/admin-script-4.js

Repository: kir-dev/cmsch

Length of output: 116


🏁 Script executed:

# Search for column configuration or formatter references in static JS files
rg "formatter|inputFormat|formatValue|datetime" backend/src/main/resources/static/js/ -A 3 -B 1 2>/dev/null | head -200

Repository: kir-dev/cmsch

Length of output: 50370


🏁 Script executed:

# Look for how the column array from backend is used in the frontend
rg -i "columns\s*[:=]|addColumn|setColumns" backend/src/main/resources/static/js/ 2>/dev/null | head -50

Repository: kir-dev/cmsch

Length of output: 50370


🏁 Script executed:

cat -n backend/src/main/resources/static/js/admin-script-4.js

Repository: kir-dev/cmsch

Length of output: 10877


🏁 Script executed:

find backend/src/main/resources -name "*.html" -o -name "*.ftl" | head -20

Repository: kir-dev/cmsch

Length of output: 1485


🏁 Script executed:

# Search for where Tabulator is used with columns
rg -i "new Tabulator|setColumns|tabulator" backend/src/main/resources/ -l 2>/dev/null | head -10

Repository: kir-dev/cmsch

Length of output: 313


🏁 Script executed:

# Search specifically in template files for column or formatter references
rg -i "formatter.*datetime|columns.*date" backend/src/main/resources/ -B 2 -A 2 2>/dev/null | head -100

Repository: kir-dev/cmsch

Length of output: 50370


🏁 Script executed:

grep -n "timestampFormatter\|function timestampFormatter" backend/src/main/resources/templates/overview4.html -A 15 | head -60

Repository: kir-dev/cmsch

Length of output: 1518


🏁 Script executed:

# Check if there's any documentation or comments about the timestamp format
grep -n "Long\|timestamp\|millisecond\|second" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt | head -20

Repository: kir-dev/cmsch

Length of output: 39


🏁 Script executed:

# Look for how dates are stored/formatted elsewhere in the codebase
rg "DateTime\.|System.currentTimeMillis\|Instant\." backend/src/main/kotlin/hu/bme/sch/cmsch/ --type kotlin -B 2 -A 2 | head -80

Repository: kir-dev/cmsch

Length of output: 2961


🏁 Script executed:

# Search for how DATE fields are populated in the data
rg "formatValue.*DATE\|case DATE\|\"date\"" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/ -B 3 -A 3 | head -60

Repository: kir-dev/cmsch

Length of output: 39


🏁 Script executed:

# Check the OverviewField and how values are formatted
rg "enum class OverviewField\|formatValue" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt -B 2 -A 5 | head -80

Repository: kir-dev/cmsch

Length of output: 39


🏁 Script executed:

# Let me read the GenerateOverview.kt file directly to see formatValue and DATE handling
sed -n '1,100p' backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt

Repository: kir-dev/cmsch

Length of output: 1905


🏁 Script executed:

# Check the entire file for the formatValue and DATE sections
grep -n "formatValue\|enum class\|DATE\(" backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt | head -30

Repository: kir-dev/cmsch

Length of output: 81


Sorting is fixed, but verify the timestamp units match between backend and frontend formatter.

The change to sorter="number" correctly fixes sorting for the DATE column. However, formatValue passes raw Long values unchanged (value ?: 0), and the frontend uses a custom timestampFormatter that expects values in seconds (luxon.DateTime.fromSeconds(value)). If the backend sends timestamps in milliseconds instead, dates will render incorrectly despite sorting working. Confirm that all DATE field values are populated in seconds, not milliseconds, to avoid display issues.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/admin/GenerateOverview.kt` at line
9, The DATE column currently uses sorter="number" but formatValue passes the raw
Long (value ?: 0) which may be in milliseconds while the frontend
timestampFormatter (luxon.DateTime.fromSeconds) expects seconds; update the
backend to ensure DATE field values are seconds—either by converting
milliseconds to seconds (divide by 1000) inside the formatValue path for the
DATE enum entry or ensure the source that populates DATE already emits seconds;
locate the DATE enum entry and the formatValue handling around it in
GenerateOverview.kt and add the conversion/validation so the frontend receives
seconds-consistent timestamps.

@field:JsonView(value = [ Edit::class, Preview::class, FullDetails::class ])
@property:GenerateInput(type = InputType.NUMBER, order = 2, label = "Ár", min = 1, defaultValue = "100", note = "JMF-ben természetesen")
@property:GenerateOverview(columnName = "Ár", order = 1, centered = true)
@property:GenerateOverview(renderer = OverviewType.NUMBER, columnName = "Ár", order = 1, centered = true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

LGTM on the renderer change; unrelated pre-existing order collision worth noting.

The added renderer = OverviewType.NUMBER is correct. Unrelated to this diff: price (line 48) and name (line 41) both use order = 1, which can cause non-deterministic column ordering in the overview. Pre-existing — feel free to address separately if intentional ordering is desired.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/debt/ProductEntity.kt` at
line 48, The GenerateOverview annotation on the price property now correctly
sets renderer = OverviewType.NUMBER but there is an order collision: both the
price property and the name property use order = 1; update one of the
annotations (the `@property`:GenerateOverview on either the price or name property
in ProductEntity) to a unique order value to ensure deterministic column
ordering in the overview, e.g., increment one of the order values so each column
has a distinct order.

@property:GenerateInput(type = InputType.FLOAT3, order = 4, label = "Mért idő", defaultValue = "0.0",
note = "Másodpercben kell megadni, és ponttal (.) van elválasztva, nem vesszővel! 3 tizedes pontig lehet megadni pontosságot.")
@property:GenerateOverview(columnName = "Idő", order = 4, centered = true)
@property:GenerateOverview(renderer = OverviewType.TIME, columnName = "Idő", order = 4, centered = true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect the OverviewType.TIME enum entry to see its formatter/sorter config
fd -t f 'GenerateOverview.kt' | xargs -I {} sh -c 'echo "=== {} ==="; cat "{}"'

Repository: kir-dev/cmsch

Length of output: 1980


OverviewType.TIME has no formatter configured—raw float seconds will display as raw numbers.

The OverviewType.TIME enum entry defines TIME("time", "number", arrayOf("vertAlign" to "middle")) with no formatter parameter, unlike DATE which explicitly includes "formatter" to "datetime". This means the raw float value (e.g., 83.456 for 1 minute 23.456 seconds) will display as-is in the admin interface rather than formatted as human-readable time. The sorter="number" change ensures correct sorting, but without a formatter, the display will not render the elapsed seconds in the intended format. Either configure a formatter for TIME or choose a different OverviewType that doesn't imply formatting not actually applied.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/src/main/kotlin/hu/bme/sch/cmsch/component/race/RaceRecordEntity.kt`
at line 68, The OverviewType.TIME entry is missing a formatter so elapsed
seconds show raw floats; fix by adding a formatter (e.g., add `"formatter" to
"duration"`) to the TIME enum entry in the OverviewType declaration (so TIME
becomes something like TIME("time", "number", arrayOf("vertAlign" to "middle",
"formatter" to "duration"))), or alternatively change the `@GenerateOverview` use
on the RaceRecordEntity property to a different OverviewType that matches your
intended display (e.g., OverviewType.NUMBER) if a duration formatter isn't
supported.

@SzBeni2003 SzBeni2003 linked an issue Apr 25, 2026 that may be closed by this pull request
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.

Event sorting in OneDeepEntityPage is not working

1 participant