automatic project update

This commit is contained in:
Julien Dubois 2016-09-12 18:05:24 +02:00
parent c19d07cd3f
commit dd7cbb6635
84 changed files with 642 additions and 615 deletions

1
.gitignore vendored
View File

@ -21,7 +21,6 @@
*.pydevproject
.project
.metadata
/bin/**
/tmp/**
/tmp/**/*
*.tmp

View File

@ -24,7 +24,7 @@
"en"
],
"serverPort": 8080,
"jhipsterVersion": "3.6.1",
"jhipsterVersion": "3.7.0",
"enableSocialSignIn": false,
"useSass": false,
"jhiPrefix": "jhi"

41
Jenkinsfile vendored
View File

@ -3,27 +3,34 @@ node {
// def nodeHome = tool name: 'node-4.4.7', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
// env.PATH = "${nodeHome}/bin:${env.PATH}"
stage 'check tools'
sh "node -v"
sh "npm -v"
sh "bower -v"
sh "gulp -v"
stage('check tools') {
sh "node -v"
sh "npm -v"
sh "bower -v"
sh "gulp -v"
}
stage 'checkout'
checkout scm
stage('checkout') {
checkout scm
}
stage 'npm install'
sh "npm install"
stage('npm install') {
sh "npm install"
}
stage 'clean'
sh "./mvnw clean"
stage('clean') {
sh "./mvnw clean"
}
stage 'backend tests'
sh "./mvnw test"
stage('backend tests') {
sh "./mvnw test"
}
stage 'frontend tests'
sh "gulp test"
stage('frontend tests') {
sh "gulp test"
}
stage 'packaging'
sh "./mvnw package -Pprod -DskipTests"
stage('packaging') {
sh "./mvnw package -Pprod -DskipTests"
}
}

View File

