From 708288e2ce188ef75bc30387d630b1d7c7448e89 Mon Sep 17 00:00:00 2001 From: kkky83 Date: Fri, 17 Apr 2026 16:02:13 +0800 Subject: [PATCH 01/16] Update OwnerController.java --- .../samples/petclinic/owner/OwnerController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index 199ca361190..02eb5d799dd 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -82,7 +82,7 @@ public String processCreationForm(@Valid Owner owner, BindingResult result, Redi } this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "New Owner Created"); + redirectAttributes.addFlashAttribute("message", "Owner Created Successfully"); return "redirect:/owners/" + owner.getId(); } @@ -142,7 +142,7 @@ public String initUpdateOwnerForm() { public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId, RedirectAttributes redirectAttributes) { if (result.hasErrors()) { - redirectAttributes.addFlashAttribute("error", "There was an error in updating the owner."); + redirectAttributes.addFlashAttribute("error", "Error updating the owner."); return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; } @@ -154,7 +154,7 @@ public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @ owner.setId(ownerId); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "Owner Values Updated"); + redirectAttributes.addFlashAttribute("message", "Owner Values Updated Successfully"); return "redirect:/owners/{ownerId}"; } From da1f7a4bb8d14a72c21342e37a73305ebb6295f9 Mon Sep 17 00:00:00 2001 From: kkky83 Date: Sat, 18 Apr 2026 16:14:19 +0800 Subject: [PATCH 02/16] Change UI color --- src/main/scss/petclinic.scss | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/scss/petclinic.scss b/src/main/scss/petclinic.scss index 7f3e64ed25a..a48216f9ac8 100644 --- a/src/main/scss/petclinic.scss +++ b/src/main/scss/petclinic.scss @@ -17,12 +17,12 @@ $icon-font-path: "../../webjars/bootstrap/fonts/"; $spring-green: #6db33f; $spring-dark-green: #5fa134; -$spring-brown: #34302D; +$spring-black: #000000; $spring-grey: #838789; $spring-light-grey: #f1f1f1; $body-bg: $spring-light-grey; -$text-color: $spring-brown; +$text-color: $spring-black; $link-color: $spring-dark-green; $link-hover-color: $spring-dark-green; @@ -39,21 +39,21 @@ $border-radius-large: 0; $border-radius-small: 0; $nav-tabs-active-link-hover-color: $spring-light-grey; -$nav-tabs-active-link-hover-bg: $spring-brown; -$nav-tabs-active-link-hover-border-color: $spring-brown; -$nav-tabs-border-color: $spring-brown; +$nav-tabs-active-link-hover-bg: $spring-black; +$nav-tabs-active-link-hover-border-color: $spring-black; +$nav-tabs-border-color: $spring-black; -$pagination-active-bg: $spring-brown; +$pagination-active-bg: $spring-black; $pagination-active-border: $spring-green; -$table-border-color: $spring-brown; +$table-border-color: $spring-black; .table > thead > tr > th { - background-color: lighten($spring-brown, 3%); + background-color: lighten($spring-black, 3%); color: $spring-light-grey; } .table-filter { - background-color: $spring-brown; + background-color: $spring-black; padding: 9px 12px; } From 19c5f467e3f83b16672291dd1ce8150f755bdefa Mon Sep 17 00:00:00 2001 From: kkky83 Date: Sat, 18 Apr 2026 16:15:47 +0800 Subject: [PATCH 03/16] Change UI color --- src/main/scss/petclinic.scss | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/scss/petclinic.scss b/src/main/scss/petclinic.scss index a48216f9ac8..fdffff8592a 100644 --- a/src/main/scss/petclinic.scss +++ b/src/main/scss/petclinic.scss @@ -17,20 +17,20 @@ $icon-font-path: "../../webjars/bootstrap/fonts/"; $spring-green: #6db33f; $spring-dark-green: #5fa134; -$spring-black: #000000; +$spring-brown: #34302D; $spring-grey: #838789; -$spring-light-grey: #f1f1f1; +$spring-white: #ffffff; -$body-bg: $spring-light-grey; -$text-color: $spring-black; +$body-bg: $spring-white; +$text-color: $spring-brown; $link-color: $spring-dark-green; $link-hover-color: $spring-dark-green; -$navbar-default-link-color: $spring-light-grey; -$navbar-default-link-active-color: $spring-light-grey; -$navbar-default-link-hover-color: $spring-light-grey; +$navbar-default-link-color: $spring-white; +$navbar-default-link-active-color: $spring-white; +$navbar-default-link-hover-color: $spring-white; $navbar-default-link-hover-bg: $spring-green; -$navbar-default-toggle-icon-bar-bg: $spring-light-grey; +$navbar-default-toggle-icon-bar-bg: $spring-white; $navbar-default-toggle-hover-bg: transparent; $navbar-default-link-active-bg: $spring-green; @@ -38,22 +38,22 @@ $border-radius-base: 0; $border-radius-large: 0; $border-radius-small: 0; -$nav-tabs-active-link-hover-color: $spring-light-grey; -$nav-tabs-active-link-hover-bg: $spring-black; -$nav-tabs-active-link-hover-border-color: $spring-black; -$nav-tabs-border-color: $spring-black; +$nav-tabs-active-link-hover-color: $spring-white; +$nav-tabs-active-link-hover-bg: $spring-brown; +$nav-tabs-active-link-hover-border-color: $spring-brown; +$nav-tabs-border-color: $spring-brown; -$pagination-active-bg: $spring-black; +$pagination-active-bg: $spring-brown; $pagination-active-border: $spring-green; -$table-border-color: $spring-black; +$table-border-color: $spring-brown; .table > thead > tr > th { - background-color: lighten($spring-black, 3%); - color: $spring-light-grey; + background-color: lighten($spring-brown, 3%); + color: $spring-white; } .table-filter { - background-color: $spring-black; + background-color: $spring-brown; padding: 9px 12px; } @@ -181,7 +181,7 @@ table td.action-column { .container-details-table th { background-color: lighten($spring-brown, 3%); - color: $spring-light-grey; + color: $spring-white; } .status-help-content-table td { From 13db3eebfa8eb313c33a045ffd74a55fd8a82fc8 Mon Sep 17 00:00:00 2001 From: kkky83 Date: Sat, 18 Apr 2026 16:33:19 +0800 Subject: [PATCH 04/16] Add Welcome text --- src/main/resources/banner.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt index 6225d1208c0..53e1b5e909a 100644 --- a/src/main/resources/banner.txt +++ b/src/main/resources/banner.txt @@ -11,5 +11,10 @@ |___| |_______| |___| |_______|_______|___|_| |__|___|_______| / / / / ==================================================================/_/_/_/ +Welcome to Pet Clinic + +Spring Petclinic is a Spring Boot application built using Maven or Gradle. +Java 17 or later is required for the build, and the application can run with Java 17 or newer. + :: Built with Spring Boot :: ${spring-boot.version} From deca6f15d4523f1c816247f8dfdaf86edc4fed56 Mon Sep 17 00:00:00 2001 From: kkky83 Date: Sat, 18 Apr 2026 16:47:45 +0800 Subject: [PATCH 05/16] Change message --- .../samples/petclinic/owner/OwnerController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index 199ca361190..c8a91677461 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -77,7 +77,7 @@ public String initCreationForm() { @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; } @@ -142,7 +142,7 @@ public String initUpdateOwnerForm() { public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId, RedirectAttributes redirectAttributes) { if (result.hasErrors()) { - redirectAttributes.addFlashAttribute("error", "There was an error in updating the owner."); + redirectAttributes.addFlashAttribute("error", "Error updating the owner."); return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; } @@ -154,7 +154,7 @@ public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @ owner.setId(ownerId); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "Owner Values Updated"); + redirectAttributes.addFlashAttribute("message", "Owner Values Updated Successfully"); return "redirect:/owners/{ownerId}"; } From b774500eb5e57c6aee3f205dc28a978680ae5675 Mon Sep 17 00:00:00 2001 From: cheokkairen Date: Sun, 19 Apr 2026 00:10:16 +0800 Subject: [PATCH 06/16] Updated vet repository implementation --- .../samples/petclinic/vet/VetRepository.java | 111 ++++++++++-------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java index dbf68d02972..d2dfb437f54 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java @@ -1,58 +1,69 @@ -/* - * Copyright 2012-2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.springframework.samples.petclinic.vet; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.dao.DataAccessException; +import java.util.List; + import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import org.springframework.data.repository.Repository; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Collection; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; /** - * Repository class for Vet domain objects All method names are compliant - * with Spring Data naming conventions so this interface can easily be extended for Spring - * Data. See: - * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation - * - * @author Ken Krebs * @author Juergen Hoeller - * @author Sam Brannen - * @author Michael Isvy + * @author Mark Fisher + * @author Ken Krebs + * @author Arjen Poutsma */ -public interface VetRepository extends Repository { - - /** - * Retrieve all Vets from the data store. - * @return a Collection of Vets - */ - @Transactional(readOnly = true) - @Cacheable("vets") - Collection findAll() throws DataAccessException; - - /** - * Retrieve all Vets from data store in Pages - * @param pageable - * @return - * @throws DataAccessException - */ - @Transactional(readOnly = true) - @Cacheable("vets") - Page findAll(Pageable pageable) throws DataAccessException; - -} +@Controller +class VetController { + + private static final int PAGE_SIZE = 5; + + private final VetRepository vetRepository; + + public VetController(VetRepository vetRepository) { + this.vetRepository = vetRepository; + } + + @GetMapping("/vets.html") + public String showVetList(@RequestParam(defaultValue = "1") int page, Model model) { + int currentPage = Math.max(page, 1); + + // Here we are returning an object of type 'Vets' rather than a collection of Vet + // objects so it is simpler for Object-Xml mapping + Vets vets = new Vets(); + Page paginated = findPaginated(currentPage); + vets.getVetList().addAll(paginated.toList()); + + return addPaginationModel(currentPage, paginated, model); + } + + private String addPaginationModel(int page, Page paginated, Model model) { + List listVets = paginated.getContent(); + model.addAttribute("currentPage", page); + model.addAttribute("totalPages", paginated.getTotalPages()); + model.addAttribute("totalItems", paginated.getTotalElements()); + model.addAttribute("listVets", listVets); + model.addAttribute("hasNext", paginated.hasNext()); + model.addAttribute("hasPrevious", paginated.hasPrevious()); + return "vets/vetList"; + } + + private Page findPaginated(int page) { + Pageable pageable = PageRequest.of(page - 1, PAGE_SIZE); + return vetRepository.findAll(pageable); + } + + @GetMapping({ "/vets" }) + public @ResponseBody Vets showResourcesVetList() { + // Here we are returning an object of type 'Vets' rather than a collection of Vet + // objects so it is simpler for JSon/Object mapping + Vets vets = new Vets(); + vets.getVetList().addAll(this.vetRepository.findAll()); + return vets; + } + +} \ No newline at end of file From 94fc35a4a047fca415e4697e7ffe70a9fa162268 Mon Sep 17 00:00:00 2001 From: cheokkairen Date: Sun, 19 Apr 2026 00:48:45 +0800 Subject: [PATCH 07/16] Update UI Text labels in vet list page --- src/main/resources/templates/vets/vetList.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/vets/vetList.html b/src/main/resources/templates/vets/vetList.html index e40fd654e47..3e8ba811227 100644 --- a/src/main/resources/templates/vets/vetList.html +++ b/src/main/resources/templates/vets/vetList.html @@ -4,13 +4,13 @@ -

