Skip to content

Commit

Permalink
automatic project update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed May 3, 2018
1 parent 41c36c1 commit a2d81ec
Show file tree
Hide file tree
Showing 251 changed files with 6,663 additions and 6,790 deletions.
1 change: 1 addition & 0 deletions .prettierignore
@@ -1 +1,2 @@
node_modules
target
10 changes: 8 additions & 2 deletions .prettierrc
@@ -1,6 +1,12 @@
# Prettier configuration

printWidth: 140
singleQuote: true
jsxBracketSameLine: false
parser: typescript
tabWidth: 4
useTabs: false

# js and ts rules:
arrowParens: avoid

# jsx and tsx rules:
jsxBracketSameLine: false
2 changes: 1 addition & 1 deletion .yo-rc.json
Expand Up @@ -23,7 +23,7 @@
"en"
],
"serverPort": 8080,
"jhipsterVersion": "5.0.0-beta.0",
"jhipsterVersion": "5.0.0-beta.1",
"enableSocialSignIn": false,
"useSass": false,
"jhiPrefix": "jhi",
Expand Down
14 changes: 7 additions & 7 deletions README.md
@@ -1,5 +1,5 @@
# jhipsterSampleApplication
This application was generated using JHipster 5.0.0-beta.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0](https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0).
This application was generated using JHipster 5.0.0-beta.1, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1](https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1).

## Development

Expand Down Expand Up @@ -151,13 +151,13 @@ For more information refer to [Using Docker and Docker-Compose][], this page als
To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information.

[JHipster Homepage and latest documentation]: https://www.jhipster.tech
[JHipster 5.0.0-beta.0 archive]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0
[JHipster 5.0.0-beta.1 archive]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1

[Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0/development/
[Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0/docker-compose
[Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0/production/
[Running tests page]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0/running-tests/
[Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.0/setting-up-ci/
[Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1/development/
[Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1/docker-compose
[Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1/production/
[Running tests page]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1/running-tests/
[Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v5.0.0-beta.1/setting-up-ci/

[Gatling]: http://gatling.io/
[Node.js]: https://nodejs.org/
Expand Down
13 changes: 7 additions & 6 deletions package.json
Expand Up @@ -15,10 +15,11 @@
"@angular/platform-browser": "5.2.8",
"@angular/platform-browser-dynamic": "5.2.8",
"@angular/router": "5.2.8",
"@fortawesome/fontawesome": "1.1.5",
"@fortawesome/fontawesome-free-solid": "5.0.10",
"@ng-bootstrap/ng-bootstrap": "1.0.1",
"bootstrap": "4.0.0",
"core-js": "2.5.3",
"font-awesome": "4.7.0",
"jquery": "3.3.1",
"moment": "2.21.0",
"ng-jhipster": "0.4.5",
Expand Down Expand Up @@ -50,7 +51,7 @@
"extract-text-webpack-plugin": "4.0.0-beta.0",
"file-loader": "1.1.11",
"fork-ts-checker-webpack-plugin": "0.4.1",
"generator-jhipster": "5.0.0-beta.0",
"generator-jhipster": "5.0.0-beta.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.0.6",
"husky": "0.14.3",
Expand All @@ -69,22 +70,22 @@
"lint-staged": "7.0.0",
"merge-jsons-webpack-plugin": "1.0.14",
"prettier": "1.11.1",
"puppeteer": "1.1.1",
"protractor": "5.1.2",
"protractor-jasmine2-screenshot-reporter": "0.4.0",
"proxy-middleware": "0.15.0",
"puppeteer": "1.1.1",
"rimraf": "2.6.1",
"sourcemap-istanbul-instrumenter-loader": "0.2.0",
"style-loader": "0.20.3",
"tapable": "1.0.0",
"thread-loader": "1.1.5",
"to-string-loader": "1.1.5",
"ts-node": "5.0.1",
"ts-loader": "4.0.1",
"tslint": "5.9.1",
"tslint-config-prettier": "1.9.0",
"tslint-loader": "3.6.0",
"typescript": "2.7.2",
"thread-loader": "1.1.5",
"xml2js": "0.4.19",
"uglifyjs-webpack-plugin": "1.2.3",
"webpack": "4.1.1",
Expand All @@ -100,11 +101,11 @@
"node": ">=8.9.0"
},
"lint-staged": {
"*.ts": ["prettier --write", "git add"]
"src/**/*.{ts,css,scss}": ["prettier --write", "git add"]
},
"scripts": {
"precommit": "lint-staged",
"prettier:format":"yarn prettier --write **/*.ts",
"prettier:format": "yarn prettier --write 'src/**/*.{ts,css,scss}'",
"lint": "tslint --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "yarn run lint -- --fix",
"ngc": "ngc -p tsconfig-aot.json",
Expand Down
27 changes: 10 additions & 17 deletions pom.xml
Expand Up @@ -10,14 +10,6 @@

<repositories>
<!-- TODO Remove snapshot repositories after final Spring Boot 2 release -->
<repository>
<id>sonatype-snapshot</id>
<name>JHipster Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
Expand All @@ -44,7 +36,7 @@
<maven.version>3.0.0</maven.version>
<java.version>1.8</java.version>
<scala.version>2.12.1</scala.version>
<node.version>v8.10.0</node.version>
<node.version>v8.11.1</node.version>
<yarn.version>v1.5.1</yarn.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -60,13 +52,13 @@
<profile.swagger />

<!-- Dependency versions -->
<jhipster-dependencies.version>2.0.0-SNAPSHOT</jhipster-dependencies.version>
<jhipster-dependencies.version>2.0.2</jhipster-dependencies.version>
<!-- The spring-boot version should match the one managed by
https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
<spring-boot.version>2.0.0.RELEASE</spring-boot.version>
<spring-boot.version>2.0.1.RELEASE</spring-boot.version>
<!-- The hibernate version should match the one managed by
https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
<hibernate.version>5.2.14.Final</hibernate.version>
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
<hibernate.version>5.2.16.Final</hibernate.version>
<!-- The javassist version should match the one managed by
https://mvnrepository.com/artifact/org.hibernate/hibernate-core/${hibernate.version} -->
<javassist.version>3.22.0-GA</javassist.version>
Expand Down Expand Up @@ -129,6 +121,11 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.github.jhipster</groupId>
<artifactId>jhipster-framework</artifactId>
</dependency>

<!-- TODO To remove after final Spring Boot 2 release -->
<dependency>
<groupId>javax.xml.bind</groupId>
Expand All @@ -139,10 +136,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>io.github.jhipster</groupId>
<artifactId>jhipster</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
Expand Down
13 changes: 11 additions & 2 deletions src/main/docker/.dockerignore
@@ -1,5 +1,14 @@
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
# by default ignore everything except the jar file
**/*
classes/
generated-sources/
generated-test-sources/
h2db/
maven-archiver/
maven-status/
reports/
surefire-reports/
test-classes/
test-results/
www/
!*.jar
!*.war
1 change: 1 addition & 0 deletions src/main/docker/app.yml
Expand Up @@ -3,6 +3,7 @@ services:
jhipstersampleapplication-app:
image: jhipstersampleapplication
environment:
# - _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,swagger
- SPRING_DATASOURCE_URL=jdbc:mysql://jhipstersampleapplication-mysql:3306/jhipstersampleapplication?useUnicode=true&characterEncoding=utf8&useSSL=false
- JHIPSTER_SLEEP=10 # gives time for the database to boot before the application
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/io/github/jhipster/sample/ApplicationWebXml.java
@@ -0,0 +1,21 @@
package io.github.jhipster.sample;

import io.github.jhipster.sample.config.DefaultProfileUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
* This is a helper Java class that provides an alternative to creating a web.xml.
* This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
/**
* set a default to use when no profile is configured.
*/
DefaultProfileUtil.addDefaultProfile(application.application());
return application.sources(JhipsterSampleApplicationApp.class);
}
}
Expand Up @@ -7,7 +7,6 @@
import liquibase.integration.spring.SpringLiquibase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
import org.springframework.context.annotation.Bean;
Expand All @@ -21,8 +20,6 @@
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.SQLException;

@Configuration
Expand Down
Expand Up @@ -69,11 +69,11 @@ private void addLogstashAppender(LoggerContext context) {
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";

// More documentation is available at: https://github.com/logstash/logstash-logback-encoder
LogstashEncoder logstashEncoder=new LogstashEncoder();
LogstashEncoder logstashEncoder = new LogstashEncoder();
// Set the Logstash appender config from JHipster properties
logstashEncoder.setCustomFields(customFields);
// Set the Logstash appender config from JHipster properties
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(),jHipsterProperties.getLogging().getLogstash().getPort()));
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort()));

ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setRootCauseFirst(true);
Expand Down
Expand Up @@ -79,6 +79,8 @@ public void init() {
metricRegistry.register(PROP_METRIC_REG_JCACHE_STATISTICS, new JCacheGaugeSet());
if (hikariDataSource != null) {
log.debug("Monitoring the datasource");
// remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer
hikariDataSource.setMetricsTrackerFactory(null);
hikariDataSource.setMetricRegistry(metricRegistry);
}
if (jHipsterProperties.getMetrics().getJmx().isEnabled()) {
Expand Down
Expand Up @@ -7,8 +7,8 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand Down Expand Up @@ -107,9 +107,9 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/api/authenticate").permitAll()
.antMatchers("/api/account/reset-password/init").permitAll()
.antMatchers("/api/account/reset-password/finish").permitAll()
.antMatchers("/api/profile-info").permitAll()
.antMatchers("/api/**").authenticated()
.antMatchers("/management/health").permitAll()
.antMatchers("/management/info").permitAll()
.antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/v2/api-docs/**").permitAll()
.antMatchers("/swagger-resources/configuration/ui").permitAll()
Expand Down
Expand Up @@ -37,7 +37,7 @@
* Configuration of web application with Servlet 3.0 APIs.
*/
@Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer {
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {

private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);

Expand Down
Expand Up @@ -16,7 +16,6 @@
@Entity
@Table(name = "jhi_authority")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)

public class Authority implements Serializable {

private static final long serialVersionUID = 1L;
Expand Down
Expand Up @@ -33,7 +33,7 @@ public class BankAccount implements Serializable {
private String name;

@NotNull
@Column(name = "balance", precision=10, scale=2, nullable = false)
@Column(name = "balance", precision = 10, scale = 2, nullable = false)
private BigDecimal balance;

@ManyToOne
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/github/jhipster/sample/domain/Operation.java
Expand Up @@ -36,7 +36,7 @@ public class Operation implements Serializable {
private String description;

@NotNull
@Column(name = "amount", precision=10, scale=2, nullable = false)
@Column(name = "amount", precision = 10, scale = 2, nullable = false)
private BigDecimal amount;

@ManyToOne
Expand All @@ -46,8 +46,8 @@ public class Operation implements Serializable {
@ManyToMany
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "operation_label",
joinColumns = @JoinColumn(name="operations_id", referencedColumnName="id"),
inverseJoinColumns = @JoinColumn(name="labels_id", referencedColumnName="id"))
joinColumns = @JoinColumn(name = "operations_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "labels_id", referencedColumnName = "id"))
private Set<Label> labels = new HashSet<>();

// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
Expand Down
Expand Up @@ -16,6 +16,8 @@
@Table(name = "jhi_persistent_audit_event")
public class PersistentAuditEvent implements Serializable {

private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "event_id")
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/io/github/jhipster/sample/service/UserService.java
Expand Up @@ -214,19 +214,15 @@ public void changePassword(String currentClearTextPassword, String newPassword)
.flatMap(userRepository::findOneByLogin)
.ifPresent(user -> {
String currentEncryptedPassword = user.getPassword();
assertClearTextPasswordMatchesEncryptedPassword(currentClearTextPassword, currentEncryptedPassword);
if (!passwordEncoder.matches(currentClearTextPassword, currentEncryptedPassword)) {
throw new InvalidPasswordException();
}
String encryptedPassword = passwordEncoder.encode(newPassword);
user.setPassword(encryptedPassword);
this.clearUserCaches(user);
log.debug("Changed password for User: {}", user);
});
}
private void assertClearTextPasswordMatchesEncryptedPassword(String clearTextPassword, String encryptedPassword) {
if (!passwordEncoder.matches(clearTextPassword,encryptedPassword)){
throw new InvalidPasswordException();
}
}


@Transactional(readOnly = true)
public Page<UserDTO> getAllManagedUsers(Pageable pageable) {
Expand Down
Expand Up @@ -143,7 +143,7 @@ public void changePassword(@RequestBody PasswordChangeDTO passwordChangeDto) {
if (!checkPasswordLength(passwordChangeDto.getNewPassword())) {
throw new InvalidPasswordException();
}
userService.changePassword(passwordChangeDto.getCurrentPassword(),passwordChangeDto.getNewPassword());
userService.changePassword(passwordChangeDto.getCurrentPassword(), passwordChangeDto.getNewPassword());
}

/**
Expand Down

0 comments on commit a2d81ec

Please sign in to comment.