Skip to content

Pet controller update#2359

Open
WJunn987 wants to merge 12 commits intospring-projects:mainfrom
ky7721:PetControllerUpdate
Open

Pet controller update#2359
WJunn987 wants to merge 12 commits intospring-projects:mainfrom
ky7721:PetControllerUpdate

Conversation

@WJunn987
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings April 18, 2026 18:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates user-facing text and attempts to adjust the vets listing behavior in the PetClinic web UI.

Changes:

  • Updated flash messages in PetController for pet create/update actions.
  • Updated fallback (non-i18n) headings/labels in the vets list Thymeleaf template.
  • Replaced the VetRepository interface with controller code (currently breaking the vets module structure).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/main/resources/templates/vets/vetList.html Changes fallback headings/column labels for the vets list view.
src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java Rewrites the repository file into a controller implementation (causes compilation/structure issues).
src/main/java/org/springframework/samples/petclinic/owner/PetController.java Adjusts success flash messages after pet create/update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1 to 3
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

This file drops the standard Apache 2.0 license header that is present on other Java sources in this repo. If this wasn’t intentional, please restore the header to match the project’s licensing/contribution requirements.

Copilot uses AI. Check for mistakes.
<th th:text="#{name}">Name</th>
<th th:text="#{specialties}">Specialties</th>
<th th:text="#{name}">Veterinarian Name</th>
<th th:text="#{specialties}">Areas of Expertise</th>
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The fallback text changes (e.g., “Veterinarian Directory”, “Veterinarian Name”) won’t be shown at runtime because th:text replaces the element content with the value from the message bundle keys (vets, name, specialties). If the intent is to change the UI labels, update the corresponding entries in src/main/resources/messages/messages*.properties or introduce new message keys.

Suggested change
<th th:text="#{specialties}">Areas of Expertise</th>
<th th:text="#{specialties}">Specialties</th>

Copilot uses AI. Check for mistakes.
Comment on lines +124 to 125
redirectAttributes.addFlashAttribute("message", "Pet successfully added!");
return "redirect:/owners/{ownerId}";
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

PR title suggests only a PetController change, but this PR also includes vet UI template updates and a major rewrite of VetRepository.java (introducing a controller). Please align the PR title/description with the actual scope, or split the unrelated changes into separate PRs for reviewability.

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 29
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

VetRepository.java no longer declares VetRepository (the Spring Data repository interface) and instead defines a second top-level VetController. This will break compilation (unresolved VetRepository type and duplicate VetController with VetController.java). Restore this file to the repository interface (including findAll()/findAll(Pageable)), and keep/move controller logic to VetController.java only.

Copilot uses AI. Check for mistakes.
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.

4 participants