@ -53,6 +53,11 @@ Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in
UI end-to-end tests are powered by [Protractor][], which is built on top of WebDriverJS. They're located in `src/test/javascript/e2e`
and can be run by starting Spring Boot in one terminal (`./mvnw spring-boot:run`) and running the tests (`gulp itest`) in a second one.
Performance tests are run by [Gatling]() and written in Scala. They're located in `src/test/gatling` and can be run with:
./mvnw gatling:execute
## Continuous Integration
To setup this project in Jenkins, use the following configuration:
@ -78,6 +83,7 @@ To setup this project in Jenkins, use the following configuration:
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml,build/reports/e2e/*.xml`
[JHipster]: https://jhipster.github.io/
[Gatling]: http://gatling.io/
[Node.js]: https://nodejs.org/
[Bower]: http://bower.io/
[Gulp]: http://gulpjs.com/

View File

@ -1,4 +1,4 @@
// Generated on 2016-08-18 using generator-jhipster 3.6.1
// Generated on 2016-09-12 using generator-jhipster 3.7.0
'use strict';
var gulp = require('gulp'),

View File

@ -9,24 +9,24 @@
],
"devDependencies": {
"bower": "1.7.9",
"browser-sync": "2.13.0",
"del": "2.2.1",
"browser-sync": "2.15.0",
"del": "2.2.2",
"eslint-config-angular": "0.5.0",
"eslint-plugin-angular": "1.3.1",
"event-stream": "3.3.4",
"generator-jhipster": "3.6.1",
"generator-jhipster": "3.7.0",
"gulp": "3.9.1",
"gulp-angular-filesort": "1.1.1",
"gulp-angular-templatecache": "2.0.0",
"gulp-autoprefixer": "3.1.0",
"gulp-changed": "1.3.1",
"gulp-autoprefixer": "3.1.1",
"gulp-changed": "1.3.2",
"gulp-cssnano": "2.1.2",
"gulp-eslint": "3.0.1",
"gulp-flatten": "0.3.0",
"gulp-flatten": "0.3.1",
"gulp-footer": "1.0.5",
"gulp-htmlmin": "2.0.0",
"gulp-if": "2.0.1",
"gulp-imagemin": "3.0.2",
"gulp-imagemin": "3.0.3",
"gulp-inject": "4.1.0",
"gulp-natural-sort": "0.1.1",
"gulp-ng-annotate": "2.0.0",
@ -37,31 +37,31 @@
"gulp-replace": "0.5.4",
"gulp-protractor": "3.0.0",
"gulp-util": "3.0.7",
"gulp-rev": "7.1.0",
"gulp-rev": "7.1.2",
"gulp-rev-replace": "0.4.3",
"gulp-sourcemaps": "1.6.0",
"gulp-uglify": "1.5.4",
"gulp-useref": "3.1.0",
"jasmine-core": "2.4.1",
"gulp-uglify": "2.0.0",
"gulp-useref": "3.1.2",
"jasmine-core": "2.5.0",
"jasmine-reporters": "2.2.0",
"karma": "1.1.2",
"karma-chrome-launcher": "1.0.1",
"karma": "1.2.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "1.0.2",
"karma-junit-reporter": "1.1.0",
"karma-phantomjs-launcher": "1.0.1",
"karma-phantomjs-launcher": "1.0.2",
"karma-script-launcher": "1.0.0",
"lazypipe": "1.0.1",
"lodash": "4.14.0",
"lodash": "4.15.0",
"main-bower-files": "2.13.1",
"map-stream": "0.0.6",
"phantomjs-prebuilt": "2.1.8",
"protractor": "4.0.3",
"phantomjs-prebuilt": "2.1.12",
"protractor": "4.0.4",
"protractor-jasmine2-screenshot-reporter": "0.3.2",
"proxy-middleware": "0.15.0",
"run-sequence": "1.2.2",
"xml2js": "0.4.16",
"yargs": "4.8.1"
"xml2js": "0.4.17",
"yargs": "5.0.0"
},
"engines": {
"node": "^4.3"

30
pom.xml
View File

@ -24,7 +24,7 @@
<assertj-core.version>3.5.2</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<commons-io.version>2.5</commons-io.version>
<commons-lang.version>2.6</commons-lang.version>
<commons-lang.version>3.4</commons-lang.version>
<frontend-maven-plugin.version>1.0</frontend-maven-plugin.version>
<gatling.version>2.1.7</gatling.version>
<gatling-maven-plugin.version>2.1.7</gatling-maven-plugin.version>
@ -210,8 +210,8 @@
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
@ -315,6 +315,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
@ -711,7 +716,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -726,7 +731,6 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>src/main/webapp/</warSourceDirectory>
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
@ -735,7 +739,7 @@
<!-- log configuration -->
<logback.loglevel>DEBUG</logback.loglevel>
<!-- default Spring profiles -->
<spring.profiles.active>dev${profile.no-liquibase}</spring.profiles.active>
<spring.profiles.active>dev,swagger${profile.no-liquibase}</spring.profiles.active>
</properties>
</profile>
<profile>
@ -743,7 +747,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<build>
@ -759,8 +763,8 @@
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v4.4.7</nodeVersion>
<npmVersion>3.10.5</npmVersion>
<nodeVersion>v4.5.0</nodeVersion>
<npmVersion>3.10.6</npmVersion>
</configuration>
</execution>
<execution>
@ -818,7 +822,6 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>target/www/</warSourceDirectory>
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes>
</configuration>
</plugin>
<plugin>
@ -827,6 +830,13 @@
<configuration>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -2,7 +2,7 @@ version: '2'
services:
jhipstersampleapplication-mysql:
container_name: jhipstersampleapplication-mysql
image: mysql:5.7.14
image: mysql:5.7.15
# volumes:
# - ~/volumes/jhipster/jhipsterSampleApplication/mysql/:/var/lib/mysql/
environment:

View File

@ -2,7 +2,7 @@ version: '2'
services:
jhipstersampleapplication-sonar:
container_name: jhipstersampleapplication-sonar
image: sonarqube:5.6-alpine
image: sonarqube:5.6.1-alpine
ports:
- 9000:9000
- 9092:9092

View File

@ -72,5 +72,4 @@ public class JhipsterSampleApplicationApp {
env.getProperty("server.port"));
}
}

View File

@ -34,12 +34,12 @@ public class LoggingAspect {
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause(), e.getMessage());
joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL"), e.getMessage());
e.printStackTrace();
} else {
log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause());
joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL"));
}
}

View File

@ -31,7 +31,6 @@ public class DatabaseConfiguration {
@Inject
private Environment env;
/**
* Open the TCP port for the H2 database, so it is available remotely.
*

View File

@ -1,14 +1,9 @@
package io.github.jhipster.sample.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.env.Environment;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.*;
/**
* Utility class to load a Spring profile to be used as default
@ -17,31 +12,7 @@ import java.util.Properties;
*/
public final class DefaultProfileUtil {
private static final long serialVersionUID = 1L;
private static final Logger log = LoggerFactory.getLogger(DefaultProfileUtil.class);
private static final String SPRING_PROFILE_ACTIVE = "spring.profiles.active";
private static final Properties BUILD_PROPERTIES = readProperties();
/**
* Get a default profile from <code>application.yml</code>.
*
* @return the default active profile
*/
public static String getDefaultActiveProfiles(){
if (BUILD_PROPERTIES != null) {
String activeProfile = BUILD_PROPERTIES.getProperty(SPRING_PROFILE_ACTIVE);
if (activeProfile != null && !activeProfile.isEmpty() &&
(activeProfile.contains(Constants.SPRING_PROFILE_DEVELOPMENT) ||
activeProfile.contains(Constants.SPRING_PROFILE_PRODUCTION))) {
return activeProfile;
}
}
log.warn("No Spring profile configured, running with default profile: {}", Constants.SPRING_PROFILE_DEVELOPMENT);
return Constants.SPRING_PROFILE_DEVELOPMENT;
}
private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default";
/**
* Set a default to use when no profile is configured.
@ -55,23 +26,18 @@ public final class DefaultProfileUtil {
* This cannot be set in the <code>application.yml</code> file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put(SPRING_PROFILE_ACTIVE, getDefaultActiveProfiles());
defProperties.put(SPRING_PROFILE_DEFAULT, Constants.SPRING_PROFILE_DEVELOPMENT);
app.setDefaultProperties(defProperties);
}
/**
* Load application.yml from classpath.
*
* @return the YAML Properties
* Get the profiles that are applied else get default profiles.
*/
private static Properties readProperties() {
try {
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
factory.setResources(new ClassPathResource("config/application.yml"));
return factory.getObject();
} catch (Exception e) {
log.error("Failed to read application.yml to get default profile");
public static String[] getActiveProfiles(Environment env) {
String[] profiles = env.getActiveProfiles();
if (profiles.length == 0) {
return env.getDefaultProfiles();
}
return null;
return profiles;
}
}

View File

@ -1,7 +1,6 @@
package io.github.jhipster.sample.config;
import javax.validation.constraints.NotNull;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.web.cors.CorsConfiguration;
@ -460,10 +459,8 @@ public class JHipsterProperties {
public void setQueueSize(int queueSize) { this.queueSize = queueSize; }
}
}
public static class Ribbon {
private String[] displayOnActiveProfiles;

View File

@ -1,20 +1,13 @@
package io.github.jhipster.sample.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.ZonedDateTimeSerializer;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import javax.annotation.PostConstruct;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
@Configuration
public class JacksonConfiguration {
@ -22,28 +15,14 @@ public class JacksonConfiguration {
public static final DateTimeFormatter ISO_FIXED_FORMAT =
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withZone(ZoneId.of("Z"));
public static final DateTimeFormatter ISO_DATE_OPTIONAL_TIME =
new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.optionalStart()
.appendLiteral('T')
.append(DateTimeFormatter.ISO_TIME)
.toFormatter();
@Autowired
private Jackson2ObjectMapperBuilder builder;
//To be replaced by a Jackson2ObjectMapperBuilderCustomizer in Spring-boot 1.4
@PostConstruct
public void postConstruct() {
this.builder.serializers(new ZonedDateTimeSerializer(ISO_FIXED_FORMAT));
//Will not be needed anymore with SB 1.4 (Jackson > 2.7.1)
this.builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(ISO_DATE_OPTIONAL_TIME));
}
@Bean
public ObjectMapper jacksonObjectMapper() {
return this.builder.createXmlMapper(false).build();
public Jackson2ObjectMapperBuilderCustomizer jacksonCustomizer() {
return new Jackson2ObjectMapperBuilderCustomizer() {
@Override
public void customize(Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder) {
jackson2ObjectMapperBuilder.serializers(new ZonedDateTimeSerializer(ISO_FIXED_FORMAT));
}
};
}
}

View File

@ -1,6 +1,6 @@
package io.github.jhipster.sample.config;
import org.apache.commons.lang.CharEncoding;
import org.apache.commons.lang3.CharEncoding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.*;

View File

@ -5,13 +5,11 @@ import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import io.github.jhipster.sample.web.filter.CachingHttpHeadersFilter;
import org.apache.catalina.webresources.StandardRoot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.embedded.*;
import org.springframework.boot.context.embedded.tomcat.*;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -60,7 +58,7 @@ public class WebConfigurer implements ServletContextInitializer, EmbeddedServlet
}
/**
* Customize the Tomcat engine: Mime types, the document root, the cache.
* Customize the Servlet engine: Mime types, the document root, the cache.
*/
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
@ -70,27 +68,10 @@ public class WebConfigurer implements ServletContextInitializer, EmbeddedServlet
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", "text/html;charset=utf-8");
container.setMimeMappings(mappings);
customizeTomcat(container);
// When running in an IDE or with ./mvnw spring-boot:run, set location of the static web assets.
setLocationForStaticAssets(container);
}
/**
* Customize Tomcat configuration.
*/
private void customizeTomcat(ConfigurableEmbeddedServletContainer container) {
if (container instanceof TomcatEmbeddedServletContainerFactory) {
TomcatEmbeddedServletContainerFactory tomcatFactory = (TomcatEmbeddedServletContainerFactory) container;
tomcatFactory.addContextCustomizers((TomcatContextCustomizer) context -> {
// See https://github.com/jhipster/generator-jhipster/issues/3995
StandardRoot resources = new StandardRoot();
resources.setCacheMaxSize(40960);
resources.setCacheObjectMaxSize(2048);
context.setResources(resources);
});
}
}
private void setLocationForStaticAssets(ConfigurableEmbeddedServletContainer container) {
File root;
String prefixPath = resolvePathPrefix();

View File

@ -1,11 +1,9 @@
package io.github.jhipster.sample.domain;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@ -24,8 +22,6 @@ public class PersistentToken implements Serializable {
private static final long serialVersionUID = 1L;
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("d MMMM yyyy");
private static final int MAX_USER_AGENT_LEN = 255;
@Id
@ -35,8 +31,7 @@ public class PersistentToken implements Serializable {
@NotNull
@Column(name = "token_value", nullable = false)
private String tokenValue;
@JsonIgnore
@Column(name = "token_date")
private LocalDate tokenDate;
@ -76,11 +71,6 @@ public class PersistentToken implements Serializable {
this.tokenDate = tokenDate;
}
@JsonGetter
public String getFormattedTokenDate() {
return DATE_TIME_FORMATTER.format(this.tokenDate);
}
public String getIpAddress() {
return ipAddress;
}

View File

@ -28,7 +28,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findOneById(Long userId);
@Query(value = "select distinct user from User user join fetch user.authorities",
@Query(value = "select distinct user from User user left join fetch user.authorities",
countQuery = "select count(user) from User user")
Page<User> findAllWithAuthorities(Pageable pageable);

View File

@ -44,15 +44,19 @@ public final class SecurityUtils {
*/
public static boolean isAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.getContext();
Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities();
if (authorities != null) {
for (GrantedAuthority authority : authorities) {
if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) {
return false;
Authentication authentication = securityContext.getAuthentication();
if (authentication != null) {
Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
if (authorities != null) {
for (GrantedAuthority authority : authorities) {
if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) {
return false;
}
}
}
return true;
}
return true;
return false;
}
/**

View File

@ -3,7 +3,7 @@ package io.github.jhipster.sample.service;
import io.github.jhipster.sample.config.JHipsterProperties;
import io.github.jhipster.sample.domain.User;
import org.apache.commons.lang.CharEncoding;
import org.apache.commons.lang3.CharEncoding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;

View File

@ -1,6 +1,6 @@
package io.github.jhipster.sample.service.util;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;
/**
* Utility class for generating random Strings.

View File

@ -14,7 +14,7 @@ import io.github.jhipster.sample.web.rest.vm.KeyAndPasswordVM;
import io.github.jhipster.sample.web.rest.vm.ManagedUserVM;
import io.github.jhipster.sample.web.rest.util.HeaderUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;

View File

@ -1,18 +1,18 @@
package io.github.jhipster.sample.web.rest;
import io.github.jhipster.sample.config.DefaultProfileUtil;
import io.github.jhipster.sample.config.JHipsterProperties;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@RestController
@RequestMapping("/api")
public class ProfileInfoResource {
@ -27,11 +27,11 @@ public class ProfileInfoResource {
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ProfileInfoResponse getActiveProfiles() {
return new ProfileInfoResponse(env.getActiveProfiles(), getRibbonEnv());
return new ProfileInfoResponse(DefaultProfileUtil.getActiveProfiles(env), getRibbonEnv());
}
private String getRibbonEnv() {
String[] activeProfiles = env.getActiveProfiles();
String[] activeProfiles = DefaultProfileUtil.getActiveProfiles(env);
String[] displayOnActiveProfiles = jHipsterProperties.getRibbon().getDisplayOnActiveProfiles();
if (displayOnActiveProfiles == null) {
@ -53,9 +53,9 @@ public class ProfileInfoResource {
public String[] activeProfiles;
public String ribbonEnv;
ProfileInfoResponse(String[] activeProfiles,String ribbonEnv) {
this.activeProfiles=activeProfiles;
this.ribbonEnv=ribbonEnv;
ProfileInfoResponse(String[] activeProfiles, String ribbonEnv) {
this.activeProfiles = activeProfiles;
this.ribbonEnv = ribbonEnv;
}
}
}

View File

@ -19,6 +19,8 @@ public class ManagedUserVM extends UserDTO {
private Long id;
private String createdBy;
private ZonedDateTime createdDate;
private String lastModifiedBy;
@ -35,6 +37,7 @@ public class ManagedUserVM extends UserDTO {
public ManagedUserVM(User user) {
super(user);
this.id = user.getId();
this.createdBy = user.getCreatedBy();
this.createdDate = user.getCreatedDate();
this.lastModifiedBy = user.getLastModifiedBy();
this.lastModifiedDate = user.getLastModifiedDate();
@ -42,9 +45,11 @@ public class ManagedUserVM extends UserDTO {
}
public ManagedUserVM(Long id, String login, String password, String firstName, String lastName,
String email, boolean activated, String langKey, Set<String> authorities , ZonedDateTime createdDate, String lastModifiedBy, ZonedDateTime lastModifiedDate ) {
String email, boolean activated, String langKey, Set<String> authorities,
String createdBy, ZonedDateTime createdDate, String lastModifiedBy, ZonedDateTime lastModifiedDate) {
super(login, firstName, lastName, email, activated, langKey, authorities);
this.id = id;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.lastModifiedBy = lastModifiedBy;
this.lastModifiedDate = lastModifiedDate;
@ -59,6 +64,15 @@ public class ManagedUserVM extends UserDTO {
this.id = id;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public ZonedDateTime getCreatedDate() {
return createdDate;
}
@ -91,6 +105,7 @@ public class ManagedUserVM extends UserDTO {
public String toString() {
return "ManagedUserVM{" +
"id=" + id +
", createdBy=" + createdBy +
", createdDate=" + createdDate +
", lastModifiedBy='" + lastModifiedBy + '\'' +
", lastModifiedDate=" + lastModifiedDate +

View File

@ -46,8 +46,6 @@ spring:
cache-seconds: 1
thymeleaf:
cache: false
profiles:
include: swagger # automatically set the 'swagger' profile
liquibase:
contexts: dev

View File

@ -156,7 +156,7 @@
<createIndex indexName="idx_persistent_audit_event"
tableName="jhi_persistent_audit_event"
unique="false">
<column name="principal" type="50"/>
<column name="principal" type="varchar(50)"/>
<column name="event_date" type="timestamp"/>
</createIndex>

View File

@ -1,2 +0,0 @@
client_id;resource_ids;client_secret;scope;authorized_grant_types;web_server_redirect_uri;authorities;access_token_validity;refresh_token_validity;additional_information;autoapprove
jhipsterSampleApplicationapp;res_jhipsterSampleApplication;my-secret-token-to-change-in-production;read,write;password,refresh_token,authorization_code,implicit;;ROLE_ADMIN,ROLE_USER;1800;2000;{};true
1 client_id resource_ids client_secret scope authorized_grant_types web_server_redirect_uri authorities access_token_validity refresh_token_validity additional_information autoapprove
2 jhipsterSampleApplicationapp res_jhipsterSampleApplication my-secret-token-to-change-in-production read,write password,refresh_token,authorization_code,implicit ROLE_ADMIN,ROLE_USER 1800 2000 {} true

View File

@ -32,6 +32,7 @@
<logger name="com.ryantenney" level="WARN"/>
<logger name="com.sun" level="WARN"/>
<logger name="com.zaxxer" level="WARN"/>
<logger name="io.undertow" level="WARN"/>
<logger name="net.sf.ehcache" level="WARN"/>
<logger name="org.apache" level="WARN"/>
<logger name="org.apache.catalina.startup.DigesterFactory" level="OFF"/>

View File

@ -1,13 +1,13 @@
<div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 translate="activate.title">Activation</h1>
<h1 data-translate="activate.title">Activation</h1>
<div class="alert alert-success" ng-show="vm.success" translate="activate.messages.success" translate-compile>
<div class="alert alert-success" ng-show="vm.success" data-translate="activate.messages.success" translate-compile>
<strong>Your user has been activated.</strong> Please <a class="alert-link" href="" ng-click="vm.login()">sign in</a>.
</div>
<div class="alert alert-danger" ng-show="vm.error" translate="activate.messages.error">
<div class="alert alert-danger" ng-show="vm.error" data-translate="activate.messages.error">
<strong>Your user could not be activated.</strong> Please use the registration form to sign up.
</div>

View File

@ -11,7 +11,7 @@
replace: true,
restrict: 'E',
template: '<div id="strength">' +
'<small translate="global.messages.validate.newpassword.strength">Password strength:</small>' +
'<small data-translate="global.messages.validate.newpassword.strength">Password strength:</small>' +
'<ul id="strengthBar">' +
'<li class="point"></li><li class="point"></li><li class="point"></li><li class="point"></li><li class="point"></li>' +
'</ul>' +

View File

@ -1,62 +1,62 @@
<div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 translate="password.title" translate-values="{username: '{{vm.account.login}}'}">Password for [<b>{{vm.account.login}}</b>]</h2>
<h2 data-translate="password.title" translate-values="{username: '{{vm.account.login}}'}">Password for [<b>{{vm.account.login}}</b>]</h2>
<div class="alert alert-success" ng-show="vm.success" translate="password.messages.success">
<div class="alert alert-success" ng-show="vm.success" data-translate="password.messages.success">
<strong>Password changed!</strong>
</div>
<div class="alert alert-danger" ng-show="vm.error" translate="password.messages.error">
<div class="alert alert-danger" ng-show="vm.error" data-translate="password.messages.error">
<strong>An error has occurred!</strong> The password could not be changed.
</div>
<div class="alert alert-danger" ng-show="vm.doNotMatch" translate="global.messages.error.dontmatch">
<div class="alert alert-danger" ng-show="vm.doNotMatch" data-translate="global.messages.error.dontmatch">
The password and its confirmation do not match!
</div>
<form name="form" role="form" novalidate ng-submit="vm.changePassword()" show-validation>
<div class="form-group">
<label class="control-label" for="password" translate="global.form.newpassword">New password</label>
<label class="control-label" for="password" data-translate="global.form.newpassword">New password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="{{'global.form.newpassword.placeholder' | translate}}"
ng-model="vm.password" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.password.$dirty && form.password.$invalid">
<p class="help-block"
ng-show="form.password.$error.required" translate="global.messages.validate.newpassword.required">
ng-show="form.password.$error.required" data-translate="global.messages.validate.newpassword.required">
Your password is required.
</p>
<p class="help-block"
ng-show="form.password.$error.minlength" translate="global.messages.validate.newpassword.minlength">
ng-show="form.password.$error.minlength" data-translate="global.messages.validate.newpassword.minlength">
Your password is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.password.$error.maxlength" translate="global.messages.validate.newpassword.maxlength">
ng-show="form.password.$error.maxlength" data-translate="global.messages.validate.newpassword.maxlength">
Your password cannot be longer than 50 characters.
</p>
</div>
<password-strength-bar password-to-check="vm.password"></password-strength-bar>
</div>
<div class="form-group">
<label class="control-label" for="confirmPassword" translate="global.form.confirmpassword">New password confirmation</label>
<label class="control-label" for="confirmPassword" data-translate="global.form.confirmpassword">New password confirmation</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="{{'global.form.confirmpassword.placeholder' | translate}}"
ng-model="vm.confirmPassword" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.confirmPassword.$dirty && form.confirmPassword.$invalid">
<p class="help-block"
ng-show="form.confirmPassword.$error.required" translate="global.messages.validate.confirmpassword.required">
ng-show="form.confirmPassword.$error.required" data-translate="global.messages.validate.confirmpassword.required">
Your confirmation password is required.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.minlength" translate="global.messages.validate.confirmpassword.minlength">
ng-show="form.confirmPassword.$error.minlength" data-translate="global.messages.validate.confirmpassword.minlength">
Your confirmation password is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.maxlength" translate="global.messages.validate.confirmpassword.maxlength">
ng-show="form.confirmPassword.$error.maxlength" data-translate="global.messages.validate.confirmpassword.maxlength">
Your confirmation password cannot be longer than 50 characters.
</p>
</div>
</div>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="password.form.button">Save</button>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" data-translate="password.form.button">Save</button>
</form>
</div>
</div>

View File

@ -1,25 +1,25 @@
<div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 translate="register.title">Registration</h1>
<h1 data-translate="register.title">Registration</h1>
<div class="alert alert-success" ng-show="vm.success" translate="register.messages.success">
<div class="alert alert-success" ng-show="vm.success" data-translate="register.messages.success">
<strong>Registration saved!</strong> Please check your email for confirmation.
</div>
<div class="alert alert-danger" ng-show="vm.error" translate="register.messages.error.fail">
<div class="alert alert-danger" ng-show="vm.error" data-translate="register.messages.error.fail">
<strong>Registration failed!</strong> Please try again later.
</div>
<div class="alert alert-danger" ng-show="vm.errorUserExists" translate="register.messages.error.userexists">
<div class="alert alert-danger" ng-show="vm.errorUserExists" data-translate="register.messages.error.userexists">
<strong>Login name already registered!</strong> Please choose another one.
</div>
<div class="alert alert-danger" ng-show="vm.errorEmailExists" translate="register.messages.error.emailexists">
<div class="alert alert-danger" ng-show="vm.errorEmailExists" data-translate="register.messages.error.emailexists">
<strong>E-mail is already in use!</strong> Please choose another one.
</div>
<div class="alert alert-danger" ng-show="vm.doNotMatch" translate="global.messages.error.dontmatch">
<div class="alert alert-danger" ng-show="vm.doNotMatch" data-translate="global.messages.error.dontmatch">
The password and its confirmation do not match!
</div>
</div>
@ -27,95 +27,95 @@
<form ng-show="!vm.success" name="form" role="form" novalidate ng-submit="vm.register()" show-validation>
<div class="form-group">
<label class="control-label" for="login" translate="global.form.username">Username</label>
<label class="control-label" for="login" data-translate="global.form.username">Username</label>
<input type="text" class="form-control" id="login" name="login" placeholder="{{'global.form.username.placeholder' | translate}}"
ng-model="vm.registerAccount.login" ng-minlength=1 ng-maxlength=50 ng-pattern="/^[_'.@A-Za-z0-9-]*$/" required>
<div ng-show="form.login.$dirty && form.login.$invalid">
<p class="help-block"
ng-show="form.login.$error.required" translate="register.messages.validate.login.required">
ng-show="form.login.$error.required" data-translate="register.messages.validate.login.required">
Your username is required.
</p>
<p class="help-block"
ng-show="form.login.$error.minlength" translate="register.messages.validate.login.minlength">
ng-show="form.login.$error.minlength" data-translate="register.messages.validate.login.minlength">
Your username is required to be at least 1 character.
</p>
<p class="help-block"
ng-show="form.login.$error.maxlength" translate="register.messages.validate.login.maxlength">
ng-show="form.login.$error.maxlength" data-translate="register.messages.validate.login.maxlength">
Your username cannot be longer than 50 characters.
</p>
<p class="help-block"
ng-show="form.login.$error.pattern" translate="register.messages.validate.login.pattern">
ng-show="form.login.$error.pattern" data-translate="register.messages.validate.login.pattern">
Your username can only contain lower-case letters and digits.
</p>
</div>
</div>
<div class="form-group">
<label class="control-label" for="email" translate="global.form.email">E-mail</label>
<label class="control-label" for="email" data-translate="global.form.email">E-mail</label>
<input type="email" class="form-control" id="email" name="email" placeholder="{{'global.form.email.placeholder' | translate}}"
ng-model="vm.registerAccount.email" ng-minlength=5 ng-maxlength=100 required>
<div ng-show="form.email.$dirty && form.email.$invalid">
<p class="help-block"
ng-show="form.email.$error.required" translate="global.messages.validate.email.required">
ng-show="form.email.$error.required" data-translate="global.messages.validate.email.required">
Your e-mail is required.
</p>
<p class="help-block"
ng-show="form.email.$error.email" translate="global.messages.validate.email.invalid">
ng-show="form.email.$error.email" data-translate="global.messages.validate.email.invalid">
Your e-mail is invalid.
</p>
<p class="help-block"
ng-show="form.email.$error.minlength" translate="global.messages.validate.email.minlength">
ng-show="form.email.$error.minlength" data-translate="global.messages.validate.email.minlength">
Your e-mail is required to be at least 5 characters.
</p>
<p class="help-block"
ng-show="form.email.$error.maxlength" translate="global.messages.validate.email.maxlength">
ng-show="form.email.$error.maxlength" data-translate="global.messages.validate.email.maxlength">
Your e-mail cannot be longer than 100 characters.
</p>
</div>
</div>
<div class="form-group">
<label class="control-label" for="password" translate="global.form.newpassword">New password</label>
<label class="control-label" for="password" data-translate="global.form.newpassword">New password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="{{'global.form.newpassword.placeholder' | translate}}"
ng-model="vm.registerAccount.password" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.password.$dirty && form.password.$invalid">
<p class="help-block"
ng-show="form.password.$error.required" translate="global.messages.validate.newpassword.required">
ng-show="form.password.$error.required" data-translate="global.messages.validate.newpassword.required">
Your password is required.
</p>
<p class="help-block"
ng-show="form.password.$error.minlength" translate="global.messages.validate.newpassword.minlength">
ng-show="form.password.$error.minlength" data-translate="global.messages.validate.newpassword.minlength">
Your password is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.password.$error.maxlength" translate="global.messages.validate.newpassword.maxlength">
ng-show="form.password.$error.maxlength" data-translate="global.messages.validate.newpassword.maxlength">
Your password cannot be longer than 50 characters.
</p>
</div>
<password-strength-bar password-to-check="vm.registerAccount.password"></password-strength-bar>
</div>
<div class="form-group">
<label class="control-label" for="confirmPassword" translate="global.form.confirmpassword">New password confirmation</label>
<label class="control-label" for="confirmPassword" data-translate="global.form.confirmpassword">New password confirmation</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="{{'global.form.confirmpassword.placeholder' | translate}}"
ng-model="vm.confirmPassword" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.confirmPassword.$dirty && form.confirmPassword.$invalid">
<p class="help-block"
ng-show="form.confirmPassword.$error.required" translate="global.messages.validate.confirmpassword.required">
ng-show="form.confirmPassword.$error.required" data-translate="global.messages.validate.confirmpassword.required">
Your confirmation password is required.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.minlength" translate="global.messages.validate.confirmpassword.minlength">
ng-show="form.confirmPassword.$error.minlength" data-translate="global.messages.validate.confirmpassword.minlength">
Your confirmation password is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.maxlength" translate="global.messages.validate.confirmpassword.maxlength">
ng-show="form.confirmPassword.$error.maxlength" data-translate="global.messages.validate.confirmpassword.maxlength">
Your confirmation password cannot be longer than 50 characters.
</p>
</div>
</div>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="register.form.button">Register</button>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" data-translate="register.form.button">Register</button>
</form>
<p></p>
<div class="alert alert-warning" translate="global.messages.info.authenticated" translate-compile>
<div class="alert alert-warning" data-translate="global.messages.info.authenticated" translate-compile>
If you want to <a class="alert-link" href="" ng-click="vm.login()">sign in</a>, you can try the default accounts:<br/>- Administrator (login="admin" and password="admin") <br/>- User (login="user" and password="user").
</div>
</div>

View File

@ -1,45 +1,45 @@
<div>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<h1 translate="reset.finish.title">Reset password</h1>
<h1 data-translate="reset.finish.title">Reset password</h1>
<div class="alert alert-danger" translate="reset.finish.messages.keymissing" ng-show="vm.keyMissing">
<div class="alert alert-danger" data-translate="reset.finish.messages.keymissing" ng-show="vm.keyMissing">
<strong>The password reset key is missing.</strong>
</div>
<div class="alert alert-warning" ng-hide="vm.success || vm.keyMissing">
<p translate="reset.finish.messages.info">Choose a new password</p>
<p data-translate="reset.finish.messages.info">Choose a new password</p>
</div>
<div class="alert alert-danger" ng-show="vm.error">
<p translate="reset.finish.messages.error">Your password couldn't be reset. Remember a password request is only valid for 24 hours.</p>
<p data-translate="reset.finish.messages.error">Your password couldn't be reset. Remember a password request is only valid for 24 hours.</p>
</div>
<div class="alert alert-success" ng-show="vm.success">
<p translate="reset.finish.messages.success" translate-compile><strong>Your password has been reset.</strong> Please <a class="alert-link" href="" ng-click="vm.login()">sign in</a>.</p>
<p data-translate="reset.finish.messages.success" translate-compile><strong>Your password has been reset.</strong> Please <a class="alert-link" href="" ng-click="vm.login()">sign in</a>.</p>
</div>
<div class="alert alert-danger" ng-show="vm.doNotMatch" translate="global.messages.error.dontmatch">
<div class="alert alert-danger" ng-show="vm.doNotMatch" data-translate="global.messages.error.dontmatch">
The password and its confirmation do not match!
</div>
<div ng-hide="vm.keyMissing">
<form ng-show="!vm.success" name="form" role="form" novalidate ng-submit="vm.finishReset()" show-validation>
<div class="form-group">
<label class="control-label" for="password" translate="global.form.newpassword">New password</label>
<label class="control-label" for="password" data-translate="global.form.newpassword">New password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="{{'global.form.newpassword.placeholder' | translate}}"
ng-model="vm.resetAccount.password" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.password.$dirty && form.password.$invalid">
<p class="help-block"
ng-show="form.password.$error.required" translate="global.messages.validate.newpassword.required">
ng-show="form.password.$error.required" data-translate="global.messages.validate.newpassword.required">
Your password is required.
</p>
<p class="help-block"
ng-show="form.password.$error.minlength" translate="global.messages.validate.newpassword.minlength">
ng-show="form.password.$error.minlength" data-translate="global.messages.validate.newpassword.minlength">
Your password is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.password.$error.maxlength" translate="global.messages.validate.newpassword.maxlength">
ng-show="form.password.$error.maxlength" data-translate="global.messages.validate.newpassword.maxlength">
Your password cannot be longer than 50 characters.
</p>
</div>
@ -47,25 +47,25 @@
</div>
<div class="form-group">
<label class="control-label" for="confirmPassword" translate="global.form.confirmpassword">New password confirmation</label>
<label class="control-label" for="confirmPassword" data-translate="global.form.confirmpassword">New password confirmation</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="{{'global.form.confirmpassword.placeholder' | translate}}"
ng-model="vm.confirmPassword" ng-minlength=4 ng-maxlength=50 required>
<div ng-show="form.confirmPassword.$dirty && form.confirmPassword.$invalid">
<p class="help-block"
ng-show="form.confirmPassword.$error.required" translate="global.messages.validate.confirmpassword.required">
ng-show="form.confirmPassword.$error.required" data-translate="global.messages.validate.confirmpassword.required">
Your password confirmation is required.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.minlength" translate="global.messages.validate.confirmpassword.minlength">
ng-show="form.confirmPassword.$error.minlength" data-translate="global.messages.validate.confirmpassword.minlength">
Your password confirmation is required to be at least 4 characters.
</p>
<p class="help-block"
ng-show="form.confirmPassword.$error.maxlength" translate="global.messages.validate.confirmpassword.maxlength">
ng-show="form.confirmPassword.$error.maxlength" data-translate="global.messages.validate.confirmpassword.maxlength">
Your password confirmation cannot be longer than 50 characters.
</p>
</div>
</div>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="reset.finish.form.button">Reset Password</button>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" data-translate="reset.finish.form.button">Reset Password</button>
</form>
</div>

View File

@ -1,45 +1,45 @@
<div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 translate="reset.request.title">Reset your password</h1>
<h1 data-translate="reset.request.title"