Skip to content

Commit

Permalink
Release v2.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed Jun 30, 2015
1 parent 9e99f1f commit 68ccb25
Show file tree
Hide file tree
Showing 31 changed files with 107 additions and 660 deletions.
23 changes: 16 additions & 7 deletions Gruntfile.js
@@ -1,4 +1,4 @@
// Generated on 2015-06-17 using generator-jhipster 2.16.1
// Generated on 2015-06-30 using generator-jhipster 2.17.0
'use strict';
var fs = require('fs');

Expand Down Expand Up @@ -52,13 +52,12 @@ module.exports = function (grunt) {
app: {
src: ['src/main/webapp/index.html'],
exclude: [
/angular-i18n/, // localizations are loaded dynamically
/swagger-ui/
/angular-i18n/ // localizations are loaded dynamically
]
},
test: {
src: 'src/test/javascript/karma.conf.js',
exclude: [/angular-i18n/, /swagger-ui/, /angular-scenario/],
exclude: [/angular-i18n/, /angular-scenario/],
ignorePath: /\.\.\/\.\.\//, // remove ../../ from paths of injected javascripts
devDependencies: true,
fileTypes: {
Expand Down Expand Up @@ -184,9 +183,6 @@ module.exports = function (grunt) {
}
},
cssmin: {
options: {
root: 'src/main/webapp' // Replace relative paths for static resources with absolute path
}
// src and dest is configured in a subtask called "generated" by usemin
},
ngtemplates: {
Expand Down Expand Up @@ -235,6 +231,18 @@ module.exports = function (grunt) {
},
// Put files not handled in other tasks here
copy: {
fonts: {
files: [{
expand: true,
dot: true,
flatten: true,
cwd: 'src/main/webapp',
dest: '<%= yeoman.dist %>/assets/fonts',
src: [
'bower_components/bootstrap/fonts/*.*'
]
}]
},
dist: {
files: [{
expand: true,
Expand Down Expand Up @@ -352,6 +360,7 @@ module.exports = function (grunt) {
'imagemin',
'svgmin',
'concat',
'copy:fonts',
'copy:dist',
'ngAnnotate',
'cssmin',
Expand Down
1 change: 0 additions & 1 deletion bower.json
Expand Up @@ -19,7 +19,6 @@
"angular-translate-loader-partial": "2.7.0",
"angular-dynamic-locale": "0.1.27",
"angular-local-storage": "0.2.0",
"swagger-ui": "2.0.24",
"angular-cache-buster": "0.4.3",
"ngInfiniteScroll": "1.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,7 +41,7 @@
"karma-phantomjs-launcher": "0.2.0",
"phantomjs": "1.9.17",
"karma": "0.12.35",
"generator-jhipster": "2.16.1",
"generator-jhipster": "2.17.0",
"lodash": "3.3.1",
"xml2js": "0.4.5",
"yo": ">=1.3.0",
Expand Down
31 changes: 11 additions & 20 deletions pom.xml
Expand Up @@ -38,16 +38,16 @@
<liquibase.version>3.3.2</liquibase.version>
<liquibase-slf4j.version>1.2.1</liquibase-slf4j.version>
<liquibase-hibernate4.version>3.5</liquibase-hibernate4.version>
<mapstruct.version>1.0.0.Beta4</mapstruct.version>
<mapstruct.version>1.0.0.CR1</mapstruct.version>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<maven-enforcer-plugin.version>1.3.1</maven-enforcer-plugin.version>
<maven-sortpom-plugin.version>2.3.0</maven-sortpom-plugin.version>
<metrics-spark-reporter.version>1.2</metrics-spark-reporter.version>
<metrics-spring.version>3.0.4</metrics-spring.version>
<run.addResources>false</run.addResources>
<sonar-maven-plugin.version>2.3</sonar-maven-plugin.version>
<spring-security.version>4.0.0.RELEASE</spring-security.version>
<swagger-springmvc.version>0.9.5</swagger-springmvc.version>
<spring-security.version>4.0.1.RELEASE</spring-security.version>
<springfox.version>2.0.3</springfox.version>
<usertype-core.version>3.2.0.GA</usertype-core.version>
</properties>

Expand Down Expand Up @@ -136,23 +136,14 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mangofactory</groupId>
<artifactId>swagger-springmvc</artifactId>
<version>${swagger-springmvc.version}</version>
<exclusions>
<exclusion>
<artifactId>jackson-module-scala_2.10</artifactId>
<groupId>com.fasterxml.jackson.module</groupId>
</exclusion>
<exclusion>
<artifactId>scalap</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
<exclusion>
<artifactId>scala-compiler</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>com.mattbertolini</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mycompany/myapp/Application.java
Expand Up @@ -44,7 +44,7 @@ public void initApplication() throws IOException {
log.warn("No Spring profile configured, running with default configuration");
} else {
log.info("Running with Spring profile(s) : {}", Arrays.toString(env.getActiveProfiles()));
Collection activeProfiles = Arrays.asList(env.getActiveProfiles());
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains("dev") && activeProfiles.contains("prod")) {
log.error("You have misconfigured your application! " +
"It should not run with both the 'dev' and 'prod' profiles at the same time.");
Expand Down
Expand Up @@ -72,7 +72,7 @@ public void configure(WebSecurity web) throws Exception {
.antMatchers("/bower_components/**")
.antMatchers("/i18n/**")
.antMatchers("/assets/**")
.antMatchers("/swagger-ui/**")
.antMatchers("/swagger-ui.html")
.antMatchers("/test/**")
.antMatchers("/console/**");
}
Expand Down Expand Up @@ -118,6 +118,7 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/api/account/reset_password/finish").permitAll()
.antMatchers("/api/logs/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api/**").authenticated()
.antMatchers("/webjars/**").permitAll()
.antMatchers("/metrics/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/health/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/trace/**").hasAuthority(AuthoritiesConstants.ADMIN)
Expand All @@ -129,7 +130,10 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/autoconfig/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/env/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/trace/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api-docs/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/v2/api-docs/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/configuration/security").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/configuration/ui").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/swagger-ui.html").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/protected/**").authenticated();

}
Expand Down
@@ -1,10 +1,6 @@
package com.mycompany.myapp.config.apidoc;

import com.mycompany.myapp.config.Constants;
import com.mangofactory.swagger.configuration.SpringSwaggerConfig;
import com.mangofactory.swagger.models.dto.ApiInfo;
import com.mangofactory.swagger.plugin.EnableSwagger;
import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.bind.RelaxedPropertyResolver;
Expand All @@ -15,17 +11,23 @@
import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import static springfox.documentation.builders.PathSelectors.regex;

/**
* Swagger configuration.
* Springfox Swagger configuration.
*
* Warning! When having a lot of REST endpoints, Swagger can become a performance issue. In that
* Warning! When having a lot of REST endpoints, Springfox can become a performance issue. In that
* case, you can use a specific Spring profile for this class, so that only front-end developers
* have access to the Swagger view.
*/
@Configuration
@EnableSwagger
@Profile("!" + Constants.SPRING_PROFILE_FAST)
@EnableSwagger2
@Profile("!"+Constants.SPRING_PROFILE_PRODUCTION)
public class SwaggerConfiguration implements EnvironmentAware {

private final Logger log = LoggerFactory.getLogger(SwaggerConfiguration.class);
Expand All @@ -40,19 +42,19 @@ public void setEnvironment(Environment environment) {
}

/**
* Swagger Spring MVC configuration.
* Swagger Springfox configuration.
*/
@Bean
public SwaggerSpringMvcPlugin swaggerSpringMvcPlugin(SpringSwaggerConfig springSwaggerConfig) {
public Docket swaggerSpringfoxDocket() {
log.debug("Starting Swagger");
StopWatch watch = new StopWatch();
watch.start();
SwaggerSpringMvcPlugin swaggerSpringMvcPlugin = new SwaggerSpringMvcPlugin(springSwaggerConfig)
Docket swaggerSpringMvcPlugin = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.genericModelSubstitutes(ResponseEntity.class)
.includePatterns(DEFAULT_INCLUDE_PATTERN);

swaggerSpringMvcPlugin.build();
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN)) // and by paths
.build();
watch.stop();
log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
return swaggerSpringMvcPlugin;
Expand All @@ -63,11 +65,12 @@ public SwaggerSpringMvcPlugin swaggerSpringMvcPlugin(SpringSwaggerConfig springS
*/
private ApiInfo apiInfo() {
return new ApiInfo(
propertyResolver.getProperty("title"),
propertyResolver.getProperty("description"),
propertyResolver.getProperty("termsOfServiceUrl"),
propertyResolver.getProperty("contact"),
propertyResolver.getProperty("license"),
propertyResolver.getProperty("licenseUrl"));
propertyResolver.getProperty("title"),
propertyResolver.getProperty("description"),
propertyResolver.getProperty("version"),
propertyResolver.getProperty("termsOfServiceUrl"),
propertyResolver.getProperty("contact"),
propertyResolver.getProperty("license"),
propertyResolver.getProperty("licenseUrl"));
}
}
Expand Up @@ -15,8 +15,6 @@
*/
public class DatabaseHealthIndicator extends AbstractHealthIndicator {

private DataSource dataSource;

private JdbcTemplate jdbcTemplate;

private static Map<String, String> queries = new HashMap<>();
Expand All @@ -36,7 +34,6 @@ public class DatabaseHealthIndicator extends AbstractHealthIndicator {
private String query = null;

public DatabaseHealthIndicator(DataSource dataSource) {
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(dataSource);
}

Expand Down
Expand Up @@ -21,7 +21,7 @@ public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt)
JsonToken t = jp.getCurrentToken();
if (t == JsonToken.VALUE_STRING) {
String str = jp.getText().trim();
return ISODateTimeFormat.dateTimeParser().parseLocalDate(str);
return ISODateTimeFormat.dateTimeParser().parseDateTime(str).toLocalDate();
}
if (t == JsonToken.VALUE_NUMBER_INT) {
return new LocalDate(jp.getLongValue());
Expand Down
Expand Up @@ -36,7 +36,7 @@ public static Pageable generatePageRequest(Integer offset, Integer limit) {
return new PageRequest(offset - 1, limit);
}

public static HttpHeaders generatePaginationHttpHeaders(Page page, String baseUrl, Integer offset, Integer limit)
public static HttpHeaders generatePaginationHttpHeaders(Page<?> page, String baseUrl, Integer offset, Integer limit)
throws URISyntaxException {

if (offset == null || offset < MIN_OFFSET) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application-prod.yml
Expand Up @@ -9,7 +9,7 @@ spring:
active: prod
datasource:
dataSourceClassName: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
url: jdbc:mysql://localhost:3306/jhipster
url: jdbc:mysql://localhost:3306/jhipster?useUnicode=true&characterEncoding=utf8
databaseName:
serverName:
username: root
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config/application.yml
Expand Up @@ -27,6 +27,7 @@ mail:
swagger:
title: jhipster API
description: jhipster applications and beyond!
version: 0.0.1
termsOfServiceUrl: http://jhipster.github.io/
contact:
license: Apache 2.0
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/logback.xml
Expand Up @@ -51,8 +51,7 @@
<logger name="org.springframework.cache" level="WARN"/>
<logger name="org.thymeleaf" level="WARN"/>
<logger name="org.xnio" level="WARN"/>
<logger name="com.mangofactory.swagger" level="WARN"/>
<logger name="com.wordnik.swagger" level="WARN"/>
<logger name="springfox" level="WARN"/>
<logger name="liquibase" level="WARN"/>
<logger name="sun.rmi.transport" level="WARN"/>

Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/i18n/en/global.json
Expand Up @@ -67,6 +67,9 @@
"maxlength": "Your e-mail cannot be longer than 50 characters."
}
}
},
"field": {
"id" : "ID"
}
},
"entity": {
Expand Down
5 changes: 4 additions & 1 deletion src/main/webapp/i18n/fr/global.json
Expand Up @@ -67,6 +67,9 @@
"invalid": "Votre email n'est pas valide."
}
}
},
"field": {
"id" : "ID"
}
},
"entity": {
Expand All @@ -91,7 +94,7 @@
"maxlength": "Ce champs doit faire moins de {{max}} caractères.",
"min": "Ce champs doit être inférieur à {{min}}.",
"max": "Ce champs doit être supérieur à {{max}}.",
"pattern": "Ce champs doit suivre l'expression régluière {{pattern}}.",
"pattern": "Ce champs doit suivre l'expression régulière {{pattern}}.",
"number": "Ce champs doit être un nombre.",
"datetimelocal": "Ce champs doit être une date et une heure."
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/webapp/i18n/fr/health.json
Expand Up @@ -2,12 +2,19 @@
"health": {
"title": "Diagnostics",
"refresh.button": "Rafraichir",
"stacktrace": "Stacktrace",
"details": {
"details": "Détails",
"properties": "Propriétés",
"name": "Nom",
"value": "Valeur",
"error": "Erreur"
},
"indicator": {
"diskSpace": "Espace disque",
"mail": "Email",
"db": "Base de données"
},
"stacktrace": "Stacktrace",
"table": {
"service": "Nom du service",
"status": "Etat"
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/app/account/settings/settings.html
Expand Up @@ -80,7 +80,7 @@ <h2 translate="settings.title" translate-values="{username: '{{settingsAccount.l
</div>
<div class="form-group">
<label translate="settings.form.language">Language</label>
<select name="langKey" class="form-control" ng-model="settingsAccount.langKey" ng-controller="LanguageController" ng-options="code as ('language.' + code | translate) for code in languages"></select>
<select name="langKey" class="form-control" ng-model="settingsAccount.langKey" ng-controller="LanguageController" ng-options="code as (code | findLanguageFromKey) for code in languages"></select>
</div>

<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="settings.form.button">Save</button>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/app/admin/docs/docs.html
@@ -1,2 +1,2 @@
<iframe src="swagger-ui/index.html" frameborder="0" marginheight="0" marginwidth="0"
<iframe src="swagger-ui.html" frameborder="0" marginheight="0" marginwidth="0"
width="100%" height="900" scrolling="auto" target='_top'></iframe>
3 changes: 1 addition & 2 deletions src/main/webapp/scripts/app/app.js
Expand Up @@ -53,7 +53,7 @@ angular.module('jhipsterApp', ['LocalStorageModule', 'tmh.dynamicLocale', 'pasca
responseError: function(response) {
// If we have an unauthorized request we redirect to the login page
// Don't do this check on the account API to avoid infinite loop
if (response.status == 401 && response.data.path!="/api/account"){
if (response.status == 401 && response.data.path !== undefined && response.data.path.indexOf("/api/account") == -1){
var Auth = $injector.get('Auth');
var $state = $injector.get('$state');
var to = $rootScope.toState;
Expand Down Expand Up @@ -93,7 +93,6 @@ angular.module('jhipsterApp', ['LocalStorageModule', 'tmh.dynamicLocale', 'pasca
],
translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {
$translatePartialLoader.addPart('global');
$translatePartialLoader.addPart('language');
}]
}
});
Expand Down

0 comments on commit 68ccb25

Please sign in to comment.