Skip to content

Add favicon, fix ticket creator display, and enable demo seed profile - #45

Merged
FionaSprinkles merged 6 commits into
mainfrom
feature/first-message-fix
Apr 26, 2026
Merged

Add favicon, fix ticket creator display, and enable demo seed profile#45
FionaSprinkles merged 6 commits into
mainfrom
feature/first-message-fix

Conversation

@addee1

@addee1 addee1 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Description:

This PR includes a few UI and development improvements for the ticket view and local setup.

Changes made

  • Added a custom favicon for the ALFS Whistleblower System
  • Fixed the ticket description message so the correct ticket creator is shown as the sender instead of the currently logged-in user
  • Enabled automatic demo seed data loading by adding:
spring.profiles.active=demo

to application.properties

This makes local development easier since test users, tickets, and related demo data are loaded automatically on startup.

Summary by CodeRabbit

  • New Features

    • Added favicon to the application.
  • Style

    • Updated ticket header to display a static creator label.

@addee1
addee1 requested a review from FionaSprinkles April 25, 2026 16:08
@coderabbitai

coderabbitai Bot commented Apr 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e23565db-c079-4950-9580-e6508586b23d

📥 Commits

Reviewing files that changed from the base of the PR and between f874484 and b419b24.

📒 Files selected for processing (1)
  • src/main/jte/layout.jte
✅ Files skipped from review due to trivial changes (1)
  • src/main/jte/layout.jte

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
JTE Template Updates
src/main/jte/layout.jte, src/main/jte/view.jte
Favicon link added to page head. Ticket creator display changed from conditional username rendering (with "Anonymous" fallback) to static "Ticket creator" label.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • FionaSprinkles

Poem

🐰✨ A favicon sparkles bright,
Making pages look just right!
No more names in headers shown,
Just "Ticket creator" shines alone—
Templates dressed in cleaner light! 🎀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions three distinct changes (favicon, ticket creator display, and demo seed profile), all of which are confirmed in the file-level summaries and PR objectives.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/first-message-fix

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.

@addee1
addee1 requested a review from simonforsberg April 25, 2026 16:09
@addee1 addee1 self-assigned this Apr 25, 2026

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

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=demo means 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=demo

Then activate the demo profile when needed:

Option 1 - Environment variable:

SPRING_PROFILES_ACTIVE=demo ./mvnw spring-boot:run

Option 2 - Command-line argument:

./mvnw spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=demo

Option 3 - IDE run configuration:
Set SPRING_PROFILES_ACTIVE=demo in 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

📥 Commits

Reviewing files that changed from the base of the PR and between cb445e4 and f874484.

⛔ Files ignored due to path filters (1)
  • src/main/resources/static/favicon.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • src/main/jte/layout.jte
  • src/main/jte/view.jte
  • src/main/resources/application.properties

Comment thread src/main/jte/layout.jte Outdated
Comment thread src/main/jte/view.jte
Comment on lines +177 to 179
<div class="text-xs font-bold mb-1 text-gray-700">
Ticket creator
</div>

@coderabbitai coderabbitai Bot Apr 25, 2026

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 | 🟠 Major

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".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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..

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/main/resources/application.properties Outdated
@addee1
addee1 requested a review from FionaSprinkles April 25, 2026 21:50
@FionaSprinkles
FionaSprinkles merged commit 3e27a4f into main Apr 26, 2026
3 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.

2 participants