Add favicon, fix ticket creator display, and enable demo seed profile - #45
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe pull request adds a favicon resource declaration to the page layout and modifies the ticket view template to replace dynamic username display with a static "Ticket creator" label, removing runtime rendering of creator identity from the ticket header. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/resources/application.properties (1)
32-32: Consider externalizing the active profile configuration.Hardcoding
spring.profiles.active=demomeans the demo profile will always be active by default, which could cause demo data to load in unintended environments (e.g., shared dev or CI).Best practice: set the active profile via environment variable or command-line argument.
♻️ Recommended approach
Remove the hardcoded profile from
application.properties:-spring.profiles.active=demoThen activate the demo profile when needed:
Option 1 - Environment variable:
SPRING_PROFILES_ACTIVE=demo ./mvnw spring-boot:runOption 2 - Command-line argument:
./mvnw spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=demoOption 3 - IDE run configuration:
SetSPRING_PROFILES_ACTIVE=demoin your IDE's environment variables for the run configuration.This gives each developer and environment explicit control over whether demo data loads.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/resources/application.properties` at line 32, The application.properties currently hardcodes spring.profiles.active=demo which forces the demo profile in all environments; remove that line (or comment it out) so no default profile is forced, and rely on external activation mechanisms (SPRING_PROFILES_ACTIVE env var, --spring.profiles.active CLI arg, or IDE run configuration) to enable the demo profile when needed; ensure any demo-specific config is placed in application-demo.properties so it only applies when the demo profile is explicitly activated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/jte/layout.jte`:
- Line 13: Update the favicon link tag in layout.jte so the declared MIME type
matches the asset: replace type="image/x-icon" with type="image/png" (or remove
the type attribute) for the <link rel="icon" href="/favicon.png"> element, and
verify that /favicon.png is present in the static resources (e.g.,
src/main/resources/static) so the link does not 404.
In `@src/main/jte/view.jte`:
- Around line 177-179: The template now renders a static "Ticket creator" label
but doesn't show the reporter identity; add a reporter/creator field to the DTO
and render it here: add e.g. reporterUsername or creatorDisplayName to
TicketViewDTO (set from ticket.getReporter() ?
ticket.getReporter().getUsername() : "Anonymous" at construction time to avoid
lazy-loading in the template), update the code that builds TicketViewDTO to
populate that field from Ticket.getReporter(), and change the template
(view.jte) to render that new reporterUsername/creatorDisplayName value instead
of the literal text "Ticket creator".
---
Nitpick comments:
In `@src/main/resources/application.properties`:
- Line 32: The application.properties currently hardcodes
spring.profiles.active=demo which forces the demo profile in all environments;
remove that line (or comment it out) so no default profile is forced, and rely
on external activation mechanisms (SPRING_PROFILES_ACTIVE env var,
--spring.profiles.active CLI arg, or IDE run configuration) to enable the demo
profile when needed; ensure any demo-specific config is placed in
application-demo.properties so it only applies when the demo profile is
explicitly activated.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9bbeefa6-937e-44b1-aa94-1c138808ab15
⛔ Files ignored due to path filters (1)
src/main/resources/static/favicon.pngis excluded by!**/*.png
📒 Files selected for processing (3)
src/main/jte/layout.jtesrc/main/jte/view.jtesrc/main/resources/application.properties
| <div class="text-xs font-bold mb-1 text-gray-700"> | ||
| Ticket creator | ||
| </div> |
There was a problem hiding this comment.
Static label does not actually display the ticket creator — contradicts the PR objective.
The PR description states this change "ensures the correct ticket creator is shown as the sender (instead of the currently logged-in user) in the first message". However, the new markup only renders the literal text Ticket creator as a caption — it no longer renders any identity at all. Previously the bug was which user was shown; now no user is shown, which is arguably a regression in information density rather than a fix.
Per the cross-file context, Ticket has a reporter field (src/main/java/org/example/alfs/entities/Ticket.java:66-68), but that value isn't exposed through TicketViewDTO or otherwise wired into this template, which is likely why the dynamic display was dropped.
To genuinely fulfill the PR objective, expose the creator (e.g. add a reporterUsername / creatorDisplayName field on TicketViewDTO, populated from ticket.getReporter(), falling back to "Anonymous" when null) and render it here. Sketch:
🛠️ Suggested change (requires DTO update)
- <div class="text-xs font-bold mb-1 text-gray-700">
- Ticket creator
- </div>
+ <div class="text-xs font-bold mb-1 text-gray-700">
+ ${ticket.getReporterUsername() != null ? ticket.getReporterUsername() : "Anonymous"}
+ </div>And in TicketViewDTO, populate reporterUsername from ticket.getReporter() != null ? ticket.getReporter().getUsername() : null at construction time (avoid touching the lazy reporter association in the template — it's FetchType.LAZY).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/jte/view.jte` around lines 177 - 179, The template now renders a
static "Ticket creator" label but doesn't show the reporter identity; add a
reporter/creator field to the DTO and render it here: add e.g. reporterUsername
or creatorDisplayName to TicketViewDTO (set from ticket.getReporter() ?
ticket.getReporter().getUsername() : "Anonymous" at construction time to avoid
lazy-loading in the template), update the code that builds TicketViewDTO to
populate that field from Ticket.getReporter(), and change the template
(view.jte) to render that new reporterUsername/creatorDisplayName value instead
of the literal text "Ticket creator".
There was a problem hiding this comment.
We kept this as a temporary solution to avoid larger DTO/test changes right before the presentation. Showing the real reporter requires backend updates as well, so we chose a safe static label for now and might handle the full fix later..
There was a problem hiding this comment.
@addee1, that makes complete sense — avoiding risky DTO/test churn right before a presentation is a pragmatic call. The static label is a safe placeholder for now.
Would you like me to open a follow-up GitHub issue to track the full fix (adding reporterUsername to TicketViewDTO and rendering it in view.jte)? That way it won't get lost after the presentation.
( ˶ᵔ ᵕ ᵔ˶ ) 🐇
✏️ Learnings added
Learnt from: addee1
Repo: ithsjava25/project-backend-alfs PR: 45
File: src/main/jte/view.jte:177-179
Timestamp: 2026-04-25T16:15:06.335Z
Learning: In `ithsjava25/project-backend-alfs` (`src/main/jte/view.jte`, ticket description panel), the "Ticket creator" label is intentionally static/hardcoded as a temporary pre-presentation workaround. The real fix requires exposing `reporterUsername` (from `Ticket.getReporter()`) on `TicketViewDTO` and rendering it in the template. Do not re-flag the missing dynamic creator display as a new issue — it is a known, deferred item.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: FionaSprinkles
Repo: ithsjava25/project-backend-alfs PR: 11
File: src/main/java/org/example/alfs/services/TicketService.java:50-54
Timestamp: 2026-04-09T13:26:48.849Z
Learning: In `ithsjava25/project-backend-alfs`, the IDOR vulnerability in `TicketService.getTicketById()` (and the `GET /view/id/{id}` endpoint in `TicketController`) is a known, intentionally deferred issue. Authorization/ownership checks will be added in a future PR when authentication and authorization are implemented. Do not re-flag this as a new issue.
Description:
This PR includes a few UI and development improvements for the ticket view and local setup.
Changes made
spring.profiles.active=demoto
application.propertiesThis makes local development easier since test users, tickets, and related demo data are loaded automatically on startup.
Summary by CodeRabbit
New Features
Style