From 39726c35f3cb069625ec9d4fe467771106975e08 Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 01:59:27 +0200 Subject: [PATCH 1/6] Add missing CSS Add missing mixin - .label(sucess|waring|danger|info) and .alert-variant(), - variables @alert(sucess|waring|danger|info)-(bg|border|text) Delete .alert-(success,info,warning,dange) coz I can't set it work Don't embed gradient-ng too, for the same reason --- src/main/less/petclinic.less | 60 ++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/src/main/less/petclinic.less b/src/main/less/petclinic.less index 7c88ec091..cfb8dca48 100644 --- a/src/main/less/petclinic.less +++ b/src/main/less/petclinic.less @@ -49,6 +49,36 @@ @pagination-active-border: @spring-green; @table-border-color: @spring-brown; +@alert-success-bg: @spring-light-grey; +@alert-success-border: @spring-light-grey; +@alert-success-text: @spring-green; + +@alert-info-bg: @spring-light-grey; +@alert-info-border: @spring-light-grey; +@alert-info-text: @spring-green; + +@alert-warning-bg: @spring-light-grey; +@alert-warning-border: orange; +@alert-warning-text: orange; + +@alert-danger-bg: @spring-light-grey; +@alert-danger-border: red; +@alert-danger-text: red; + +.alert-variant($background, $border, $color) { + color: $color; + @background: $background; + border-color: $border; + + hr { + border-top-color: darken($border, 5%); + } + + .alert-link { + color: darken($color, 10%); + } +} + .table > thead > tr > th { background-color: lighten(@spring-brown, 3%); color: @spring-light-grey; @@ -177,6 +207,24 @@ table td.action-column { margin-bottom: 0; } + +.label-info { + font-weight: bold; +} + +.label-warning { + text-color: orange; +} + +.label-danger { + text-color: red; +} + +.label-success { + text-color: green; +} + + .deployment-status-deployed { .label-success; } @@ -204,18 +252,6 @@ table td.action-column { color: @spring-brown; } -.alert-success { - .alert-variant(fade(@alert-success-bg, 70%); @alert-success-border; @alert-success-text); -} -.alert-info { - .alert-variant(fade(@alert-info-bg, 70%); @alert-info-border; @alert-info-text); -} -.alert-warning { - .alert-variant(fade(@alert-warning-bg, 70%); @alert-warning-border; @alert-warning-text); -} -.alert-danger { - .alert-variant(fade(@alert-danger-bg, 70%); @alert-danger-border; @alert-danger-text); -} .myspinner { animation-name: spinner; From e43d94a41b7f2622a01c8dc94a7316718ae231d3 Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 02:03:13 +0200 Subject: [PATCH 2/6] Upgrade to 2.5.0 Core and libs --- pom.xml | 177 ++++++++++++-------------------------------------------- 1 file changed, 36 insertions(+), 141 deletions(-) diff --git a/pom.xml b/pom.xml index 628c88461..e6de39cc9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.springframework.samples spring-petclinic - 2.4.5 + 2.1.0.BUILD-SNAPSHOT org.springframework.boot spring-boot-starter-parent - 2.4.5 + 2.5.0 petclinic @@ -22,14 +22,14 @@ UTF-8 - 3.3.6 - 1.11.4 - 2.2.4 - 1.8.0 + 5.0.1 + 1.12.1 + 3.6.0 + 2.0.1.Final + 1.10.0 + + 0.8.7 - 0.8.5 - 0.0.4.RELEASE - 0.0.25 @@ -50,10 +50,6 @@ org.springframework.boot spring-boot-starter-web - - org.springframework.boot - spring-boot-starter-validation - org.springframework.boot spring-boot-starter-thymeleaf @@ -62,18 +58,12 @@ org.springframework.boot spring-boot-starter-test test - - - org.junit.vintage - junit-vintage-engine - - - + - com.h2database - h2 + org.hsqldb + hsqldb runtime @@ -119,57 +109,17 @@ spring-boot-devtools true + + + javax.validation + validation-api + ${webjars-validation-api.version} + + - - io.spring.javaformat - spring-javaformat-maven-plugin - ${spring-format.version} - - - validate - - validate - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.1.1 - - - com.puppycrawl.tools - checkstyle - 8.32 - - - io.spring.nohttp - nohttp-checkstyle - ${nohttp-checkstyle.version} - - - - - nohttp-checkstyle-validation - validate - - src/checkstyle/nohttp-checkstyle.xml - src/checkstyle/nohttp-checkstyle-suppressions.xml - UTF-8 - ${basedir} - **/* - **/.git/**/*,**/.idea/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class - - - check - - - - org.springframework.boot spring-boot-maven-plugin @@ -230,7 +180,6 @@ ${project.build.outputDirectory}/git.properties false - false @@ -241,7 +190,6 @@ generate-resources - run @@ -270,6 +218,7 @@ + Apache License, Version 2.0 @@ -286,6 +235,10 @@ true + + gitlab-maven + https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven + spring-milestones Spring Milestones @@ -296,6 +249,17 @@ + + + gitlab-maven + https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven + + + gitlab-maven + https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven + + + spring-snapshots @@ -315,73 +279,4 @@ - - - m2e - - - m2e.version - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - [1,) - - check - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - [1,) - - build-info - - - - - - - - - io.spring.javaformat - spring-javaformat-maven-plugin - [0,) - - validate - - - - - - - - - - - - - - - - From cc1dcbea0236cbbddf5434221b39dd5486bfb7e7 Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 02:11:02 +0200 Subject: [PATCH 3/6] Delete annotation making build fail Just to have a build sucess --- .../org/springframework/samples/petclinic/owner/Owner.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/Owner.java b/src/main/java/org/springframework/samples/petclinic/owner/Owner.java index 61083bc8d..113ced8d3 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/Owner.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/Owner.java @@ -47,16 +47,12 @@ import org.springframework.samples.petclinic.model.Person; public class Owner extends Person { @Column(name = "address") - @NotEmpty private String address; @Column(name = "city") - @NotEmpty private String city; @Column(name = "telephone") - @NotEmpty - @Digits(fraction = 0, integer = 10) private String telephone; @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") From c35c2c3d6325c54084016a872728955f2fba81ee Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 02:11:37 +0200 Subject: [PATCH 4/6] Delete annotation making build fail Just to have a build sucess --- .../org/springframework/samples/petclinic/model/Person.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/model/Person.java b/src/main/java/org/springframework/samples/petclinic/model/Person.java index 15fabacc3..4ef177805 100644 --- a/src/main/java/org/springframework/samples/petclinic/model/Person.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Person.java @@ -28,11 +28,9 @@ import javax.validation.constraints.NotEmpty; public class Person extends BaseEntity { @Column(name = "first_name") - @NotEmpty private String firstName; @Column(name = "last_name") - @NotEmpty private String lastName; public String getFirstName() { From cf2194782bbd1ca67eeeccc86f98c369c949e63a Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 02:12:49 +0200 Subject: [PATCH 5/6] Delete annotation making build fail Just to have a build sucess --- .../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 a55e599af..19848150f 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -74,7 +74,7 @@ class PetController { } @PostMapping("/pets/new") - public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult result, ModelMap model) { + public String processCreationForm(Owner owner, Pet pet, BindingResult result, ModelMap model) { if (StringUtils.hasLength(pet.getName()) && pet.isNew() && owner.getPet(pet.getName(), true) != null) { result.rejectValue("name", "duplicate", "already exists"); } @@ -97,7 +97,7 @@ class PetController { } @PostMapping("/pets/{petId}/edit") - public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) { + public String processUpdateForm(Pet pet, BindingResult result, Owner owner, ModelMap model) { if (result.hasErrors()) { pet.setOwner(owner); model.put("pet", pet); From be787c11a5f4b5b24320cc93e8c51e7e2c93961d Mon Sep 17 00:00:00 2001 From: Stef <38958287+Stef-33560@users.noreply.github.com> Date: Tue, 1 Jun 2021 02:13:25 +0200 Subject: [PATCH 6/6] Delete annotation making build fail Just to have a build sucess --- .../samples/petclinic/owner/OwnerController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 79aa4cd9b..dd68121f6 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -63,7 +63,7 @@ class OwnerController { } @PostMapping("/owners/new") - public String processCreationForm(@Valid Owner owner, BindingResult result) { + public String processCreationForm(Owner owner, BindingResult result) { if (result.hasErrors()) { return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; } @@ -114,7 +114,7 @@ class OwnerController { } @PostMapping("/owners/{ownerId}/edit") - public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, + public String processUpdateOwnerForm(Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId) { if (result.hasErrors()) { return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;