Skip to content

v1.2.0 LENEX import; improved disqualifications; meet manager file names for start lists#122

Merged
konrad2002 merged 3 commits intomasterfrom
develop
Dec 17, 2025
Merged

v1.2.0 LENEX import; improved disqualifications; meet manager file names for start lists#122
konrad2002 merged 3 commits intomasterfrom
develop

Conversation

@konrad2002
Copy link
Member

@konrad2002 konrad2002 commented Dec 17, 2025

Summary by CodeRabbit

  • New Features

    • Added LENEX File (LEF) format support to the import tool.
  • Bug Fixes

    • Fixed disqualification status display logic in start lists.
  • Enhancements

    • Improved file URL generation with enhanced placeholder handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@konrad2002 konrad2002 added this to the v1.2.0 milestone Dec 17, 2025
@konrad2002 konrad2002 self-assigned this Dec 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

This diff adds support for LEF (LENEX File) type imports to the admin import tool and enhances URL generation for padded number placeholders in the file service. It also refines file type conditional rendering and tightens disqualification validation logic while updating development environment API endpoints.

Changes

Cohort / File(s) Summary
Admin Import Tool Enhancement
src/app/content/admin/components/admin-import-tool/admin-import-tool.component.html, src/app/content/admin/components/admin-import-tool/admin-import-tool.component.ts
Added LEF file type option to fileTypeList. Updated template conditional logic to display LENEX File option when currentFileType equals 'lef', with remaining file type options (DSV, Startliste, Ergebnis) nested under else branch. Adjusted HTML formatting.
File Service URL Generation
src/app/core/service/api/meeting/file.service.ts
Enhanced getUrlFromMask() to support plain-number placeholders ("@@@") replacing with event value, and zero-padded placeholders ("#") with computed padding logic.
Start List Tile Component
src/app/content/starts/components/start-list-tile/start-list-tile.component.ts
Narrowed disqualification validation in getIcon() to check for both existence and type property before returning "close" icon.
Environment Configuration
src/environments/environment.ts
Updated api_urls mapping with localhost endpoints for meeting_service, athlete_service, start_service, and import_service, replacing prior prod URLs and placeholders.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • file.service.ts — The padding logic for zero-padded placeholders introduces moderately complex string manipulation; verify edge cases for empty strings and multiple padding scenarios.
  • admin-import-tool.component.html — Confirm conditional rendering of file type options works correctly for all branches (lef, dsv, and default cases).
  • environment.ts — Verify localhost endpoints are intended for development and won't break staging/production deployments.

Poem

🐰 A LEF file hops into the fold, with padding numbers squared and bold,
The admin tool now sorted neat, while URLs on localhost meet,
Disqualifications check with care—a rabbit's refactor, clean and fair! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the three main changes: LENEX import support, improved disqualifications handling, and meet manager file name support for start lists, all reflected in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c3acc0 and 1b119af.

📒 Files selected for processing (5)
  • src/app/content/admin/components/admin-import-tool/admin-import-tool.component.html (1 hunks)
  • src/app/content/admin/components/admin-import-tool/admin-import-tool.component.ts (1 hunks)
  • src/app/content/starts/components/start-list-tile/start-list-tile.component.ts (1 hunks)
  • src/app/core/service/api/meeting/file.service.ts (1 hunks)
  • src/environments/environment.ts (1 hunks)
🔇 Additional comments (7)
src/app/content/starts/components/start-list-tile/start-list-tile.component.ts (1)

84-89: Good defensive check!

The additional validation for disqualification.type prevents the "close" icon from being displayed when a disqualification object exists but lacks a type property. This aligns well with the similar check in getIconClass() at line 108.

src/app/content/admin/components/admin-import-tool/admin-import-tool.component.ts (1)

38-43: LGTM! LEF file type added correctly.

The new file type option follows the existing pattern and integrates properly with the template's conditional rendering logic.

src/app/core/service/api/meeting/file.service.ts (2)

47-48: LGTM! Plain-number placeholder added correctly.

The "@@@" placeholder provides a simple way to inject event numbers without zero-padding.


50-64: Verify truncation behavior for large event numbers.

The zero-padding logic uses slice(-n) which truncates event numbers that exceed the padding width. For example, with mask "file_###.pdf" and event number 1234, the result would be "file_234.pdf" (truncated).

