Skip to content

Owner controller#2355

Open
ky7721 wants to merge 6 commits intospring-projects:mainfrom
ky7721:OwnerController
Open

Owner controller#2355
ky7721 wants to merge 6 commits intospring-projects:mainfrom
ky7721:OwnerController

Conversation

@ky7721
Copy link
Copy Markdown

@ky7721 ky7721 commented Apr 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 18, 2026 09:04
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

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.

Comment on lines 77 to 86
@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();
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 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.

Copilot uses AI. Check for mistakes.
$spring-brown: #34302D;
$spring-grey: #838789;
$spring-light-grey: #f1f1f1;
$spring-white: #ffffff;
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.

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

Suggested change
$spring-white: #ffffff;
$spring-white: #ffffff;
$spring-light-grey: $spring-white;

Copilot uses AI. Check for mistakes.
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.");
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 flash error message has a typo (missing space) and reads awkwardly. Please fix the text so it’s readable for end users.

Suggested change
redirectAttributes.addFlashAttribute("error", "Errorcreating the owner.");
redirectAttributes.addFlashAttribute("error", "Error creating owner.");

Copilot uses AI. Check for mistakes.

Welcome to Pet Clinic

Spring Petclinic is a Spring Boot application built using Maven or Gradle.
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 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.

Suggested change
Spring Petclinic is a Spring Boot application built using Maven or Gradle.
Spring Petclinic is a Spring Boot application built using Maven or Gradle.

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.

2 participants