Owner controller#2355
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates parts of the Owner workflow messaging, adjusts global UI color variables in the main SCSS, and expands the application startup banner text.
Changes:
- Updated OwnerController flash messages for owner create/update flows.
- Switched several SCSS theme variables from a light grey background to white.
- Added descriptive “Welcome” and runtime/build requirements text to the Spring Boot startup banner.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/main/scss/petclinic.scss |
Updates core color variables (light grey → white) used by Bootstrap/theme styling. |
src/main/resources/banner.txt |
Adds extra banner lines describing the app and Java requirement. |
src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java |
Adjusts user-facing flash messages for owner creation and update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @PostMapping("/owners/new") | ||
| public String processCreationForm(@Valid Owner owner, BindingResult result, RedirectAttributes redirectAttributes) { | ||
| if (result.hasErrors()) { | ||
| redirectAttributes.addFlashAttribute("error", "There was an error in creating the owner."); | ||
| redirectAttributes.addFlashAttribute("error", "Errorcreating the owner."); | ||
| return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; | ||
| } | ||
|
|
||
| this.owners.save(owner); | ||
| redirectAttributes.addFlashAttribute("message", "New Owner Created"); | ||
| redirectAttributes.addFlashAttribute("message", "Owner Created Successfully"); | ||
| return "redirect:/owners/" + owner.getId(); |
There was a problem hiding this comment.
PR title suggests this change is limited to the Owner controller, but the PR also modifies global styling (petclinic.scss) and the startup banner (banner.txt). Consider splitting these into separate PRs or updating the PR title/description to reflect the full scope.
| $spring-brown: #34302D; | ||
| $spring-grey: #838789; | ||
| $spring-light-grey: #f1f1f1; | ||
| $spring-white: #ffffff; |
There was a problem hiding this comment.
$spring-light-grey was removed, but it’s still referenced later in this stylesheet (e.g., .btn-primary text color). This will cause SCSS compilation to fail due to an undefined variable. Either keep $spring-light-grey defined (possibly mapping it to $spring-white) or update the remaining references to use an existing color variable.
| $spring-white: #ffffff; | |
| $spring-white: #ffffff; | |
| $spring-light-grey: $spring-white; |
| public String processCreationForm(@Valid Owner owner, BindingResult result, RedirectAttributes redirectAttributes) { | ||
| if (result.hasErrors()) { | ||
| redirectAttributes.addFlashAttribute("error", "There was an error in creating the owner."); | ||
| redirectAttributes.addFlashAttribute("error", "Errorcreating the owner."); |
There was a problem hiding this comment.
The flash error message has a typo (missing space) and reads awkwardly. Please fix the text so it’s readable for end users.
| redirectAttributes.addFlashAttribute("error", "Errorcreating the owner."); | |
| redirectAttributes.addFlashAttribute("error", "Error creating owner."); |
|
|
||
| Welcome to Pet Clinic | ||
|
|
||
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. |
There was a problem hiding this comment.
The added banner line has trailing whitespace at the end of the sentence. Please remove the trailing space to avoid noisy diffs and formatting issues in some terminals/editors.
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. | |
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. |
No description provided.