Pet controller update#2359
Conversation
Updated vet repository implementation
Update UI Text labels in vet list page
Update Owner List UI
Update the Successfull messages for PetControllerr
Signed-off-by: WJunn987 <[email protected]>
There was a problem hiding this comment.
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
PetControllerfor pet create/update actions. - Updated fallback (non-i18n) headings/labels in the vets list Thymeleaf template.
- Replaced the
VetRepositoryinterface 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.
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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.
| <th th:text="#{specialties}">Areas of Expertise</th> | |
| <th th:text="#{specialties}">Specialties</th> |
| redirectAttributes.addFlashAttribute("message", "Pet successfully added!"); | ||
| return "redirect:/owners/{ownerId}"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.