From a282e2a506e0cd115b601b59d2a953ced51b4adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:36:53 +0100 Subject: [PATCH 01/19] Arreglo de las dependencias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se ha añadido la dependencia de hsqldb para arreglar los problemas con el datasource --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 60be53522..3b5040d10 100644 --- a/pom.xml +++ b/pom.xml @@ -135,6 +135,12 @@ spring-boot-devtools true + + org.hsqldb + hsqldb + 2.5.1 + runtime + From bec8a51b81447b2eb519d57720674bf678b5948e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:53:20 +0100 Subject: [PATCH 02/19] Arreglos travis --- pom.xml | 6 ------ src/main/resources/application-mysql.properties | 3 +-- src/main/resources/application.properties | 1 + 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 3b5040d10..60be53522 100644 --- a/pom.xml +++ b/pom.xml @@ -135,12 +135,6 @@ spring-boot-devtools true - - org.hsqldb - hsqldb - 2.5.1 - runtime - diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index ccc6807c3..a2a4c4998 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -1,12 +1,11 @@ # database init, supports mysql too database=mysql -spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} +#spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} spring.datasource.username=${MYSQL_USER:cheapy} spring.datasource.password=${MYSQL_PASS:cheapy} # SQL is written to be idempotent so this is safe spring.datasource.initialization-mode=always -spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.javax.persistence.schema-generation.drop-source=metadata # Naming strategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c93d5eac7..03c2f5c98 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,6 +4,7 @@ database=mysql spring.datasource.data=classpath*:db/${database}/data.sql spring.h2.console.enabled=true spring.profiles.active=mysql +spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} # Web spring.thymeleaf.mode=HTML From ff9ced2fdd6a74f187e886b53c94469612ebbdba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:58:41 +0100 Subject: [PATCH 03/19] Arreglos para travis --- .../cheapy/configuration/SecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java index 2fbdc84ad..00a18f6c5 100644 --- a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java +++ b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java @@ -27,7 +27,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - @Autowired + @Autowired(required = true) DataSource dataSource; From d6c31ae90d1b34ac72d285ad5f55d6f840590fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:03:25 +0100 Subject: [PATCH 04/19] Arreglos travis --- .../cheapy/configuration/SecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java index 00a18f6c5..094b2ba9d 100644 --- a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java +++ b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java @@ -27,7 +27,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - @Autowired(required = true) + @Autowired(required = false) DataSource dataSource; From d0d9084c79b230bfdf4cdb03f2319512e09ce193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:13:21 +0100 Subject: [PATCH 05/19] Arreglos travis --- .../cheapy/configuration/SecurityConfiguration.java | 2 +- src/main/resources/application.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java index 094b2ba9d..2fbdc84ad 100644 --- a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java +++ b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java @@ -27,7 +27,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - @Autowired(required = false) + @Autowired DataSource dataSource; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 03c2f5c98..3962c5e57 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,6 +5,7 @@ spring.datasource.data=classpath*:db/${database}/data.sql spring.h2.console.enabled=true spring.profiles.active=mysql spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # Web spring.thymeleaf.mode=HTML From 3372f6e046bfbec2929e7151496400f846f051b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:49:28 +0200 Subject: [PATCH 06/19] cambios a postgres --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0ab78aad..f32f00d86 100644 --- a/pom.xml +++ b/pom.xml @@ -140,7 +140,11 @@ spring-boot-devtools true - + + org.postgresql + postgresql + runtime + From 145dbeeaa9bd9679121380f03ebd481a82940566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:57:22 +0200 Subject: [PATCH 07/19] postgres --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3962c5e57..5f1cb5d17 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,7 +5,7 @@ spring.datasource.data=classpath*:db/${database}/data.sql spring.h2.console.enabled=true spring.profiles.active=mysql spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.driver-class-name=org.postgresql.Driver # Web spring.thymeleaf.mode=HTML From 3334dd7ed4072ba642ff56a58bd8fca997d230e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Fri, 2 Apr 2021 23:17:52 +0200 Subject: [PATCH 08/19] Arreglos codacy --- .travis.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10ce67e89..4ebe860be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,21 @@ language: java jdk: oraclejdk8 services: - mysql +cache: + directories: + - "$HOME/.m2" +before_cache: + - rm -rf $HOME/.m2/repository/com/autentia/traviscodacy +before_install: + - sudo apt-get install jq + - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url) + - chmod +x mvnw + - mysql -e 'CREATE DATABASE cheapy;' + - sudo apt-get update install: - ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -before_install: -- chmod +x mvnw -- mysql -e 'CREATE DATABASE cheapy;' -- sudo apt-get update -script: - - mvn test -Dspring.profiles.active=mysql-travis + - pip install codacy-coverage + +after_success: + - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco/jacoco.xml From db424bca8c284682f341290a68e0494bfc954be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Fri, 2 Apr 2021 23:18:58 +0200 Subject: [PATCH 09/19] Arreglos codacy --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ebe860be..39a70b87e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,6 @@ before_install: - chmod +x mvnw - mysql -e 'CREATE DATABASE cheapy;' - sudo apt-get update -install: - - ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - - pip install codacy-coverage - after_success: - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco/jacoco.xml From e2f4234913efd5babc1f0783746eb3e21bc7d374 Mon Sep 17 00:00:00 2001 From: Abraham Date: Sat, 3 Apr 2021 12:39:04 +0200 Subject: [PATCH 10/19] listar mis ofertas cambiar la llamada al repositorio solo pillar las activas y ocultas --- .../cheapy/repository/FoodOfferRepository.java | 4 ++++ .../cheapy/repository/NuOfferRepository.java | 4 ++++ .../cheapy/repository/SpeedOfferRepository.java | 4 ++++ .../cheapy/repository/TimeOfferRepository.java | 4 ++++ .../springframework/cheapy/service/FoodOfferService.java | 4 ++++ .../springframework/cheapy/service/NuOfferService.java | 4 ++++ .../springframework/cheapy/service/SpeedOfferService.java | 4 ++++ .../springframework/cheapy/service/TimeOfferService.java | 4 ++++ .../org/springframework/cheapy/web/OfertaController.java | 8 ++++---- 9 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/cheapy/repository/FoodOfferRepository.java b/src/main/java/org/springframework/cheapy/repository/FoodOfferRepository.java index 2e9ca093b..099f6788c 100644 --- a/src/main/java/org/springframework/cheapy/repository/FoodOfferRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/FoodOfferRepository.java @@ -28,4 +28,8 @@ public interface FoodOfferRepository extends Repository { @Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.id =:id") @Transactional(readOnly = true) List findByUserId(@Param("id") Integer id); + + @Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.id =:id AND foodOffer.status!= 'inactive'") + @Transactional(readOnly = true) + List findFoodOfferActOclByUserId(@Param("id") Integer id); } diff --git a/src/main/java/org/springframework/cheapy/repository/NuOfferRepository.java b/src/main/java/org/springframework/cheapy/repository/NuOfferRepository.java index 8e59df4dc..d895c5916 100644 --- a/src/main/java/org/springframework/cheapy/repository/NuOfferRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/NuOfferRepository.java @@ -27,4 +27,8 @@ public interface NuOfferRepository extends Repository { @Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.id =:id") @Transactional(readOnly = true) List findByUserId(@Param("id") Integer id); + + @Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.id =:id AND nuOffer.status!= 'inactive'") + @Transactional(readOnly = true) + List findNuOfferActOclByUserId(@Param("id") Integer id); } diff --git a/src/main/java/org/springframework/cheapy/repository/SpeedOfferRepository.java b/src/main/java/org/springframework/cheapy/repository/SpeedOfferRepository.java index e4df0426c..4c7465368 100644 --- a/src/main/java/org/springframework/cheapy/repository/SpeedOfferRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/SpeedOfferRepository.java @@ -29,4 +29,8 @@ public interface SpeedOfferRepository extends Repository { @Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.id =:id") @Transactional(readOnly = true) List findByUserId(@Param("id") Integer id); + + @Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.id =:id AND speedOffer.status!= 'inactive'") + @Transactional(readOnly = true) + List findSpeedOfferActOclByUserId(@Param("id") Integer id); } diff --git a/src/main/java/org/springframework/cheapy/repository/TimeOfferRepository.java b/src/main/java/org/springframework/cheapy/repository/TimeOfferRepository.java index 1cd4c5e34..d891e0953 100644 --- a/src/main/java/org/springframework/cheapy/repository/TimeOfferRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/TimeOfferRepository.java @@ -26,4 +26,8 @@ public interface TimeOfferRepository extends Repository { @Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.id =:id") @Transactional(readOnly = true) List findByUserId(@Param("id") Integer id); + + @Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.id =:id AND timeOffer.status!= 'inactive'") + @Transactional(readOnly = true) + List findTimeOfferActOclByUserId(@Param("id") Integer id); } diff --git a/src/main/java/org/springframework/cheapy/service/FoodOfferService.java b/src/main/java/org/springframework/cheapy/service/FoodOfferService.java index c11c9e8a6..a555e5c6c 100644 --- a/src/main/java/org/springframework/cheapy/service/FoodOfferService.java +++ b/src/main/java/org/springframework/cheapy/service/FoodOfferService.java @@ -37,4 +37,8 @@ public class FoodOfferService { public List findFoodOfferByUserId(final int id) { return this.foodOfferRepository.findByUserId(id); } + + public List findFoodOfferActOclByUserId(final int id) { + return this.foodOfferRepository.findFoodOfferActOclByUserId(id); + } } diff --git a/src/main/java/org/springframework/cheapy/service/NuOfferService.java b/src/main/java/org/springframework/cheapy/service/NuOfferService.java index 5268ac2db..7bbb48aaa 100644 --- a/src/main/java/org/springframework/cheapy/service/NuOfferService.java +++ b/src/main/java/org/springframework/cheapy/service/NuOfferService.java @@ -47,4 +47,8 @@ public class NuOfferService { public List findNuOfferByUserId(final int id) { return this.nuOfferRepository.findByUserId(id); } + + public List findNuOfferActOclByUserId(final int id) { + return this.nuOfferRepository.findNuOfferActOclByUserId(id); + } } diff --git a/src/main/java/org/springframework/cheapy/service/SpeedOfferService.java b/src/main/java/org/springframework/cheapy/service/SpeedOfferService.java index 6063b7426..384ec046c 100644 --- a/src/main/java/org/springframework/cheapy/service/SpeedOfferService.java +++ b/src/main/java/org/springframework/cheapy/service/SpeedOfferService.java @@ -44,4 +44,8 @@ public class SpeedOfferService { public List findSpeedOfferByUserId(final int id) { return this.speedOfferRepository.findByUserId(id); } + + public List findSpeedOfferActOclByUserId(final int id) { + return this.speedOfferRepository.findSpeedOfferActOclByUserId(id); + } } diff --git a/src/main/java/org/springframework/cheapy/service/TimeOfferService.java b/src/main/java/org/springframework/cheapy/service/TimeOfferService.java index e23fa5151..154fb9bc8 100644 --- a/src/main/java/org/springframework/cheapy/service/TimeOfferService.java +++ b/src/main/java/org/springframework/cheapy/service/TimeOfferService.java @@ -40,4 +40,8 @@ public class TimeOfferService { public List findTimeOfferByUserId(final int id) { return this.timeOfferRepository.findByUserId(id); } + + public List findTimeOfferActOclByUserId(final int id) { + return this.timeOfferRepository.findTimeOfferActOclByUserId(id); + } } diff --git a/src/main/java/org/springframework/cheapy/web/OfertaController.java b/src/main/java/org/springframework/cheapy/web/OfertaController.java index 2ae80261c..60567c491 100644 --- a/src/main/java/org/springframework/cheapy/web/OfertaController.java +++ b/src/main/java/org/springframework/cheapy/web/OfertaController.java @@ -64,10 +64,10 @@ public class OfertaController { int actual = this.clientService.getCurrentClient().getId(); - List foodOfferLs = this.foodOfferService.findFoodOfferByUserId(actual); - List nuOfferLs = this.nuOfferService.findNuOfferByUserId(actual); - List speedOfferLs = this.speedOfferService.findSpeedOfferByUserId(actual); - List timeOfferLs = this.timeOfferService.findTimeOfferByUserId(actual); + List foodOfferLs = this.foodOfferService.findFoodOfferActOclByUserId(actual); + List nuOfferLs = this.nuOfferService.findNuOfferActOclByUserId(actual); + List speedOfferLs = this.speedOfferService.findSpeedOfferActOclByUserId(actual); + List timeOfferLs = this.timeOfferService.findTimeOfferActOclByUserId(actual); model.put("foodOfferLs", foodOfferLs); model.put("nuOfferLs", nuOfferLs); From e88a9926819390f565f08cc58f450bf244c38ef5 Mon Sep 17 00:00:00 2001 From: Abraham Date: Sat, 3 Apr 2021 13:07:51 +0200 Subject: [PATCH 11/19] poner seguridad en los show --- .../org/springframework/cheapy/web/FoodOfferController.java | 6 ++++-- .../org/springframework/cheapy/web/NuOfferController.java | 4 ++++ .../springframework/cheapy/web/SpeedOfferController.java | 5 ++++- .../org/springframework/cheapy/web/TimeOfferController.java | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/cheapy/web/FoodOfferController.java b/src/main/java/org/springframework/cheapy/web/FoodOfferController.java index 3cd695532..99bc97f66 100644 --- a/src/main/java/org/springframework/cheapy/web/FoodOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/FoodOfferController.java @@ -104,13 +104,15 @@ public class FoodOfferController { public String processShowForm(@PathVariable("foodOfferId") int foodOfferId, Map model) { FoodOffer foodOffer = this.foodOfferService.findFoodOfferById(foodOfferId); - + if(!foodOffer.getStatus().equals(StatusOffer.active)) { + return "error"; + }else { model.put("foodOffer", foodOffer); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); return "offers/food/foodOffersShow"; - + } } @GetMapping(value = "/offers/food/{foodOfferId}/edit") diff --git a/src/main/java/org/springframework/cheapy/web/NuOfferController.java b/src/main/java/org/springframework/cheapy/web/NuOfferController.java index 7c8826521..47e92d255 100644 --- a/src/main/java/org/springframework/cheapy/web/NuOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/NuOfferController.java @@ -133,10 +133,14 @@ public class NuOfferController { @GetMapping("/offers/nu/{nuOfferId}") public String processShowForm(@PathVariable("nuOfferId") int nuOfferId, Map model) { NuOffer nuOffer = this.nuOfferService.findNuOfferById(nuOfferId); + if(!nuOffer.getStatus().equals(StatusOffer.active)) { + return "error"; + }else { model.put("nuOffer", nuOffer); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); return "offers/nu/nuOffersShow"; + } } diff --git a/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java b/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java index 5b7e5aada..270e475aa 100644 --- a/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java @@ -125,12 +125,15 @@ public class SpeedOfferController { @GetMapping("/offers/speed/{speedOfferId}") public String processShowForm(@PathVariable("speedOfferId") int speedOfferId, Map model) { - SpeedOffer speedOffer = this.speedOfferService.findSpeedOfferById(speedOfferId); + if(!speedOffer.getStatus().equals(StatusOffer.active)) { + return "error"; + }else { model.put("speedOffer", speedOffer); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); return "offers/speed/speedOffersShow"; + } } @GetMapping(value = "/offers/speed/{speedOfferId}/edit") diff --git a/src/main/java/org/springframework/cheapy/web/TimeOfferController.java b/src/main/java/org/springframework/cheapy/web/TimeOfferController.java index 5b58bed76..2a19b98d7 100644 --- a/src/main/java/org/springframework/cheapy/web/TimeOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/TimeOfferController.java @@ -121,12 +121,15 @@ public class TimeOfferController { public String processShowForm(@PathVariable("timeOfferId") int timeOfferId, Map model) { TimeOffer timeOffer = this.timeOfferService.findTimeOfferById(timeOfferId); - + if(!timeOffer.getStatus().equals(StatusOffer.active)) { + return "error"; + }else { model.put("timeOffer", timeOffer); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); return "offers/time/timeOffersShow"; + } } From 189b80e947c5e0a7b91049d40024b991b22edd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sat, 3 Apr 2021 13:33:08 +0200 Subject: [PATCH 12/19] Arreglo de codacy --- pom.xml | 100 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 41 deletions(-) diff --git a/pom.xml b/pom.xml index f32f00d86..52d7c73e3 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,12 @@ 2.2.4 1.8.0 - 0.8.5 + 0.7.6.201602180812 + ${project.build.directory} + ${project.build.directory}/jacoco + ${jacoco.utreportpath}/jacoco.exec + ${project.build.directory}/jacoco + ${jacoco.itreportpath}/jacoco-it.exec 0.0.4.RELEASE 0.0.25 @@ -152,46 +157,59 @@ - - org.springframework.boot - spring-boot-maven-plugin - - - - - build-info - - - - ${project.build.sourceEncoding} - ${project.reporting.outputEncoding} - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + pre-unit-test + process-test-classes + + prepare-agent + + + surefireArgLine + ${jacoco.utreportfile} + true + + + + post-unit-test + test + + report + + + ${jacoco.utreportpath} + ${jacoco.utreportfile} + + + + pre-integration-test + pre-integration-test + + prepare-agent-integration + + + failsafeArgLine + ${jacoco.itreportfile} + true + + + + post-integration-test + post-integration-test + + report + + + ${jacoco.itreportpath} + ${jacoco.itreportfile} + + + + From 1bcc6ef9381655379b48b86ecaf9a9f0cf35002d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sat, 3 Apr 2021 13:39:49 +0200 Subject: [PATCH 13/19] Arreglo de codacy --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 39a70b87e..9c6cec2f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,5 +15,5 @@ before_install: - mysql -e 'CREATE DATABASE cheapy;' - sudo apt-get update after_success: - - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco/jacoco.xml + - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml From 6e3869f747db262d4394793d293d61cc956a1a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sat, 3 Apr 2021 13:50:34 +0200 Subject: [PATCH 14/19] arreglos codacy --- .travis.yml | 3 ++- pom.xml | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c6cec2f1..5f0394161 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,5 +15,6 @@ before_install: - mysql -e 'CREATE DATABASE cheapy;' - sudo apt-get update after_success: - - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml + - ls target + - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco.xml diff --git a/pom.xml b/pom.xml index 52d7c73e3..d8298785c 100644 --- a/pom.xml +++ b/pom.xml @@ -29,9 +29,8 @@ 0.7.6.201602180812 ${project.build.directory} - ${project.build.directory}/jacoco + ${project.build.directory} ${jacoco.utreportpath}/jacoco.exec - ${project.build.directory}/jacoco ${jacoco.itreportpath}/jacoco-it.exec 0.0.4.RELEASE 0.0.25 From 27704692308c1f7b90eaa8ed4b78575e2ea2bc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Franco=20S=C3=A1nchez?= <56022165+pabfrasan@users.noreply.github.com> Date: Sat, 3 Apr 2021 14:02:32 +0200 Subject: [PATCH 15/19] Arreglos traviss --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f0394161..ad24140b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,6 @@ before_install: - mysql -e 'CREATE DATABASE cheapy;' - sudo apt-get update after_success: - - ls target + - ls - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco.xml From af2fbd17389caf33d4a88d059abe17acb4157f0f Mon Sep 17 00:00:00 2001 From: David Date: Sat, 3 Apr 2021 14:03:00 +0200 Subject: [PATCH 16/19] =?UTF-8?q?Eliminado=20los=20botones=20return=20y=20?= =?UTF-8?q?m=C3=A1s=20cambios=20de=20vistas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springframework/cheapy/model/Review.java | 7 ++- src/main/less/cheapy.less | 31 ++++++++-- .../resources/messages/messages_es.properties | 3 + .../food/createOrUpdateFoodOfferForm.jsp | 11 ---- .../jsp/offers/food/foodOffersDisable.jsp | 12 +--- .../jsp/offers/food/foodOffersShow.jsp | 56 +++++++++---------- .../WEB-INF/jsp/offers/myOffersList.jsp | 26 +++++++-- .../offers/nu/createOrUpdateNuOfferForm.jsp | 10 ---- .../WEB-INF/jsp/offers/nu/nuOffersDisable.jsp | 12 +--- .../WEB-INF/jsp/offers/nu/nuOffersShow.jsp | 30 +++++----- .../WEB-INF/jsp/offers/offersCreate.jsp | 11 +--- .../webapp/WEB-INF/jsp/offers/offersList.jsp | 42 ++++++++------ .../speed/createOrUpdateSpeedOfferForm.jsp | 12 +--- .../jsp/offers/speed/speedOffersDisable.jsp | 12 +--- .../jsp/offers/speed/speedOffersShow.jsp | 30 +++++----- .../time/createOrUpdateTimeOfferForm.jsp | 11 +--- .../jsp/offers/time/timeOffersDisable.jsp | 12 +--- .../jsp/offers/time/timeOffersShow.jsp | 31 +++++----- .../jsp/reviews/createOrUpdateReviewForm.jsp | 9 ++- .../WEB-INF/jsp/reviews/reviewsShow.jsp | 12 +--- src/main/webapp/WEB-INF/jsp/welcome.jsp | 5 ++ 21 files changed, 170 insertions(+), 215 deletions(-) diff --git a/src/main/java/org/springframework/cheapy/model/Review.java b/src/main/java/org/springframework/cheapy/model/Review.java index b8cf0b6d4..4715051ee 100644 --- a/src/main/java/org/springframework/cheapy/model/Review.java +++ b/src/main/java/org/springframework/cheapy/model/Review.java @@ -6,10 +6,11 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Range; -import com.sun.istack.NotNull; + @Entity @Table(name = "review") @@ -21,8 +22,8 @@ public class Review extends BaseEntity{ @Column(length=16777215) private String opinion; - @NotNull - @Range(min = 1, max = 5) + @NotNull(message= "Por favor rellene este campo") + @Range(min = 1, max = 5,message="Las estrellas deben ir entre 1 y 5") private Integer stars; @ManyToOne diff --git a/src/main/less/cheapy.less b/src/main/less/cheapy.less index a0bff3551..44e9d7e26 100644 --- a/src/main/less/cheapy.less +++ b/src/main/less/cheapy.less @@ -297,23 +297,23 @@ img.img-responsive{ } #foodOfferTable th { - width: 25%; + width: 20%; text-align: center; } #nuOfferTable th { - width: 25%; + width: 20%; text-align: center; } #speedOfferTable th { - width: 25%; + width: 20%; text-align: center; } #timeOfferTable th { - width: 25%; + width: 20%; text-align: center; } @@ -365,6 +365,29 @@ text-align: center; background-color: rgb(40, 140, 215); } +.btns-edit2{ + display: table; + margin:auto; + +} + +.btns-edit2 button{ + background-color: rgb(0, 64, 128); + border: 1px solid rgb(0, 0, 160); + color: white; + padding: 10px 24px; + cursor: pointer; +} + +.btns-edit2 button:not(:last-child) { + border-bottom: none; +} + + +.btns-edit2 button:hover { + background-color: rgb(40, 140, 215); +} + .btns-delete{ display: table; margin: 0 auto; diff --git a/src/main/resources/messages/messages_es.properties b/src/main/resources/messages/messages_es.properties index a4aebbe00..dfb725f19 100644 --- a/src/main/resources/messages/messages_es.properties +++ b/src/main/resources/messages/messages_es.properties @@ -48,3 +48,6 @@ createSpeedOffers= Crear ofertas por rapidez comiendo createTimeOffers= Crear ofertas por franja horaria init= Inicio del intervalo finish= Fin del intervalo +name= Nombre del restaurante +status= Estado de oferta +myOffers= Ver mis Ofertas \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/offers/food/createOrUpdateFoodOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/offers/food/createOrUpdateFoodOfferForm.jsp index e396fb9d8..736f83797 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/food/createOrUpdateFoodOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/food/createOrUpdateFoodOfferForm.jsp @@ -42,15 +42,4 @@ -
- -
- - diff --git a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersDisable.jsp b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersDisable.jsp index e7c0d50e5..6e3020c66 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersDisable.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersDisable.jsp @@ -15,23 +15,13 @@ -
+
-
- -
- diff --git a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersShow.jsp index 5b82667b3..bfd854ea4 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersShow.jsp @@ -12,7 +12,7 @@

