From 932855d6aa84c6ee4fda5818426debeda9165b06 Mon Sep 17 00:00:00 2001 From: Igor Baiborodine Date: Tue, 28 Aug 2018 21:43:56 -0400 Subject: [PATCH] Upgrade to Java 10, Vaadin 8.5.1, Spring Boot 2 --- pom.xml | 22 +++++++++---------- .../vaadinspring/JPetStore6Application.java | 6 ++--- .../vaadinspring/config/SecurityConfig.java | 16 ++++++++++++++ .../vaadinspring/ui/form/ProductItemForm.java | 2 +- .../VAADIN/themes/jpetstoretheme/styles.css | 7 ++---- 5 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/kiroule/jpetstore/vaadinspring/config/SecurityConfig.java diff --git a/pom.xml b/pom.xml index 4267557..5ffc6da 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ com.kiroule jpetstore-6-vaadin-spring-boot - 0.0.2-SNAPSHOT + 0.0.3-SNAPSHOT jar org.springframework.boot spring-boot-starter-parent - 1.5.4.RELEASE + 2.0.4.RELEASE @@ -19,14 +19,14 @@ JPetStore Vaadin 8 with Spring Boot - 8.3.0 + 8.5.1 3.0.0 ${vaadin.version} - 0.0.7.RELEASE + 2.0.0.RELEASE UTF-8 - 1.8 - 1.8 + 10 + 10 cdn @@ -93,7 +93,7 @@ org.vaadin.addon confirmdialog - 3.1.2 + 3.2.0 org.springframework.boot @@ -108,7 +108,7 @@ org.vaadin viritin - 2.3 + 2.6 @@ -119,7 +119,7 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 1.3.1 + 1.3.2 org.springframework.boot @@ -216,7 +216,7 @@ spring-boot-maven-plugin - + @@ -243,4 +243,4 @@ - + \ No newline at end of file diff --git a/src/main/java/com/kiroule/jpetstore/vaadinspring/JPetStore6Application.java b/src/main/java/com/kiroule/jpetstore/vaadinspring/JPetStore6Application.java index 24c1d54..2cea68b 100644 --- a/src/main/java/com/kiroule/jpetstore/vaadinspring/JPetStore6Application.java +++ b/src/main/java/com/kiroule/jpetstore/vaadinspring/JPetStore6Application.java @@ -1,16 +1,16 @@ package com.kiroule.jpetstore.vaadinspring; import com.kiroule.jpetstore.vaadinspring.config.DataSourceConfig; +import com.kiroule.jpetstore.vaadinspring.config.SecurityConfig; import com.kiroule.jpetstore.vaadinspring.config.ServiceConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration; import org.springframework.context.annotation.Import; import org.vaadin.spring.events.annotation.EnableEventBus; -@SpringBootApplication(exclude = {SecurityAutoConfiguration.class }) -@Import({DataSourceConfig.class, ServiceConfig.class}) +@SpringBootApplication +@Import({DataSourceConfig.class, ServiceConfig.class, SecurityConfig.class}) @EnableEventBus public class JPetStore6Application { diff --git a/src/main/java/com/kiroule/jpetstore/vaadinspring/config/SecurityConfig.java b/src/main/java/com/kiroule/jpetstore/vaadinspring/config/SecurityConfig.java new file mode 100644 index 0000000..8288359 --- /dev/null +++ b/src/main/java/com/kiroule/jpetstore/vaadinspring/config/SecurityConfig.java @@ -0,0 +1,16 @@ +package com.kiroule.jpetstore.vaadinspring.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +@EnableWebSecurity +@Configuration +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable().authorizeRequests().anyRequest().permitAll(); + } +} diff --git a/src/main/java/com/kiroule/jpetstore/vaadinspring/ui/form/ProductItemForm.java b/src/main/java/com/kiroule/jpetstore/vaadinspring/ui/form/ProductItemForm.java index fa9d48b..fe05de8 100644 --- a/src/main/java/com/kiroule/jpetstore/vaadinspring/ui/form/ProductItemForm.java +++ b/src/main/java/com/kiroule/jpetstore/vaadinspring/ui/form/ProductItemForm.java @@ -69,7 +69,7 @@ public void init() { .bind(Item::getListPrice, null); getBinder() .forField(quantity) - .withConverter(new StringToIntegerConverter(0, null)) + .withConverter(new StringToIntegerConverter(0, "Cannot convert quantity!")) .bind(Item::getQuantity, null); addToCartButton.addClickListener(event -> { UI.getCurrent().removeWindow(getPopup()); diff --git a/src/main/webapp/VAADIN/themes/jpetstoretheme/styles.css b/src/main/webapp/VAADIN/themes/jpetstoretheme/styles.css index 998e29c..a81af74 100644 --- a/src/main/webapp/VAADIN/themes/jpetstoretheme/styles.css +++ b/src/main/webapp/VAADIN/themes/jpetstoretheme/styles.css @@ -1016,10 +1016,6 @@ * @group upload */ -/** - * - */ - /** * @group window */ @@ -1081,7 +1077,7 @@ */ .v-vaadin-version:after { - content: "8.3.0"; + content: "8.5.1"; } .v-widget { @@ -12614,6 +12610,7 @@ div.v-layout.v-horizontal.v-widget { width: 100% !important; height: auto !important; padding: 9px; + display: inline-flex; } .jpetstoretheme .v-colorpicker-preview-textfield {