Ensure this truncation is intentional. If event numbers can legitimately exceed the padding width, consider handling overflow:

Option 1: Use the full event number when it exceeds padding width:

-    mask = mask.replace("$", s.slice(-n));
+    const padded = s.slice(-n);
+    const final = event.toString().length > n ? event.toString() : padded;
+    mask = mask.replace("$", final);

Option 2: Document the truncation behavior if intentional.

src/app/content/admin/components/admin-import-tool/admin-import-tool.component.html (2)

10-15: Improved formatting.

The multi-line formatting for mat-radio-button elements improves readability without changing functionality.


20-32: LGTM! LEF file type handling implemented correctly.

The conditional rendering logic cleanly separates the LEF file type (showing only "LENEX File") from the existing file types while preserving their original behavior.

src/environments/environment.ts (1)

6-26: The localhost URLs in environment.ts are development-only and will not affect production builds. The production configuration in angular.json correctly replaces environment.ts with environment.prod.ts (which contains the proper https://api.swimresults.de endpoints) during production builds. This change is safe to merge to master.

Likely an incorrect or invalid review comment.


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

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/content/starts/components/start-list-tile/start-list-tile.component.ts (1)

159-172: Add null check for disqualification.type.

The method directly accesses this.data.disqualification.type at line 160 without verifying that the type property exists. Given the tightened validation in getIcon() (line 87), this method could be called when a disqualification object exists but lacks a type property, leading to a runtime error.

Apply this diff to add a safe check:

 getReason() {
+  if (!this.data.disqualification?.type) {
+    return this.data.disqualification?.reason || "Disqualifiziert!";
+  }
   if (this.data.disqualification.type == "dns") {
     return "Nicht am Start!"
   }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c3acc0 and 1b119af.

📒 Files selected for processing (5)
  • src/app/content/admin/components/admin-import-tool/admin-import-tool.component.html (1 hunks)
  • src/app/content/admin/components/admin-import-tool/admin-import-tool.component.ts (1 hunks)
  • src/app/content/starts/components/start-list-tile/start-list-tile.component.ts (1 hunks)
  • src/app/core/service/api/meeting/file.service.ts (1 hunks)
  • src/environments/environment.ts (1 hunks)
🔇 Additional comments (7)
src/app/content/starts/components/start-list-tile/start-list-tile.component.ts (1)

84-89: Good defensive check!

The additional validation for disqualification.type prevents the "close" icon from being displayed when a disqualification object exists but lacks a type property. This aligns well with the similar check in getIconClass() at line 108.

src/app/content/admin/components/admin-import-tool/admin-import-tool.component.ts (1)

38-43: LGTM! LEF file type added correctly.

The new file type option follows the existing pattern and integrates properly with the template's conditional rendering logic.

src/app/core/service/api/meeting/file.service.ts (2)

47-48: LGTM! Plain-number placeholder added correctly.

The "@@@" placeholder provides a simple way to inject event numbers without zero-padding.


50-64: Verify truncation behavior for large event numbers.

The zero-padding logic uses slice(-n) which truncates event numbers that exceed the padding width. For example, with mask "file_###.pdf" and event number 1234, the result would be "file_234.pdf" (truncated).

Ensure this truncation is intentional. If event numbers can legitimately exceed the padding width, consider handling overflow:

Option 1: Use the full event number when it exceeds padding width:

-    mask = mask.replace("$", s.slice(-n));
+    const padded = s.slice(-n);
+    const final = event.toString().length > n ? event.toString() : padded;
+    mask = mask.replace("$", final);

Option 2: Document the truncation behavior if intentional.

src/app/content/admin/components/admin-import-tool/admin-import-tool.component.html (2)

10-15: Improved formatting.

The multi-line formatting for mat-radio-button elements improves readability without changing functionality.


20-32: LGTM! LEF file type handling implemented correctly.

The conditional rendering logic cleanly separates the LEF file type (showing only "LENEX File") from the existing file types while preserving their original behavior.

src/environments/environment.ts (1)

6-26: The localhost URLs in environment.ts are development-only and will not affect production builds. The production configuration in angular.json correctly replaces environment.ts with environment.prod.ts (which contains the proper https://api.swimresults.de endpoints) during production builds. This change is safe to merge to master.

Likely an incorrect or invalid review comment.

@konrad2002 konrad2002 merged commit 5175042 into master Dec 17, 2025
11 checks passed
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.

1 participant