- + @@ -40,44 +40,42 @@
-
- -
+ +
- - - - + + + + + + + + - - - - + + + + - - - - + + + + +
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/myOffersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/myOffersList.jsp index 3292e232e..ee9b25750 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/myOffersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/myOffersList.jsp @@ -9,7 +9,7 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por plato específico creada.

@@ -19,6 +19,7 @@ + +
@@ -36,6 +37,9 @@ + + @@ -54,7 +58,7 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por número de comensales creada.

@@ -63,6 +67,7 @@ + +
@@ -79,6 +84,9 @@ + + @@ -96,8 +104,8 @@

- -

No hay ninguna oferta por plato específico activa.

+ +

No hay ninguna oferta por tiempo empleado en comer creada.

@@ -106,6 +114,7 @@ + + + + + @@ -38,6 +45,7 @@ +
@@ -122,6 +131,9 @@ + + @@ -141,7 +153,7 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por franja horaria creada.

@@ -150,6 +162,7 @@ + +
@@ -165,6 +178,9 @@ + + diff --git a/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp index d693e8ae9..1dcc0f41d 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp @@ -47,15 +47,5 @@ -
- -
- diff --git a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersDisable.jsp b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersDisable.jsp index 4da1c4c8f..e4037e012 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersDisable.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersDisable.jsp @@ -19,23 +19,13 @@ -
+
-
- -
- diff --git a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersShow.jsp index ba76384d7..dd4f68713 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersShow.jsp @@ -53,19 +53,19 @@
-
- -
+ +
- - - - + + + + + + + @@ -83,13 +83,11 @@ Desactivar oferta +
+
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp index 986828742..a9b2e5d7d 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp @@ -33,14 +33,5 @@ -
- -
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp index 7817f06e7..dd1d44eee 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp @@ -4,10 +4,12 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