Veterinarians

+

Veterinarian Directory

- - + + From a0fa874f3e54f701a7ed7b74638319b3e0d07d32 Mon Sep 17 00:00:00 2001 From: cheokkairen Date: Sun, 19 Apr 2026 01:51:22 +0800 Subject: [PATCH 08/16] Update Owner List UI --- src/main/resources/templates/owners/ownersList.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/owners/ownersList.html b/src/main/resources/templates/owners/ownersList.html index 01223c1c57a..a458f6605d3 100644 --- a/src/main/resources/templates/owners/ownersList.html +++ b/src/main/resources/templates/owners/ownersList.html @@ -4,13 +4,13 @@ -

Owners

+

Pet Owners Directory

NameSpecialtiesVeterinarian NameAreas of Expertise
- - + + From b38e86a9adcb8856598993787e43ccc5f8564d2a Mon Sep 17 00:00:00 2001 From: WeiJunOng Date: Sun, 19 Apr 2026 02:00:31 +0800 Subject: [PATCH 09/16] Update the Successfull messages for PetController --- .../samples/petclinic/owner/PetController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index e0689c694f1..7b3c006b548 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -121,7 +121,7 @@ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult res owner.addPet(pet); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "New Pet has been Added"); + redirectAttributes.addFlashAttribute("message", "Pet successfully added!"); return "redirect:/owners/{ownerId}"; } @@ -154,7 +154,7 @@ public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult resul } updatePetDetails(owner, pet); - redirectAttributes.addFlashAttribute("message", "Pet details has been edited"); + redirectAttributes.addFlashAttribute("message", "Pet updated successfully!"); return "redirect:/owners/{ownerId}"; } From 6ae96274d292ab9792126e37e5e7fbcbc47a070a Mon Sep 17 00:00:00 2001 From: cheokkairen Date: Sun, 19 Apr 2026 02:08:43 +0800 Subject: [PATCH 10/16] Add CI pipeline using Github Actions --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..365ab20372b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: Java CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Build with Maven + run: mvn clean install \ No newline at end of file From efd79411ebc74c8ab36b118fbc8880e561d7832a Mon Sep 17 00:00:00 2001 From: WeiJunOng Date: Sun, 19 Apr 2026 02:14:52 +0800 Subject: [PATCH 11/16] Update Pet Controller Add Successfull Msg --- .../samples/petclinic/owner/PetController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index e0689c694f1..c9de2c0a9ec 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -121,7 +121,7 @@ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult res owner.addPet(pet); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "New Pet has been Added"); + redirectAttributes.addFlashAttribute("message", "Pet Added Successfully!"); return "redirect:/owners/{ownerId}"; } @@ -154,7 +154,7 @@ public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult resul } updatePetDetails(owner, pet); - redirectAttributes.addFlashAttribute("message", "Pet details has been edited"); + redirectAttributes.addFlashAttribute("message", "Pet updated successfully!"); return "redirect:/owners/{ownerId}"; } From 6fbd3da6d6284c4729e1e292b8120285497576ae Mon Sep 17 00:00:00 2001 From: cheokkairen Date: Sun, 19 Apr 2026 02:17:18 +0800 Subject: [PATCH 12/16] Fix VetRepository class definition --- .../samples/petclinic/vet/VetRepository.java | 111 ++++++++---------- 1 file changed, 50 insertions(+), 61 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java index d2dfb437f54..dbf68d02972 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java @@ -1,69 +1,58 @@ +/* + * Copyright 2012-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.samples.petclinic.vet; -import java.util.List; - +import org.springframework.cache.annotation.Cacheable; +import org.springframework.dao.DataAccessException; import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.data.repository.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collection; /** - * @author Juergen Hoeller - * @author Mark Fisher + * Repository class for Vet domain objects All method names are compliant + * with Spring Data naming conventions so this interface can easily be extended for Spring + * Data. See: + * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation + * * @author Ken Krebs - * @author Arjen Poutsma + * @author Juergen Hoeller + * @author Sam Brannen + * @author Michael Isvy */ -@Controller -class VetController { - - private static final int PAGE_SIZE = 5; - - private final VetRepository vetRepository; - - public VetController(VetRepository vetRepository) { - this.vetRepository = vetRepository; - } - - @GetMapping("/vets.html") - public String showVetList(@RequestParam(defaultValue = "1") int page, Model model) { - int currentPage = Math.max(page, 1); - - // Here we are returning an object of type 'Vets' rather than a collection of Vet - // objects so it is simpler for Object-Xml mapping - Vets vets = new Vets(); - Page paginated = findPaginated(currentPage); - vets.getVetList().addAll(paginated.toList()); - - return addPaginationModel(currentPage, paginated, model); - } - - private String addPaginationModel(int page, Page paginated, Model model) { - List listVets = paginated.getContent(); - model.addAttribute("currentPage", page); - model.addAttribute("totalPages", paginated.getTotalPages()); - model.addAttribute("totalItems", paginated.getTotalElements()); - model.addAttribute("listVets", listVets); - model.addAttribute("hasNext", paginated.hasNext()); - model.addAttribute("hasPrevious", paginated.hasPrevious()); - return "vets/vetList"; - } - - private Page findPaginated(int page) { - Pageable pageable = PageRequest.of(page - 1, PAGE_SIZE); - return vetRepository.findAll(pageable); - } - - @GetMapping({ "/vets" }) - public @ResponseBody Vets showResourcesVetList() { - // Here we are returning an object of type 'Vets' rather than a collection of Vet - // objects so it is simpler for JSon/Object mapping - Vets vets = new Vets(); - vets.getVetList().addAll(this.vetRepository.findAll()); - return vets; - } - -} \ No newline at end of file +public interface VetRepository extends Repository { + + /** + * Retrieve all Vets from the data store. + * @return a Collection of Vets + */ + @Transactional(readOnly = true) + @Cacheable("vets") + Collection findAll() throws DataAccessException; + + /** + * Retrieve all Vets from data store in Pages + * @param pageable + * @return + * @throws DataAccessException + */ + @Transactional(readOnly = true) + @Cacheable("vets") + Page findAll(Pageable pageable) throws DataAccessException; + +} From 9be2311786f4078abf3100101590e34bf254df56 Mon Sep 17 00:00:00 2001 From: kkky83 Date: Sun, 19 Apr 2026 04:37:10 +0800 Subject: [PATCH 13/16] Change UI color --- src/main/scss/petclinic.scss | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/scss/petclinic.scss b/src/main/scss/petclinic.scss index fdffff8592a..e754ce71ef5 100644 --- a/src/main/scss/petclinic.scss +++ b/src/main/scss/petclinic.scss @@ -17,12 +17,12 @@ $icon-font-path: "../../webjars/bootstrap/fonts/"; $spring-green: #6db33f; $spring-dark-green: #5fa134; -$spring-brown: #34302D; +$spring-black: #000000; $spring-grey: #838789; -$spring-white: #ffffff; +$spring-white: #ffffff; $body-bg: $spring-white; -$text-color: $spring-brown; +$text-color: $spring-black; $link-color: $spring-dark-green; $link-hover-color: $spring-dark-green; @@ -39,21 +39,21 @@ $border-radius-large: 0; $border-radius-small: 0; $nav-tabs-active-link-hover-color: $spring-white; -$nav-tabs-active-link-hover-bg: $spring-brown; -$nav-tabs-active-link-hover-border-color: $spring-brown; -$nav-tabs-border-color: $spring-brown; +$nav-tabs-active-link-hover-bg: $spring-black; +$nav-tabs-active-link-hover-border-color: $spring-black; +$nav-tabs-border-color: $spring-black; -$pagination-active-bg: $spring-brown; +$pagination-active-bg: $spring-black; $pagination-active-border: $spring-green; -$table-border-color: $spring-brown; +$table-border-color: $spring-black; .table > thead > tr > th { - background-color: lighten($spring-brown, 3%); + background-color: lighten($spring-black, 3%); color: $spring-white; } .table-filter { - background-color: $spring-brown; + background-color: $spring-black; padding: 9px 12px; } @@ -66,7 +66,7 @@ $table-border-color: $spring-brown; border-width: 2px; transition: border 0.15s; color: $spring-light-grey; - background: $spring-brown; + background: $spring-black; border-color: $spring-green; -webkit-transition: border 0.15s; -moz-transition: border 0.15s; @@ -78,8 +78,8 @@ $table-border-color: $spring-brown; &:active, &.active, .open .dropdown-toggle { - background-color: $spring-brown; - border-color: $spring-brown; + background-color: $spring-black; + border-color: $spring-black; } } @@ -128,7 +128,7 @@ h1 { .splash { background: $spring-green; - color: $spring-brown; + color: $spring-black; display: none; } @@ -180,12 +180,12 @@ table td.action-column { } .container-details-table th { - background-color: lighten($spring-brown, 3%); + background-color: lighten($spring-black, 3%); color: $spring-white; } .status-help-content-table td { - color: $spring-brown; + color: $spring-black; } .logo { @@ -206,7 +206,7 @@ table td.action-column { } hr { - border-top: 1px dotted $spring-brown; + border-top: 1px dotted $spring-black; } @import "typography.scss"; From 39a503dff2d12ca6013884ade680c733c9c118df Mon Sep 17 00:00:00 2001 From: WeiJunOng Date: Sun, 19 Apr 2026 12:58:05 +0800 Subject: [PATCH 14/16] Updated Pet Controller Successfull Msg --- .../samples/petclinic/owner/PetController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index e0689c694f1..a96a2839af3 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -121,7 +121,7 @@ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult res owner.addPet(pet); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "New Pet has been Added"); + redirectAttributes.addFlashAttribute("message", "Pet Added Successfully!"); return "redirect:/owners/{ownerId}"; } @@ -154,7 +154,7 @@ public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult resul } updatePetDetails(owner, pet); - redirectAttributes.addFlashAttribute("message", "Pet details has been edited"); + redirectAttributes.addFlashAttribute("message", "Pet details has been updated Successfully!"); return "redirect:/owners/{ownerId}"; } From 685c8280e4ebc715ae69c372917725254308dcf2 Mon Sep 17 00:00:00 2001 From: SushiJk Date: Sun, 19 Apr 2026 13:03:18 +0800 Subject: [PATCH 15/16] Update UI for ownerDetail --- src/main/resources/templates/owners/ownerDetails.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/owners/ownerDetails.html b/src/main/resources/templates/owners/ownerDetails.html index cc175cd1315..a90e8014f71 100644 --- a/src/main/resources/templates/owners/ownerDetails.html +++ b/src/main/resources/templates/owners/ownerDetails.html @@ -16,19 +16,19 @@

Owner Information

NameAddressOwner NameHome Address City Telephone Pets
- + - + - + - +
NameOwner's Name
AddressOwner's Address
CityOwner's City
TelephoneOwner's Telephone
From 4fef4346eb0421a4b087d0e5ba244fc260f5d40b Mon Sep 17 00:00:00 2001 From: WeiJunOng Date: Sun, 19 Apr 2026 13:59:01 +0800 Subject: [PATCH 16/16] Updated PetController Success Msg --- .../samples/petclinic/owner/PetController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index e0689c694f1..5468235100d 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -121,7 +121,7 @@ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult res owner.addPet(pet); this.owners.save(owner); - redirectAttributes.addFlashAttribute("message", "New Pet has been Added"); + redirectAttributes.addFlashAttribute("message", "Pet added successfully."); return "redirect:/owners/{ownerId}"; } @@ -154,7 +154,7 @@ public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult resul } updatePetDetails(owner, pet); - redirectAttributes.addFlashAttribute("message", "Pet details has been edited"); + redirectAttributes.addFlashAttribute("message", "Pet details updated successfully."); return "redirect:/owners/{ownerId}"; }