+

No hay ninguna oferta por plato específico activa.

@@ -16,16 +18,21 @@
+ + @@ -56,13 +64,14 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por número de comensales activa.

+ @@ -74,7 +83,9 @@ - + @@ -105,13 +116,14 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por tiempo empleado en comer activa.

+ +
+ @@ -123,7 +135,9 @@ - + @@ -155,13 +169,14 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por franja horaria activa.

+ +
+ @@ -172,7 +187,9 @@ - + @@ -201,15 +218,6 @@
+ +
- -
- -
- + + diff --git a/src/main/webapp/WEB-INF/jsp/offers/speed/createOrUpdateSpeedOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/offers/speed/createOrUpdateSpeedOfferForm.jsp index d466bc2f5..906baa373 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/speed/createOrUpdateSpeedOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/speed/createOrUpdateSpeedOfferForm.jsp @@ -44,16 +44,6 @@ - -
- -
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersDisable.jsp b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersDisable.jsp index 5b532e3f1..14fed16ce 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersDisable.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersDisable.jsp @@ -20,23 +20,13 @@ -
+
-
- -
- diff --git a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersShow.jsp index f7065d80c..829621d5e 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersShow.jsp @@ -53,19 +53,19 @@
-
- -
+ +
- - - - + + + + + + + @@ -84,14 +84,12 @@ Desactivar oferta +
+
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/time/createOrUpdateTimeOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/offers/time/createOrUpdateTimeOfferForm.jsp index 51c188e8d..cc91be345 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/time/createOrUpdateTimeOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/time/createOrUpdateTimeOfferForm.jsp @@ -45,15 +45,6 @@ -
- -
- + diff --git a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersDisable.jsp b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersDisable.jsp index 224184eb6..9aacde679 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersDisable.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersDisable.jsp @@ -16,23 +16,13 @@ -
+
-
- -
- diff --git a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersShow.jsp index df891e271..273c1505a 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersShow.jsp @@ -42,20 +42,19 @@
-
- -
+ +
- - - - - + + + + + + + @@ -73,15 +72,11 @@ Desactivar oferta - +
- + diff --git a/src/main/webapp/WEB-INF/jsp/reviews/createOrUpdateReviewForm.jsp b/src/main/webapp/WEB-INF/jsp/reviews/createOrUpdateReviewForm.jsp index 5c8c53660..93f628af0 100644 --- a/src/main/webapp/WEB-INF/jsp/reviews/createOrUpdateReviewForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/reviews/createOrUpdateReviewForm.jsp @@ -18,15 +18,22 @@
+
- + +
+ + + diff --git a/src/main/webapp/WEB-INF/jsp/reviews/reviewsShow.jsp b/src/main/webapp/WEB-INF/jsp/reviews/reviewsShow.jsp index 982cb3b3a..b13c31115 100644 --- a/src/main/webapp/WEB-INF/jsp/reviews/reviewsShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/reviews/reviewsShow.jsp @@ -24,11 +24,7 @@
-
- -
+
@@ -42,10 +38,6 @@ Editar opinión
- +
diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp index 027fd2d3c..a2622ed5a 100644 --- a/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ b/src/main/webapp/WEB-INF/jsp/welcome.jsp @@ -23,6 +23,11 @@
+
+ +