From 1ce55f0fcc62f4e9d772d2516a5e2975c421c877 Mon Sep 17 00:00:00 2001 From: lc-laptop Date: Tue, 23 Apr 2019 20:08:30 +0200 Subject: [PATCH 001/298] FIX Reimporting a JDL file is handled as a new project --- cli/import-jdl.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/import-jdl.js b/cli/import-jdl.js index 8f6262ddcd33..e04c77d2e557 100644 --- a/cli/import-jdl.js +++ b/cli/import-jdl.js @@ -268,6 +268,12 @@ class JDLProcessor { getConfig() { if (jhiCore.FileUtils.doesFileExist('.yo-rc.json')) { logger.info('Found .yo-rc.json on path. This is an existing app'); + if (!Object.prototype.hasOwnProperty.call(this.options, 'interactive')) { + this.options.interactive = true; + } + if (!Object.prototype.hasOwnProperty.call(this.options, 'skip-git')) { + this.options['skip-git'] = true; + } const configuration = jhipsterUtils.getAllJhipsterConfig(null, true); this.applicationType = configuration.applicationType; this.baseName = configuration.baseName; From 097e697e8c85ff0ee94fb02b330055ea7ef9969b Mon Sep 17 00:00:00 2001 From: lc-laptop Date: Tue, 23 Apr 2019 20:09:11 +0200 Subject: [PATCH 002/298] rewrite test --- test/cli/import-jdl.spec.js | 135 +++++++++++++++++++++++++++++++----- 1 file changed, 116 insertions(+), 19 deletions(-) diff --git a/test/cli/import-jdl.spec.js b/test/cli/import-jdl.spec.js index ebfbc8202621..c73d88343b9d 100644 --- a/test/cli/import-jdl.spec.js +++ b/test/cli/import-jdl.spec.js @@ -69,10 +69,18 @@ describe('JHipster generator import jdl', () => { '--skip-install', '--no-insight', '--interactive', + '--skip-git', '--with-entities', '--from-cli' ]); - expect(subGenCallParams.options[3]).to.eql(['--skip-prompts', '--skip-install', '--no-insight', '--interactive', '--from-cli']); + expect(subGenCallParams.options[3]).to.eql([ + '--skip-prompts', + '--skip-install', + '--no-insight', + '--interactive', + '--skip-git', + '--from-cli' + ]); }); }); describe('imports a JDL entity model with relations for mongodb', () => { @@ -104,10 +112,12 @@ describe('JHipster generator import jdl', () => { ]); expect(subGenCallParams.options[0]).to.eql({ regenerate: true, - force: true, + force: false, 'from-cli': true, + interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, + 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -174,11 +184,13 @@ describe('JHipster generator import jdl', () => { ]); expect(subGenCallParams.options[0]).to.eql({ regenerate: true, - force: true, + force: false, skipInstall: true, 'from-cli': true, + interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, + 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -231,11 +243,13 @@ describe('JHipster generator import jdl', () => { ]); expect(subGenCallParams.options[0]).to.eql({ regenerate: true, - force: true, + force: false, skipInstall: true, 'from-cli': true, + interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, + 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -261,11 +275,13 @@ describe('JHipster generator import jdl', () => { expect(subGenCallParams.commands).to.eql(['jhipster:entity WithSearch', 'jhipster:entity WithoutSearch']); expect(subGenCallParams.options[0]).to.eql({ regenerate: true, - force: true, + force: false, skipInstall: true, 'from-cli': true, + interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, + 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -277,7 +293,12 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['single-app-and-entities.jdl'], { skipInstall: true, noInsight: true }, env, mockFork(done, 1)); + importJdl( + ['single-app-and-entities.jdl'], + { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + env, + mockFork(done, 1) + ); }); }); @@ -290,14 +311,27 @@ describe('JHipster generator import jdl', () => { it('calls application generator', () => { expect(subGenCallParams.count).to.equal(1); expect(subGenCallParams.commands).to.eql(['jhipster:app']); - expect(subGenCallParams.options[0]).to.eql(['--skip-install', '--no-insight', '--with-entities', '--force', '--from-cli']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-install', + '--no-insight', + '--no-interactive', + '--no-skip-git', + '--with-entities', + '--force', + '--from-cli' + ]); }); }); describe('imports single app only', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['single-app-only.jdl'], { skipInstall: true, noInsight: true }, env, mockFork(done, 1)); + importJdl( + ['single-app-only.jdl'], + { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + env, + mockFork(done, 1) + ); }); }); @@ -307,14 +341,26 @@ describe('JHipster generator import jdl', () => { it('calls application generator', () => { expect(subGenCallParams.count).to.equal(1); expect(subGenCallParams.commands).to.eql(['jhipster:app']); - expect(subGenCallParams.options[0]).to.eql(['--skip-install', '--no-insight', '--force', '--from-cli']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-install', + '--no-insight', + '--no-interactive', + '--no-skip-git', + '--force', + '--from-cli' + ]); }); }); describe('imports multiple JDL apps and entities', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['apps-and-entities.jdl'], { skipInstall: true, noInsight: true }, env, mockFork(done, 3)); + importJdl( + ['apps-and-entities.jdl'], + { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + env, + mockFork(done, 3) + ); }); }); @@ -338,14 +384,27 @@ describe('JHipster generator import jdl', () => { it('calls application generator', () => { expect(subGenCallParams.count).to.equal(3); expect(subGenCallParams.commands).to.eql(['jhipster:app', 'jhipster:app', 'jhipster:app']); - expect(subGenCallParams.options[0]).to.eql(['--skip-install', '--no-insight', '--with-entities', '--force', '--from-cli']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-install', + '--no-insight', + '--no-interactive', + '--no-skip-git', + '--with-entities', + '--force', + '--from-cli' + ]); }); }); describe('skips JDL apps with --ignore-application', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['apps-and-entities.jdl'], { skipInstall: true, 'ignore-application': true }, env, mockFork(done, 6)); + importJdl( + ['apps-and-entities.jdl'], + { skipInstall: true, 'ignore-application': true, interactive: false, 'skip-git': false }, + env, + mockFork(done, 6) + ); }); }); @@ -376,14 +435,22 @@ describe('JHipster generator import jdl', () => { 'jhipster:entity F', 'jhipster:entity F' ]); - expect(subGenCallParams.options[0]).to.eql(['--skip-install', '--ignore-application', '--regenerate', '--from-cli', '--force']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-install', + '--ignore-application', + '--no-interactive', + '--no-skip-git', + '--regenerate', + '--from-cli', + '--force' + ]); }); }); describe('imports JDL deployments only', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['deployments.jdl'], { skipInstall: true }, env, mockFork(done, 3)); + importJdl(['deployments.jdl'], { skipInstall: true, interactive: false, 'skip-git': false }, env, mockFork(done, 3)); }); }); @@ -398,7 +465,14 @@ describe('JHipster generator import jdl', () => { const invokedSubgens = ['jhipster:docker-compose', 'jhipster:kubernetes', 'jhipster:openshift']; expect(subGenCallParams.commands).to.eql(invokedSubgens); expect(subGenCallParams.count).to.equal(invokedSubgens.length); - expect(subGenCallParams.options[0]).to.eql(['--skip-prompts', '--skip-install', '--force', '--from-cli']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-prompts', + '--skip-install', + '--no-interactive', + '--no-skip-git', + '--force', + '--from-cli' + ]); }); }); describe('imports multiple JDL apps, deployments and entities', () => { @@ -406,7 +480,12 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['apps-and-entities-and-deployments.jdl'], { skipInstall: true, noInsight: true }, env, mockFork(done, 5)); + importJdl( + ['apps-and-entities-and-deployments.jdl'], + { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + env, + mockFork(done, 5) + ); }); }); it('calls generator in order', () => { @@ -418,8 +497,24 @@ describe('JHipster generator import jdl', () => { 'jhipster:docker-compose', 'jhipster:kubernetes' ]); - expect(subGenCallParams.options[0]).to.eql(['--skip-install', '--no-insight', '--with-entities', '--force', '--from-cli']); - expect(subGenCallParams.options[3]).to.eql(['--skip-prompts', '--skip-install', '--no-insight', '--force', '--from-cli']); + expect(subGenCallParams.options[0]).to.eql([ + '--skip-install', + '--no-insight', + '--no-interactive', + '--no-skip-git', + '--with-entities', + '--force', + '--from-cli' + ]); + expect(subGenCallParams.options[3]).to.eql([ + '--skip-prompts', + '--skip-install', + '--no-insight', + '--no-interactive', + '--no-skip-git', + '--force', + '--from-cli' + ]); }); }); describe('creates config files', () => { @@ -458,7 +553,7 @@ describe('JHipster generator import jdl', () => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); importJdl( ['apps-and-entities-and-deployments.jdl'], - { skipInstall: true, noInsight: true, 'skip-deployments': true }, + { skipInstall: true, noInsight: true, 'skip-deployments': true, interactive: false, 'skip-git': false }, env, mockFork(done, 3) ); @@ -471,6 +566,8 @@ describe('JHipster generator import jdl', () => { '--skip-install', '--no-insight', '--skip-deployments', + '--no-interactive', + '--no-skip-git', '--with-entities', '--force', '--from-cli' From 966dc1561df7ecc3db0d94365fac0b8c6cf1270a Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 4 Apr 2019 08:19:32 +0200 Subject: [PATCH 003/298] Kafka: use official image from confluentinc --- generators/generator-constants.js | 4 ++-- .../server/templates/src/main/docker/kafka.yml.ejs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 7cca755faae5..76907bef519d 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -31,8 +31,8 @@ const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12'; const DOCKER_MEMCACHED = 'memcached:1.5.12-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project -const DOCKER_KAFKA = 'wurstmeister/kafka:2.11-2.0.1'; -const DOCKER_ZOOKEEPER = 'wurstmeister/zookeeper:3.4.6'; +const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.1'; +const DOCKER_ZOOKEEPER = 'confluentinc/cp-zookeeper:5.2.1'; const DOCKER_SONAR = 'sonarqube:7.7-community'; const DOCKER_JHIPSTER_CONSOLE = 'jhipster/jhipster-console:v4.0.0'; const DOCKER_JHIPSTER_CURATOR = 'jhipster/jhipster-curator:v4.0.0'; diff --git a/generators/server/templates/src/main/docker/kafka.yml.ejs b/generators/server/templates/src/main/docker/kafka.yml.ejs index 3f83ebb700c3..b5aaca42301a 100644 --- a/generators/server/templates/src/main/docker/kafka.yml.ejs +++ b/generators/server/templates/src/main/docker/kafka.yml.ejs @@ -20,14 +20,18 @@ version: '2' services: zookeeper: image: <%= DOCKER_ZOOKEEPER %> + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + ZOOKEEPER_SYNC_LIMIT: 2 ports: - 2181:2181 kafka: image: <%= DOCKER_KAFKA %> environment: - KAFKA_ADVERTISED_HOST_NAME: localhost - KAFKA_ADVERTISED_PORT: 9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_CREATE_TOPICS: "topic-jhipster:1:1" + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 + KAFKA_BROKER_ID: 2 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 ports: - 9092:9092 From 1998359a1ef750da26873ebd3c3cb24ea62bbd8a Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 16 Apr 2019 14:56:01 +0200 Subject: [PATCH 004/298] Kafka: update dependencies and Spring Boot configuration --- generators/server/templates/build.gradle.ejs | 4 +-- generators/server/templates/pom.xml.ejs | 14 ++++------ .../resources/config/application-dev.yml.ejs | 27 ++++++++++--------- .../resources/config/application-prod.yml.ejs | 27 ++++++++++--------- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 84baa91376bb..db0ef20a4efd 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -351,8 +351,6 @@ dependencies { implementation "org.springframework.boot:spring-boot-starter-data-<%=databaseType%><% if (reactive) { %>-reactive<% } %>" <%_ } _%> <%_ if (messageBroker === 'kafka') { _%> - implementation "org.springframework.cloud:spring-cloud-stream" - implementation "org.springframework.cloud:spring-cloud-stream-binder-kafka" implementation "org.springframework.kafka:spring-kafka" <%_ } _%> implementation "org.springframework.boot:spring-boot-starter-security" @@ -506,7 +504,7 @@ dependencies { liquibaseRuntime "com.oracle.jdbc:ojdbc8" <%_ } _%> <%_ if (messageBroker === 'kafka') { _%> - testImplementation "org.springframework.cloud:spring-cloud-stream-test-support" + testImplementation "org.springframework.kafka:spring-kafka-test" <%_ } _%> //jhipster-needle-gradle-dependency - JHipster will add additional dependencies here } diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 2b15da1f6ae4..65aaf5c7fdb3 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -562,16 +562,12 @@ <%_ if (messageBroker === 'kafka') { _%> - org.springframework.cloud - spring-cloud-stream - - - org.springframework.cloud - spring-cloud-stream-binder-kafka - + org.springframework.kafka + spring-kafka + - org.springframework.cloud - spring-cloud-stream-test-support + org.springframework.kafka + spring-kafka-test test <%_ } _%> diff --git a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs index 58325b9f744d..6db12c549cfd 100644 --- a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs @@ -67,25 +67,26 @@ spring: jackson: serialization: indent-output: true - <%_ if (messageBroker === 'kafka' || serviceDiscoveryType === 'consul') { _%> + <%_ if (messageBroker === 'kafka') { _%> + kafka: + consumer: + bootstrap-servers: localhost:9092 + group-id: group_id + auto-offset-reset: earliest + key-deserializer: org.apache.kafka.common.serialization.StringDeserializer + value-deserializer: org.apache.kafka.common.serialization.StringDeserializer + producer: + bootstrap-servers: localhost:9092 + key-serializer: org.apache.kafka.common.serialization.StringSerializer + value-serializer: org.apache.kafka.common.serialization.StringSerializer + <%_ } _%> + <%_ if (serviceDiscoveryType === 'consul') { _%> cloud: - <%_ if (serviceDiscoveryType === 'consul') { _%> consul: discovery: prefer-ip-address: true host: localhost port: 8500 - <%_ } _%> - <%_ if (messageBroker === 'kafka') { _%> - stream: - kafka: - binder: - brokers: localhost - zk-nodes: localhost - bindings: - output: - destination: topic-jhipster - <%_ } _%> <%_ } _%> <%_ if (databaseType === 'sql') { _%> datasource: diff --git a/generators/server/templates/src/main/resources/config/application-prod.yml.ejs b/generators/server/templates/src/main/resources/config/application-prod.yml.ejs index 517abce581c4..08995cb1b8fd 100644 --- a/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application-prod.yml.ejs @@ -58,25 +58,26 @@ spring: enabled: false livereload: enabled: false - <%_ if (messageBroker === 'kafka' || serviceDiscoveryType === 'consul') { _%> + <%_ if (messageBroker === 'kafka') { _%> + kafka: + consumer: + bootstrap-servers: localhost:9092 + group-id: group_id + auto-offset-reset: earliest + key-deserializer: org.apache.kafka.common.serialization.StringDeserializer + value-deserializer: org.apache.kafka.common.serialization.StringDeserializer + producer: + bootstrap-servers: localhost:9092 + key-serializer: org.apache.kafka.common.serialization.StringSerializer + value-serializer: org.apache.kafka.common.serialization.StringSerializer + <%_ } _%> + <%_ if (serviceDiscoveryType === 'consul') { _%> cloud: - <%_ if (serviceDiscoveryType === 'consul') { _%> consul: discovery: prefer-ip-address: true host: localhost port: 8500 - <%_ } _%> - <%_ if (messageBroker === 'kafka') { _%> - stream: - kafka: - binder: - brokers: localhost - zk-nodes: localhost - bindings: - output: - destination: topic-jhipster - <%_ } _%> <%_ } _%> <%_ if (databaseType === 'sql') { _%> datasource: From fd5de066ccac695130372c9db310c1808fea034d Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 16 Apr 2019 15:26:09 +0200 Subject: [PATCH 005/298] Kafka: generate sample Kafka resource --- generators/server/files.js | 12 ++++++ .../service/SampleKafkaConsumer.java.ejs | 37 ++++++++++++++++ .../service/SampleKafkaProducer.java.ejs | 42 ++++++++++++++++++ .../package/web/rest/KafkaResource.java.ejs | 43 +++++++++++++++++++ test/utils/expected-files.js | 8 +++- 5 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs create mode 100644 generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs create mode 100644 generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs diff --git a/generators/server/files.js b/generators/server/files.js index 62eedfbdf650..7bad0fa52e78 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -967,6 +967,18 @@ const serverFiles = { { file: 'package/config/MessagingConfiguration.java', renameTo: generator => `${generator.javaDir}config/MessagingConfiguration.java` + }, + { + file: 'package/web/rest/KafkaResource.java', + renameTo: generator => `${generator.javaDir}web/rest/KafkaResource.java` + }, + { + file: 'package/service/SampleKafkaConsumer.java', + renameTo: generator => `${generator.javaDir}service/SampleKafkaConsumer.java` + }, + { + file: 'package/service/SampleKafkaProducer.java', + renameTo: generator => `${generator.javaDir}service/SampleKafkaProducer.java` } ] } diff --git a/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs b/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs new file mode 100644 index 000000000000..e628f9096bf8 --- /dev/null +++ b/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs @@ -0,0 +1,37 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Service; + +import java.io.IOException; + +@Service +public class SampleKafkaConsumer { + + private final Logger logger = LoggerFactory.getLogger(SampleKafkaProducer.class); + + @KafkaListener(topics = "topic_jhipster", groupId = "group_id") + public void consume(String message) throws IOException { + logger.info(String.format("#### -> Consumed message -> %s", message)); + } +} diff --git a/generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs b/generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs new file mode 100644 index 000000000000..5c4684444f5d --- /dev/null +++ b/generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs @@ -0,0 +1,42 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Service; + +@Service +public class SampleKafkaProducer { + + private static final Logger logger = LoggerFactory.getLogger(SampleKafkaProducer.class); + private static final String TOPIC = "topic_jhipster"; + + private KafkaTemplate kafkaTemplate; + + public SampleKafkaProducer(KafkaTemplate kafkaTemplate) { + this.kafkaTemplate = kafkaTemplate; + } + + public void sendMessage(String message) { + logger.info(String.format("#### -> Producing message -> %s", message)); + this.kafkaTemplate.send(TOPIC, message); + } +} diff --git a/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs new file mode 100644 index 000000000000..18d9221e9031 --- /dev/null +++ b/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs @@ -0,0 +1,43 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.web.rest; + +import <%=packageName%>.service.SampleKafkaProducer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping(value = "/api/kafka") +public class KafkaResource { + + private final Logger log = LoggerFactory.getLogger(KafkaResource.class); + + private SampleKafkaProducer sampleKafkaProducer; + + public KafkaResource(SampleKafkaProducer sampleKafkaProducer) { + this.sampleKafkaProducer = sampleKafkaProducer; + } + + @PostMapping(value = "/publish") + public void sendMessageToKafkaTopic(@RequestParam("message") String message) { + log.debug("REST request to send to Kafka topic the message : {}", message); + this.sampleKafkaProducer.sendMessage(message); + } +} diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index 0deb5a0b674f..d15183be5b18 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -574,7 +574,13 @@ const expectedFiles = { `${DOCKER_DIR}keycloak.yml` ], - messageBroker: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/MessagingConfiguration.java`, `${DOCKER_DIR}kafka.yml`], + messageBroker: [ + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/MessagingConfiguration.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/KafkaResource.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaConsumer.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaProducer.java`, + `${DOCKER_DIR}kafka.yml` + ], swaggerCodegen: [`${SERVER_MAIN_RES_DIR}swagger/api.yml`], From 7ef5f67b0e1c8fbb6a06d058be23397d6343ebe0 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 16 Apr 2019 22:24:16 +0200 Subject: [PATCH 006/298] Kafka: remove MessagingConfiguration --- generators/server/files.js | 4 ---- test/utils/expected-files.js | 1 - 2 files changed, 5 deletions(-) diff --git a/generators/server/files.js b/generators/server/files.js index 7bad0fa52e78..e3a34adacb8a 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -964,10 +964,6 @@ const serverFiles = { condition: generator => generator.messageBroker === 'kafka', path: SERVER_MAIN_SRC_DIR, templates: [ - { - file: 'package/config/MessagingConfiguration.java', - renameTo: generator => `${generator.javaDir}config/MessagingConfiguration.java` - }, { file: 'package/web/rest/KafkaResource.java', renameTo: generator => `${generator.javaDir}web/rest/KafkaResource.java` diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index d15183be5b18..dde7edd4265e 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -575,7 +575,6 @@ const expectedFiles = { ], messageBroker: [ - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/MessagingConfiguration.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/KafkaResource.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaConsumer.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaProducer.java`, From 290f346bee539eb6a60682755492ceff2e0d9ae7 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 25 Apr 2019 20:14:57 +0200 Subject: [PATCH 007/298] Kafka: update config for Kubernetes and Openshift --- .../docker-compose/templates/kafka.yml.ejs | 10 ++++++--- .../kubernetes/templates/deployment.yml.ejs | 8 +++---- .../templates/messagebroker/kafka.yml.ejs | 21 ++++++++++++------- .../openshift/templates/deployment.yml.ejs | 8 +++---- .../templates/messagebroker/kafka.yml.ejs | 21 ++++++++++++------- .../templates/src/main/docker/app.yml.ejs | 13 +++--------- .../compose/09-kafka/src/main/docker/app.yml | 4 ++-- .../09-kafka/src/main/docker/kafka.yml | 16 +++++++------- 8 files changed, 57 insertions(+), 44 deletions(-) diff --git a/generators/docker-compose/templates/kafka.yml.ejs b/generators/docker-compose/templates/kafka.yml.ejs index 1cd6caf608f5..927ee48b0478 100644 --- a/generators/docker-compose/templates/kafka.yml.ejs +++ b/generators/docker-compose/templates/kafka.yml.ejs @@ -20,12 +20,16 @@ version: '<%= DOCKER_COMPOSE_FORMAT_VERSION %>' services: zookeeper: image: <%= DOCKER_ZOOKEEPER %> + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + ZOOKEEPER_SYNC_LIMIT: 2 kafka: image: <%= DOCKER_KAFKA %> environment: - KAFKA_ADVERTISED_HOST_NAME: kafka - KAFKA_ADVERTISED_PORT: 9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_CREATE_TOPICS: "topic-jhipster:1:1" + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_BROKER_ID: 2 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 #ports: # - 9092:9092 # Uncomment to make Kafka available externally diff --git a/generators/kubernetes/templates/deployment.yml.ejs b/generators/kubernetes/templates/deployment.yml.ejs index 773f8c80529e..fc81122d007c 100644 --- a/generators/kubernetes/templates/deployment.yml.ejs +++ b/generators/kubernetes/templates/deployment.yml.ejs @@ -151,10 +151,10 @@ spec: value: http://<%= app.baseName.toLowerCase() %>-elasticsearch.<%= kubernetesNamespace %>.svc.cluster.local:9200 <%_ } _%> <%_ if (app.messageBroker === 'kafka') { _%> - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES - value: jhipster-zookeeper.<%= kubernetesNamespace %>.svc.cluster.local + - name: SPRING_KAFKA_CONSUMER_BOOTSTRAP_SERVERS + value: 'jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local:9092' + - name: SPRING_KAFKA_PRODUCER_BOOTSTRAP_SERVERS + value: 'jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local:9092' <%_ } _%> <%_ if (monitoring === 'elk') { _%> - name: JHIPSTER_METRICS_LOGS_ENABLED diff --git a/generators/kubernetes/templates/messagebroker/kafka.yml.ejs b/generators/kubernetes/templates/messagebroker/kafka.yml.ejs index 58c4ea186429..ebddf4ea440f 100644 --- a/generators/kubernetes/templates/messagebroker/kafka.yml.ejs +++ b/generators/kubernetes/templates/messagebroker/kafka.yml.ejs @@ -39,14 +39,14 @@ spec: - name: kafka image: <%= DOCKER_KAFKA %> env: - - name: KAFKA_ADVERTISED_HOST_NAME - value: jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local - - name: KAFKA_ADVERTISED_PORT - value: '9092' - name: KAFKA_ZOOKEEPER_CONNECT - value: jhipster-zookeeper.<%= kubernetesNamespace %>.svc.cluster.local:2181 - - name: KAFKA_CREATE_TOPICS - value: 'topic-jhipster:1:1' + value: 'jhipster-zookeeper.<%= kubernetesNamespace %>.svc.cluster.local:2181' + - name: KAFKA_ADVERTISED_LISTENERS + value: 'PLAINTEXT://jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local:9092' + - name: KAFKA_BROKER_ID + value: '2' + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: '1' ports: - containerPort: 9092 --- @@ -83,6 +83,13 @@ spec: containers: - name: zookeeper image: <%= DOCKER_ZOOKEEPER %> + env: + - name: ZOOKEEPER_CLIENT_PORT + value: '2181' + - name: ZOOKEEPER_TICK_TIME + value: '2000' + - name: ZOOKEEPER_SYNC_LIMIT + value: '2' ports: - containerPort: 2181 --- diff --git a/generators/openshift/templates/deployment.yml.ejs b/generators/openshift/templates/deployment.yml.ejs index daaf60b3cf84..1d50a2266328 100644 --- a/generators/openshift/templates/deployment.yml.ejs +++ b/generators/openshift/templates/deployment.yml.ejs @@ -233,10 +233,10 @@ objects: value: http://${APPLICATION_NAME}-elasticsearch:9200 <%_ } _%> <%_ if (app.messageBroker === 'kafka') { _%> - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: jhipster-kafka - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES - value: jhipster-zookeeper + - name: SPRING_KAFKA_CONSUMER_BOOTSTRAP_SERVERS + value: jhipster-kafka:9092 + - name: SPRING_KAFKA_PRODUCER_BOOTSTRAP_SERVERS + value: jhipster-kafka:9092 <%_ } _%> <%_ if (monitoring === 'elk') { _%> - name: JHIPSTER_METRICS_LOGS_ENABLED diff --git a/generators/openshift/templates/messagebroker/kafka.yml.ejs b/generators/openshift/templates/messagebroker/kafka.yml.ejs index 53b1ce5fc6ab..399236b74785 100644 --- a/generators/openshift/templates/messagebroker/kafka.yml.ejs +++ b/generators/openshift/templates/messagebroker/kafka.yml.ejs @@ -134,6 +134,13 @@ objects: containers: - name: ${ZK_APPLICATION_NAME} image: <%= DOCKER_ZOOKEEPER %> + env: + - name: ZOOKEEPER_CLIENT_PORT + value: 2181 + - name: ZOOKEEPER_TICK_TIME + value: 2000 + - name: ZOOKEEPER_SYNC_LIMIT + value: 2 ports: - containerPort: 2181 volumeMounts: @@ -203,14 +210,14 @@ objects: - name: ${APPLICATION_NAME} image: <%= DOCKER_KAFKA %> env: - - name: KAFKA_ADVERTISED_HOST_NAME - value: ${APPLICATION_NAME} - - name: KAFKA_ADVERTISED_PORT - value: '9092' - name: KAFKA_ZOOKEEPER_CONNECT - value: ${ZK_APPLICATION_NAME} - - name: KAFKA_CREATE_TOPICS - value: 'topic-jhipster:1:1' + value: ${ZK_APPLICATION_NAME}:2181 + - name: KAFKA_ADVERTISED_LISTENERS + value: PLAINTEXT://${APPLICATION_NAME}:9092 + - name: KAFKA_BROKER_ID + value: 2 + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: 1 ports: - containerPort: 9092 volumeMounts: diff --git a/generators/server/templates/src/main/docker/app.yml.ejs b/generators/server/templates/src/main/docker/app.yml.ejs index ce00d3299993..1c6a63c4134a 100644 --- a/generators/server/templates/src/main/docker/app.yml.ejs +++ b/generators/server/templates/src/main/docker/app.yml.ejs @@ -73,23 +73,16 @@ services: - SPRING_DATA_CASSANDRA_CONTACTPOINTS=<%= baseName.toLowerCase() %>-cassandra <%_ if (authenticationType === 'uaa') { _%> - JHIPSTER_SLEEP=80 # gives time for uaa and the Cassandra cluster to start and execute the migration scripts - <%_ } else { _%> - - JHIPSTER_SLEEP=30 # gives time for the Cassandra cluster to start and execute the migration scripts - <%_ } _%> - <%_ } else { _%> - <%_ if (serviceDiscoveryType === 'eureka') { _%> - - JHIPSTER_SLEEP=30 # gives time for the JHipster Registry to boot before the application - <%_ } else { _%> - - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application <%_ } _%> <%_ } _%> + - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application <%_ if (searchEngine === 'elasticsearch') { _%> - SPRING_DATA_JEST_URI=http://<%= baseName.toLowerCase() %>-elasticsearch:9200 - SPRING_ELASTICSEARCH_REST_URIS=http://<%= baseName.toLowerCase() %>-elasticsearch:9200 <%_ } _%> <%_ if (messageBroker === 'kafka') { _%> - - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka - - SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES=zookeeper + - SPRING_KAFKA_CONSUMER_BOOTSTRAP_SERVERS=kafka:9092 + - SPRING_KAFKA_PRODUCER_BOOTSTRAP_SERVERS=kafka:9092 <%_ } _%> <%_ if (cacheProvider === 'infinispan') { _%> - JAVA_OPTS=-Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true diff --git a/test/templates/compose/09-kafka/src/main/docker/app.yml b/test/templates/compose/09-kafka/src/main/docker/app.yml index 38b3ba7b7614..689c9567ade1 100644 --- a/test/templates/compose/09-kafka/src/main/docker/app.yml +++ b/test/templates/compose/09-kafka/src/main/docker/app.yml @@ -6,8 +6,8 @@ services: - SPRING_PROFILES_ACTIVE=prod,swagger - SPRING_DATASOURCE_URL=jdbc:mysql://samplekafka-mysql:3306/samplekafka?useUnicode=true&characterEncoding=utf8&useSSL=false - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application - - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka - - SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES=zookeeper + - SPRING_KAFKA_CONSUMER_BOOTSTRAP_SERVERS=kafka:9092 + - SPRING_KAFKA_PRODUCER_BOOTSTRAP_SERVERS=kafka:9092 ports: - 8080:8080 samplekafka-mysql: diff --git a/test/templates/compose/09-kafka/src/main/docker/kafka.yml b/test/templates/compose/09-kafka/src/main/docker/kafka.yml index b1542f320e88..22095235e34c 100644 --- a/test/templates/compose/09-kafka/src/main/docker/kafka.yml +++ b/test/templates/compose/09-kafka/src/main/docker/kafka.yml @@ -1,15 +1,17 @@ version: '2' services: zookeeper: - image: wurstmeister/zookeeper:3.4.6 - ports: - - 2181:2181 + image: confluentinc/cp-zookeeper:5.2.1 + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + ZOOKEEPER_SYNC_LIMIT: 2 kafka: - image: wurstmeister/kafka:1.0.0 + image: confluentinc/cp-kafka:5.2.1 environment: - KAFKA_ADVERTISED_HOST_NAME: localhost - KAFKA_ADVERTISED_PORT: 9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_CREATE_TOPICS: "topic-jhipster:1:1" + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_BROKER_ID: 2 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 ports: - 9092:9092 From 7fa41dfd3c44b008b62cade816b5c6c6cf18cfc2 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 25 Apr 2019 20:33:30 +0200 Subject: [PATCH 008/298] Kafka: reorder config for Kubernetes and Openshift --- generators/docker-compose/templates/kafka.yml.ejs | 2 +- generators/kubernetes/templates/messagebroker/kafka.yml.ejs | 4 ++-- generators/openshift/templates/messagebroker/kafka.yml.ejs | 4 ++-- generators/server/templates/src/main/docker/kafka.yml.ejs | 2 +- test/templates/compose/09-kafka/src/main/docker/kafka.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generators/docker-compose/templates/kafka.yml.ejs b/generators/docker-compose/templates/kafka.yml.ejs index 927ee48b0478..b90ad2ef0e32 100644 --- a/generators/docker-compose/templates/kafka.yml.ejs +++ b/generators/docker-compose/templates/kafka.yml.ejs @@ -27,8 +27,8 @@ services: kafka: image: <%= DOCKER_KAFKA %> environment: - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_BROKER_ID: 2 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 #ports: diff --git a/generators/kubernetes/templates/messagebroker/kafka.yml.ejs b/generators/kubernetes/templates/messagebroker/kafka.yml.ejs index ebddf4ea440f..d1eb7208e1e0 100644 --- a/generators/kubernetes/templates/messagebroker/kafka.yml.ejs +++ b/generators/kubernetes/templates/messagebroker/kafka.yml.ejs @@ -39,10 +39,10 @@ spec: - name: kafka image: <%= DOCKER_KAFKA %> env: - - name: KAFKA_ZOOKEEPER_CONNECT - value: 'jhipster-zookeeper.<%= kubernetesNamespace %>.svc.cluster.local:2181' - name: KAFKA_ADVERTISED_LISTENERS value: 'PLAINTEXT://jhipster-kafka.<%= kubernetesNamespace %>.svc.cluster.local:9092' + - name: KAFKA_ZOOKEEPER_CONNECT + value: 'jhipster-zookeeper.<%= kubernetesNamespace %>.svc.cluster.local:2181' - name: KAFKA_BROKER_ID value: '2' - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR diff --git a/generators/openshift/templates/messagebroker/kafka.yml.ejs b/generators/openshift/templates/messagebroker/kafka.yml.ejs index 399236b74785..18e131b435f6 100644 --- a/generators/openshift/templates/messagebroker/kafka.yml.ejs +++ b/generators/openshift/templates/messagebroker/kafka.yml.ejs @@ -210,10 +210,10 @@ objects: - name: ${APPLICATION_NAME} image: <%= DOCKER_KAFKA %> env: - - name: KAFKA_ZOOKEEPER_CONNECT - value: ${ZK_APPLICATION_NAME}:2181 - name: KAFKA_ADVERTISED_LISTENERS value: PLAINTEXT://${APPLICATION_NAME}:9092 + - name: KAFKA_ZOOKEEPER_CONNECT + value: ${ZK_APPLICATION_NAME}:2181 - name: KAFKA_BROKER_ID value: 2 - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR diff --git a/generators/server/templates/src/main/docker/kafka.yml.ejs b/generators/server/templates/src/main/docker/kafka.yml.ejs index b5aaca42301a..b984cfcf55d9 100644 --- a/generators/server/templates/src/main/docker/kafka.yml.ejs +++ b/generators/server/templates/src/main/docker/kafka.yml.ejs @@ -29,8 +29,8 @@ services: kafka: image: <%= DOCKER_KAFKA %> environment: - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_BROKER_ID: 2 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 ports: diff --git a/test/templates/compose/09-kafka/src/main/docker/kafka.yml b/test/templates/compose/09-kafka/src/main/docker/kafka.yml index 22095235e34c..a66bfe8c2524 100644 --- a/test/templates/compose/09-kafka/src/main/docker/kafka.yml +++ b/test/templates/compose/09-kafka/src/main/docker/kafka.yml @@ -9,8 +9,8 @@ services: kafka: image: confluentinc/cp-kafka:5.2.1 environment: - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_BROKER_ID: 2 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 ports: From aa2238ab76ba4a41b229e4e50a358af3e3bd8c06 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Fri, 26 Apr 2019 19:17:07 +0200 Subject: [PATCH 009/298] Kafka: add EmbeddedKafka for unit and integration tests --- .../service/SampleKafkaConsumer.java.ejs | 2 +- .../java/package/CassandraKeyspaceIT.java.ejs | 6 ++++++ .../timezone/HibernateTimeZoneIT.java.ejs | 6 ++++++ .../CustomAuditEventRepositoryIT.java.ejs | 6 ++++++ .../DomainUserDetailsServiceIT.java.ejs | 6 ++++++ .../package/service/MailServiceIT.java.ejs | 6 ++++++ .../package/service/UserServiceIT.java.ejs | 6 ++++++ .../service/mapper/UserMapperIT.java.ejs | 6 ++++++ .../web/rest/AccountResourceIT.java.ejs | 18 ++++++++++++++++++ .../package/web/rest/AuditResourceIT.java.ejs | 6 ++++++ .../rest/ClientForwardControllerIT.java.ejs | 6 ++++++ .../package/web/rest/LogoutResourceIT.java.ejs | 6 ++++++ .../web/rest/UserJWTControllerIT.java.ejs | 6 ++++++ .../package/web/rest/UserResourceIT.java.ejs | 6 ++++++ .../rest/errors/ExceptionTranslatorIT.java.ejs | 12 ++++++++++++ .../test/resources/config/application.yml.ejs | 15 ++++----------- 16 files changed, 107 insertions(+), 12 deletions(-) diff --git a/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs b/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs index e628f9096bf8..789b002ec2b3 100644 --- a/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs +++ b/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs @@ -28,7 +28,7 @@ import java.io.IOException; @Service public class SampleKafkaConsumer { - private final Logger logger = LoggerFactory.getLogger(SampleKafkaProducer.class); + private final Logger logger = LoggerFactory.getLogger(SampleKafkaConsumer.class); @KafkaListener(topics = "topic_jhipster", groupId = "group_id") public void consume(String message) throws IOException { diff --git a/generators/server/templates/src/test/java/package/CassandraKeyspaceIT.java.ejs b/generators/server/templates/src/test/java/package/CassandraKeyspaceIT.java.ejs index 82a536bb0a48..295eba02dea6 100644 --- a/generators/server/templates/src/test/java/package/CassandraKeyspaceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/CassandraKeyspaceIT.java.ejs @@ -23,9 +23,15 @@ import com.datastax.driver.core.Session; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import static org.assertj.core.api.Assertions.assertThat; +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class CassandraKeyspaceIT extends AbstractCassandraTest { diff --git a/generators/server/templates/src/test/java/package/config/timezone/HibernateTimeZoneIT.java.ejs b/generators/server/templates/src/test/java/package/config/timezone/HibernateTimeZoneIT.java.ejs index b9f9f9ae512c..5447afa33ac8 100644 --- a/generators/server/templates/src/test/java/package/config/timezone/HibernateTimeZoneIT.java.ejs +++ b/generators/server/templates/src/test/java/package/config/timezone/HibernateTimeZoneIT.java.ejs @@ -33,6 +33,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.rowset.SqlRowSet; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.transaction.annotation.Transactional; import java.time.*; @@ -44,6 +47,9 @@ import static org.assertj.core.api.Assertions.assertThat; /** * Integration tests for the UTC Hibernate configuration. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) <%_ } else if (authenticationType === 'oauth2') { _%> diff --git a/generators/server/templates/src/test/java/package/repository/CustomAuditEventRepositoryIT.java.ejs b/generators/server/templates/src/test/java/package/repository/CustomAuditEventRepositoryIT.java.ejs index 84badc3a503e..5a225ba17475 100644 --- a/generators/server/templates/src/test/java/package/repository/CustomAuditEventRepositoryIT.java.ejs +++ b/generators/server/templates/src/test/java/package/repository/CustomAuditEventRepositoryIT.java.ejs @@ -30,6 +30,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (!reactive) { _%> import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpSession; @@ -57,6 +60,9 @@ import static <%=packageName%>.repository.CustomAuditEventRepository.EVENT_DATA_ /** * Integration tests for {@link CustomAuditEventRepository}. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs b/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs index c96b9ddf0b45..f84e77a4d013 100644 --- a/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs @@ -30,6 +30,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (reactive) { _%> import org.springframework.security.core.userdetails.ReactiveUserDetailsService; <%_ } _%> @@ -58,6 +61,9 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; /** * Integrations tests for {@link DomainUserDetailsService}. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) <%_ if (databaseType === 'sql') { _%> @Transactional diff --git a/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs b/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs index df99de608d6c..110cef908bdd 100644 --- a/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs @@ -33,6 +33,9 @@ import org.mockito.Spy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.MessageSource; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.thymeleaf.spring5.SpringTemplateEngine; @@ -50,6 +53,9 @@ import static org.mockito.Mockito.*; /** * Integration tests for {@link MailService}. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ diff --git a/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs b/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs index c83350810d25..d7a78d6e898f 100644 --- a/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs @@ -65,6 +65,9 @@ import org.springframework.data.domain.Page; <%_ } _%> import org.springframework.data.domain.PageRequest; <%_ } _%> +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; @@ -121,6 +124,9 @@ import static org.mockito.Mockito.when; /** * Integration tests for {@link UserService}. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/service/mapper/UserMapperIT.java.ejs b/generators/server/templates/src/test/java/package/service/mapper/UserMapperIT.java.ejs index 19f8587fabd9..acdaf582c0e3 100644 --- a/generators/server/templates/src/test/java/package/service/mapper/UserMapperIT.java.ejs +++ b/generators/server/templates/src/test/java/package/service/mapper/UserMapperIT.java.ejs @@ -33,6 +33,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import java.util.ArrayList; import java.util.HashSet; @@ -44,6 +47,9 @@ import static org.assertj.core.api.Assertions.assertThat; /** * Integration tests for {@link UserMapper}. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs index 16ba8ac8075b..ecebab1262ec 100644 --- a/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs @@ -34,6 +34,9 @@ import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; @@ -57,6 +60,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link AccountResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) public class AccountResourceIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ @@ -147,6 +153,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; @@ -157,6 +166,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link AccountResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class AccountResourceIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ @@ -235,6 +247,9 @@ import org.springframework.http.MediaType; <%_ if (!reactive) { _%> import org.springframework.http.converter.HttpMessageConverter; <%_ } _%> +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.test.context.support.WithMockUser; <%_ if (reactive) { _%> @@ -273,6 +288,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link AccountResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class AccountResourceIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ diff --git a/generators/server/templates/src/test/java/package/web/rest/AuditResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/AuditResourceIT.java.ejs index 4b9c626ccf25..e5d9001c0ec0 100644 --- a/generators/server/templates/src/test/java/package/web/rest/AuditResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/AuditResourceIT.java.ejs @@ -37,6 +37,9 @@ import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.format.support.FormattingConversionService; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders;<% if (databaseType === 'sql') { %> import org.springframework.transaction.annotation.Transactional;<% } %> @@ -54,6 +57,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link AuditResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerIT.java.ejs index b0030416353a..7ebcb8b5e3e6 100644 --- a/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerIT.java.ejs @@ -29,6 +29,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; @@ -43,6 +46,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link ClientForwardController} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/web/rest/LogoutResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/LogoutResourceIT.java.ejs index 533c1675eb04..40694d9e41a7 100644 --- a/generators/server/templates/src/test/java/package/web/rest/LogoutResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/LogoutResourceIT.java.ejs @@ -26,6 +26,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; @@ -51,6 +54,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link LogoutResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) public class LogoutResourceIT { diff --git a/generators/server/templates/src/test/java/package/web/rest/UserJWTControllerIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/UserJWTControllerIT.java.ejs index c496d717882b..f8c6f85c90a6 100644 --- a/generators/server/templates/src/test/java/package/web/rest/UserJWTControllerIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/UserJWTControllerIT.java.ejs @@ -33,6 +33,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (reactive) { _%> import org.springframework.security.authentication.ReactiveAuthenticationManager; <%_ } _%> @@ -70,6 +73,9 @@ import static org.hamcrest.Matchers.not; /** * Integration tests for the {@link UserJWTController} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class UserJWTControllerIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ diff --git a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs index 1fbbee75b8ba..c37b44d9bc38 100644 --- a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs @@ -61,6 +61,9 @@ import org.springframework.http.MediaType; <%_ if (!reactive) { _%> import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; <%_ } _%> +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (reactive) { _%> import org.springframework.test.web.reactive.server.WebTestClient; <%_ } _%> @@ -103,6 +106,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@link UserResource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else { _%> diff --git a/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT.java.ejs index 360708edf405..3457ac8faede 100644 --- a/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT.java.ejs @@ -32,6 +32,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (!reactive) { _%> import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @@ -47,6 +50,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests {@link ExceptionTranslator} controller advice. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) <%_ } else if (authenticationType === 'oauth2') { _%> @@ -164,6 +170,9 @@ public class ExceptionTranslatorIT <% if (databaseType === 'cassandra') { %>exte import org.springframework.boot.web.codec.CodecCustomizer; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.test.web.reactive.server.MockServerConfigurer; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.server.WebExceptionHandler; @@ -174,6 +183,9 @@ import java.util.List; /** * Integration tests {@link ExceptionTranslator} controller advice. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class ExceptionTranslatorIT <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ diff --git a/generators/server/templates/src/test/resources/config/application.yml.ejs b/generators/server/templates/src/test/resources/config/application.yml.ejs index 97e6a8f28aec..239b0e3111b3 100644 --- a/generators/server/templates/src/test/resources/config/application.yml.ejs +++ b/generators/server/templates/src/test/resources/config/application.yml.ejs @@ -43,17 +43,6 @@ eureka: spring: application: name: <%= baseName %> - <%_ if (messageBroker === 'kafka') { _%> - cloud: - stream: - kafka: - binder: - brokers: localhost - zk-nodes: localhost - bindings: - output: - destination: topic-jhipster - <%_ } _%> <%_ if (databaseType === 'sql') { _%> datasource: type: com.zaxxer.hikari.HikariDataSource @@ -111,6 +100,10 @@ spring: name: jhipster password: password <%_ } _%> + <%_ if (messageBroker === 'kafka') { _%> + kafka: + bootstrap-servers: ${spring.embedded.kafka.brokers} + <%_ } _%> <%_ if (databaseType === 'sql') { _%> liquibase: contexts: test From dcf3f8e93a883533662a2153cabe567fd488c3ca Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Fri, 26 Apr 2019 19:22:41 +0200 Subject: [PATCH 010/298] Kafka: add EmbeddedKafka for tests with entities --- .../test/java/package/web/rest/EntityResourceIT.java.ejs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs index 42550cecfe40..ff93fab9ee95 100644 --- a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +++ b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs @@ -95,6 +95,9 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> <%_ if (reactiveRepositories) { _%> import org.springframework.test.web.reactive.server.WebTestClient; <%_ } _%> @@ -153,6 +156,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * Integration tests for the {@Link <%= entityClass %>Resource} REST controller. */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> @SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) <%_ } else if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> From 15480661a0350cd80f3eb3915ffb3a48f7856ff8 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Fri, 26 Apr 2019 19:25:16 +0200 Subject: [PATCH 011/298] Kafka: add EmbeddedKafka for tests with controller --- .../src/test/java/package/web/rest/ResourceIT.java.ejs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs b/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs index d1d649862a3f..2c0d58987ebe 100644 --- a/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs +++ b/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs @@ -23,6 +23,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.MockitoAnnotations; import org.springframework.boot.test.context.SpringBootTest; +<%_ if (messageBroker === 'kafka') { _%> +import org.springframework.kafka.test.context.EmbeddedKafka; +<%_ } _%> import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; @@ -35,6 +38,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @see <%= controllerClass %> */ +<%_ if (messageBroker === 'kafka') { _%> +@EmbeddedKafka +<%_ } _%> @SpringBootTest(classes = <%= mainClass %>.class) public class <%= controllerClass %>IT { From f0980ad2cde135273cf625f51187121142e4b6e7 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Fri, 26 Apr 2019 21:02:15 +0200 Subject: [PATCH 012/298] Kafka: get kafka config for spring-controller --- generators/spring-controller/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generators/spring-controller/index.js b/generators/spring-controller/index.js index 9d1f8d670494..844cda883855 100644 --- a/generators/spring-controller/index.js +++ b/generators/spring-controller/index.js @@ -75,6 +75,10 @@ module.exports = class extends BaseBlueprintGenerator { this.packageName = configuration.get('packageName'); this.packageFolder = configuration.get('packageFolder'); this.databaseType = configuration.get('databaseType'); + this.messageBroker = configuration.get('messageBroker') === 'no' ? false : configuration.get('messageBroker'); + if (this.messageBroker === undefined) { + this.messageBroker = false; + } this.reactiveController = false; this.applicationType = configuration.get('applicationType'); this.reactive = configuration.get('reactive'); From 0f3dbcfa584a0e24669e69d4f6ce3fa1f0f14dd1 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sat, 4 May 2019 17:50:33 +0200 Subject: [PATCH 013/298] Kafka: add tests IT and personalize api to use baseName --- generators/server/files.js | 56 ++++++++++++------ ...nsumer.java.ejs => KafkaConsumer.java.ejs} | 9 +-- ...oducer.java.ejs => KafkaProducer.java.ejs} | 10 ++-- .../package/web/rest/KafkaResource.java.ejs | 16 +++--- .../package/web/rest/KafkaResourceIT.java.ejs | 57 +++++++++++++++++++ test/utils/expected-files.js | 7 ++- 6 files changed, 117 insertions(+), 38 deletions(-) rename generators/server/templates/src/main/java/package/service/{SampleKafkaConsumer.java.ejs => KafkaConsumer.java.ejs} (71%) rename generators/server/templates/src/main/java/package/service/{SampleKafkaProducer.java.ejs => KafkaProducer.java.ejs} (72%) create mode 100644 generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs diff --git a/generators/server/files.js b/generators/server/files.js index e3a34adacb8a..6ca99b1bd3ee 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -959,24 +959,6 @@ const serverFiles = { renameTo: generator => `${generator.javaDir}config/ElasticsearchConfiguration.java` } ] - }, - { - condition: generator => generator.messageBroker === 'kafka', - path: SERVER_MAIN_SRC_DIR, - templates: [ - { - file: 'package/web/rest/KafkaResource.java', - renameTo: generator => `${generator.javaDir}web/rest/KafkaResource.java` - }, - { - file: 'package/service/SampleKafkaConsumer.java', - renameTo: generator => `${generator.javaDir}service/SampleKafkaConsumer.java` - }, - { - file: 'package/service/SampleKafkaProducer.java', - renameTo: generator => `${generator.javaDir}service/SampleKafkaProducer.java` - } - ] } ], serverJavaDomain: [ @@ -1030,6 +1012,22 @@ const serverFiles = { templates: [ { file: 'package/service/util/RandomUtil.java', renameTo: generator => `${generator.javaDir}service/util/RandomUtil.java` } ] + }, + { + condition: generator => generator.messageBroker === 'kafka', + path: SERVER_MAIN_SRC_DIR, + templates: [ + { + file: 'package/service/KafkaConsumer.java', + renameTo: generator => + `${generator.javaDir}service/${generator.upperFirstCamelCase(generator.baseName)}KafkaConsumer.java` + }, + { + file: 'package/service/KafkaProducer.java', + renameTo: generator => + `${generator.javaDir}service/${generator.upperFirstCamelCase(generator.baseName)}KafkaProducer.java` + } + ] } ], serverJavaWebError: [ @@ -1104,6 +1102,17 @@ const serverFiles = { renameTo: generator => `${generator.javaDir}web/rest/ClientForwardController.java` } ] + }, + { + condition: generator => generator.messageBroker === 'kafka', + path: SERVER_MAIN_SRC_DIR, + templates: [ + { + file: 'package/web/rest/KafkaResource.java', + renameTo: generator => + `${generator.javaDir}web/rest/${generator.upperFirstCamelCase(generator.baseName)}KafkaResource.java` + } + ] } ], serverJavaWebsocket: [ @@ -1325,6 +1334,17 @@ const serverFiles = { renameTo: generator => `${generator.testDir}security/DomainUserDetailsServiceIT.java` } ] + }, + { + condition: generator => generator.messageBroker === 'kafka', + path: SERVER_TEST_SRC_DIR, + templates: [ + { + file: 'package/web/rest/KafkaResourceIT.java', + renameTo: generator => + `${generator.testDir}web/rest/${generator.upperFirstCamelCase(generator.baseName)}KafkaResourceIT.java` + } + ] } ], serverJavaUserManagement: [ diff --git a/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs b/generators/server/templates/src/main/java/package/service/KafkaConsumer.java.ejs similarity index 71% rename from generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs rename to generators/server/templates/src/main/java/package/service/KafkaConsumer.java.ejs index 789b002ec2b3..e05ecbb0555b 100644 --- a/generators/server/templates/src/main/java/package/service/SampleKafkaConsumer.java.ejs +++ b/generators/server/templates/src/main/java/package/service/KafkaConsumer.java.ejs @@ -26,12 +26,13 @@ import org.springframework.stereotype.Service; import java.io.IOException; @Service -public class SampleKafkaConsumer { +public class <%= upperFirstCamelCase(baseName) %>KafkaConsumer { - private final Logger logger = LoggerFactory.getLogger(SampleKafkaConsumer.class); + private final Logger log = LoggerFactory.getLogger(<%= upperFirstCamelCase(baseName) %>KafkaConsumer.class); + private static final String TOPIC = "topic_<%= baseName.toLowerCase() %>"; - @KafkaListener(topics = "topic_jhipster", groupId = "group_id") + @KafkaListener(topics = "topic_<%= baseName.toLowerCase() %>", groupId = "group_id") public void consume(String message) throws IOException { - logger.info(String.format("#### -> Consumed message -> %s", message)); + log.info("Consumed message in {} : {}", TOPIC, message); } } diff --git a/generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs b/generators/server/templates/src/main/java/package/service/KafkaProducer.java.ejs similarity index 72% rename from generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs rename to generators/server/templates/src/main/java/package/service/KafkaProducer.java.ejs index 5c4684444f5d..4d4f3c1177ac 100644 --- a/generators/server/templates/src/main/java/package/service/SampleKafkaProducer.java.ejs +++ b/generators/server/templates/src/main/java/package/service/KafkaProducer.java.ejs @@ -24,19 +24,19 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Service; @Service -public class SampleKafkaProducer { +public class <%= upperFirstCamelCase(baseName) %>KafkaProducer { - private static final Logger logger = LoggerFactory.getLogger(SampleKafkaProducer.class); - private static final String TOPIC = "topic_jhipster"; + private static final Logger log = LoggerFactory.getLogger(<%= upperFirstCamelCase(baseName) %>KafkaProducer.class); + private static final String TOPIC = "topic_<%= baseName.toLowerCase() %>"; private KafkaTemplate kafkaTemplate; - public SampleKafkaProducer(KafkaTemplate kafkaTemplate) { + public <%= upperFirstCamelCase(baseName) %>KafkaProducer(KafkaTemplate kafkaTemplate) { this.kafkaTemplate = kafkaTemplate; } public void sendMessage(String message) { - logger.info(String.format("#### -> Producing message -> %s", message)); + log.info("Producing message to {} : {}", TOPIC, message); this.kafkaTemplate.send(TOPIC, message); } } diff --git a/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs index 18d9221e9031..5378972b02af 100644 --- a/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs @@ -18,26 +18,26 @@ -%> package <%=packageName%>.web.rest; -import <%=packageName%>.service.SampleKafkaProducer; +import <%=packageName%>.service.<%= upperFirstCamelCase(baseName) %>KafkaProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; @RestController -@RequestMapping(value = "/api/kafka") -public class KafkaResource { +@RequestMapping(value = "/api/<%= dasherizedBaseName %>-kafka") +public class <%= upperFirstCamelCase(baseName) %>KafkaResource { - private final Logger log = LoggerFactory.getLogger(KafkaResource.class); + private final Logger log = LoggerFactory.getLogger(<%= upperFirstCamelCase(baseName) %>KafkaResource.class); - private SampleKafkaProducer sampleKafkaProducer; + private <%= upperFirstCamelCase(baseName) %>KafkaProducer kafkaProducer; - public KafkaResource(SampleKafkaProducer sampleKafkaProducer) { - this.sampleKafkaProducer = sampleKafkaProducer; + public <%= upperFirstCamelCase(baseName) %>KafkaResource(<%= upperFirstCamelCase(baseName) %>KafkaProducer kafkaProducer) { + this.kafkaProducer = kafkaProducer; } @PostMapping(value = "/publish") public void sendMessageToKafkaTopic(@RequestParam("message") String message) { log.debug("REST request to send to Kafka topic the message : {}", message); - this.sampleKafkaProducer.sendMessage(message); + this.kafkaProducer.sendMessage(message); } } diff --git a/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs new file mode 100644 index 000000000000..fa90fc1db56b --- /dev/null +++ b/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs @@ -0,0 +1,57 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.web.rest; + +import <%= packageName %>.<%= mainClass %>; +import <%= packageName %>.service.<%= upperFirstCamelCase(baseName) %>KafkaProducer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.kafka.test.context.EmbeddedKafka; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.junit.jupiter.api.Assertions.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@EmbeddedKafka +@SpringBootTest(classes = <%= mainClass %>.class) +public class <%= upperFirstCamelCase(baseName) %>KafkaResourceIT { + + @Autowired + private <%= upperFirstCamelCase(baseName) %>KafkaProducer kafkaProducer; + + private MockMvc restMockMvc; + + @BeforeEach + public void setup() { + <%= upperFirstCamelCase(baseName) %>KafkaResource kafkaResource = new <%= upperFirstCamelCase(baseName) %>KafkaResource(kafkaProducer); + + this.restMockMvc = MockMvcBuilders.standaloneSetup(kafkaResource) + .build(); + } + + @Test + public void sendMessageToKafkaTopic() throws Exception { + restMockMvc.perform(post("/api/<%= dasherizedBaseName %>-kafka/publish?message=yolo")) + .andExpect(status().isOk()); + } +} diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index dde7edd4265e..c3fd6a2589bd 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -575,9 +575,10 @@ const expectedFiles = { ], messageBroker: [ - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/KafkaResource.java`, - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaConsumer.java`, - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/SampleKafkaProducer.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/JhipsterKafkaResource.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/JhipsterKafkaConsumer.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/service/JhipsterKafkaProducer.java`, + `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/web/rest/JhipsterKafkaResourceIT.java`, `${DOCKER_DIR}kafka.yml` ], From 3f9f6643e05446799048fa045fbb657c9ebe1a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 6 May 2019 15:51:23 +0200 Subject: [PATCH 014/298] replace table with a message if table is empty in entities --- .../entities/entity-management.component.html.ejs | 5 ++++- .../src/main/webapp/app/entities/entity.tsx.ejs | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs index d7e1fa7459b3..5602be777b0a 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs @@ -45,7 +45,10 @@ <%_ } _%>
-
+
+ No <%=entityInstancePlural %> found +
+
jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="<%=pagination !== 'infinite-scroll' ? 'transition.bind(this)' : 'reset.bind(this)'%>"<% } %>> diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index b8bdfafd7505..e1936ca1d9c8 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -230,7 +230,9 @@ export class <%= entityReactName %> extends React.Component <%_ } _%> -
+ { + <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ? + (
className="hand" onClick={this.sort('id')} <%_ } _%>>ID<% if (pagination !== 'no') { %> <% } %> @@ -370,7 +372,13 @@ export class <%= entityReactName %> extends React.Component -
+ ) : + ( +
+ No <%= entityClassPluralHumanized %> found +
+ ) + } <%_ if (pagination === 'infinite-scroll') { _%> <%_ } _%> From 6f7d205d9bb1e79cf55901b315005dbbd7672fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 6 May 2019 16:14:24 +0200 Subject: [PATCH 015/298] fix condition in angular --- .../webapp/app/entities/entity-management.component.html.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs index 5602be777b0a..ab5fe23039b8 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs @@ -45,10 +45,10 @@
<%_ } _%>
-
+
No <%=entityInstancePlural %> found
-
+
jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="<%=pagination !== 'infinite-scroll' ? 'transition.bind(this)' : 'reset.bind(this)'%>"<% } %>> From a8b030580f832b4920ed42aa57dbdf2dcf21301c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Tue, 7 May 2019 10:23:20 +0200 Subject: [PATCH 016/298] fix angular template --- .../webapp/app/entities/entity-management.component.html.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs index ab5fe23039b8..0a3cdc28c5cc 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs @@ -45,10 +45,10 @@ <%_ } _%>
-
+
No <%=entityInstancePlural %> found
-
+
jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="<%=pagination !== 'infinite-scroll' ? 'transition.bind(this)' : 'reset.bind(this)'%>"<% } %>> From 60b98d043ce91af3df3f3caf8e0369ddd001fa2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Fri, 10 May 2019 13:49:46 +0200 Subject: [PATCH 017/298] add itemCount on react entities list with pagination --- .../react/src/main/webapp/app/entities/entity.tsx.ejs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index e1936ca1d9c8..f7b98f8867cc 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -39,7 +39,7 @@ import { <%_ if (pagination !== 'no') { _%> , getSortState, IPaginationBaseState <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> - , getPaginationItemsNumber, JhiPagination + , getPaginationItemsNumber, JhiPagination, JhiItemCount <%_ }} _%> } from 'react-jhipster'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -384,6 +384,14 @@ export class <%= entityReactName %> extends React.Component <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> + + i18nEnabled<% }}%> + /> + Date: Thu, 16 May 2019 15:27:11 +0200 Subject: [PATCH 018/298] add i18n --- .../webapp/app/entities/entity-management.component.html.ejs | 2 +- .../react/src/main/webapp/app/entities/entity.tsx.ejs | 4 +++- generators/entity-i18n/templates/i18n/entity_al.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_bn.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_by.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ca.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_cs.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_da.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_de.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_el.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_en.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_es.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_et.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_fa.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_fr.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_gl.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_hi.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_hu.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_hy.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_id.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_it.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ja.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ko.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_mr.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_my.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_nl.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_pl.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ro.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ru.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_sk.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_sr.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_sv.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ta.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_te.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_th.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_tr.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_ua.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_uz-cyr.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_uz-lat.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_vi.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs | 3 ++- generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs | 3 ++- 45 files changed, 90 insertions(+), 45 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs index 0a3cdc28c5cc..ecc3c6b066bb 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs @@ -46,7 +46,7 @@ <%_ } _%>
- No <%=entityInstancePlural %> found + No <%=entityInstancePlural %> found
diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index f7b98f8867cc..bfebf0624ce2 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -375,7 +375,9 @@ export class <%= entityReactName %> extends React.Component) : (
- No <%= entityClassPluralHumanized %> found + + No <%= entityClassPluralHumanized %> found +
) } diff --git a/generators/entity-i18n/templates/i18n/entity_al.json.ejs b/generators/entity-i18n/templates/i18n/entity_al.json.ejs index aa812b59c314..53b8250f21b6 100644 --- a/generators/entity-i18n/templates/i18n/entity_al.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_al.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Krijo një të ri <%= entityClassHumanized %>", "createOrEditLabel": "Krijo ose përpuno një <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Kërko për <%= entityClassHumanized %>"<% } %> + "search": "Kërko për <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Një <%= entityClassHumanized %> i ri u krijua me identifikues {{ param }}", "updated": "Një <%= entityClassHumanized %> u përpunua me identifikues {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs b/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs index a5523ea1c763..ad3a44786cf0 100644 --- a/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_bn.json.ejs b/generators/entity-i18n/templates/i18n/entity_bn.json.ejs index a5523ea1c763..ad3a44786cf0 100644 --- a/generators/entity-i18n/templates/i18n/entity_bn.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_bn.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_by.json.ejs b/generators/entity-i18n/templates/i18n/entity_by.json.ejs index 0566bcc1adeb..9b175ce6e234 100644 --- a/generators/entity-i18n/templates/i18n/entity_by.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_by.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Стварыць новы <%= entityClassHumanized %>", "createOrEditLabel": "Стварыць або адрэдагаваць <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Знайсці <%= entityClassHumanized %>"<% } %> + "search": "Знайсці <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новы <%= entityClassHumanized %> створан з ідэнтыфікатарам {{ param }}", "updated": "<%= entityClassHumanized %> абноўлен з ідэнтыфікатарам {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ca.json.ejs b/generators/entity-i18n/templates/i18n/entity_ca.json.ejs index a5523ea1c763..ad3a44786cf0 100644 --- a/generators/entity-i18n/templates/i18n/entity_ca.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ca.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_cs.json.ejs b/generators/entity-i18n/templates/i18n/entity_cs.json.ejs index 5b2a6b56cb95..126e8c87e61e 100644 --- a/generators/entity-i18n/templates/i18n/entity_cs.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_cs.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Vytvořit <%= entityClassHumanized %>", "createOrEditLabel": "Vytvořit nebo upravit <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Vyhledat <%= entityClassHumanized %>"<% } %> + "search": "Vyhledat <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Byl vytvořen potomek entity <%= entityClassHumanized %> s identifikátorem {{ param }}", "updated": "Potomek entity <%= entityClassHumanized %> s identifikátorem {{ param }} byl upravený.", diff --git a/generators/entity-i18n/templates/i18n/entity_da.json.ejs b/generators/entity-i18n/templates/i18n/entity_da.json.ejs index a5523ea1c763..ad3a44786cf0 100644 --- a/generators/entity-i18n/templates/i18n/entity_da.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_da.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_de.json.ejs b/generators/entity-i18n/templates/i18n/entity_de.json.ejs index 9bc19e4a8a93..12acf5a718f3 100644 --- a/generators/entity-i18n/templates/i18n/entity_de.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_de.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "<%= entityClassHumanized %> erstellen", "createOrEditLabel": "<%= entityClassHumanized %> erstellen oder bearbeiten"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Suche nach <%= entityClassHumanized %>"<% } %> + "search": "Suche nach <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> erstellt mit ID {{ param }}", "updated": "<%= entityClassHumanized %> aktualisiert mit ID {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_el.json.ejs b/generators/entity-i18n/templates/i18n/entity_el.json.ejs index 5c589a1a9f25..4fde7bbe9fe7 100644 --- a/generators/entity-i18n/templates/i18n/entity_el.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_el.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Δημιουργήστε ένα νέο <%= entityClassHumanized %>", "createOrEditLabel": "Δημιουργήστε η επεξεργαστείτε ένα <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Αναζήτηση για <%= entityClassHumanized %>"<% } %> + "search": "Αναζήτηση για <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Ένα νέο <%= entityClassHumanized %> έχει δημιουργηθεί με αναγνωριστικό {{ param }}", "updated": "Ένα <%= entityClassHumanized %> έχει ενημερωθεί με αναγνωριστικό {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_en.json.ejs b/generators/entity-i18n/templates/i18n/entity_en.json.ejs index a5523ea1c763..10b6dfb805f6 100644 --- a/generators/entity-i18n/templates/i18n/entity_en.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_en.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found"<% %> },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_es.json.ejs b/generators/entity-i18n/templates/i18n/entity_es.json.ejs index f1935fef30a9..aa40720933dc 100644 --- a/generators/entity-i18n/templates/i18n/entity_es.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_es.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Crear nuevo <%= entityClassHumanized %>", "createOrEditLabel": "Crear o editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Un nuevo <%= entityClassHumanized %> ha sido creado con el identificador {{ param }}", "updated": "Un <%= entityClassHumanized %> ha sido actualizado con el identificador {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_et.json.ejs b/generators/entity-i18n/templates/i18n/entity_et.json.ejs index 41e7b6d2404e..ef2877bcc0de 100644 --- a/generators/entity-i18n/templates/i18n/entity_et.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_et.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Lisa uus <%= entityClassHumanized %>", "createOrEditLabel": "Lisa või muuda <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Otsi <%= entityClassHumanized %>"<% } %> + "search": "Otsi <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Uus <%= entityClassHumanized %> on loodud identifikaatoriga {{ param }}", "updated": "<%= entityClassHumanized %> identifikaatoriga {{ param }} on muudetud", diff --git a/generators/entity-i18n/templates/i18n/entity_fa.json.ejs b/generators/entity-i18n/templates/i18n/entity_fa.json.ejs index a5523ea1c763..ad3a44786cf0 100644 --- a/generators/entity-i18n/templates/i18n/entity_fa.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_fa.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_fr.json.ejs b/generators/entity-i18n/templates/i18n/entity_fr.json.ejs index e1faa1c9a1d5..f4fd56064abe 100644 --- a/generators/entity-i18n/templates/i18n/entity_fr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_fr.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "Créer un nouveau <%= entityClassHumanized %>", "createOrEditLabel": "Créer ou éditer un <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Recherche pour <%= entityClassHumanized %>"<% } %> + "search": "Recherche pour <%= entityClassHumanized %>"<% } %>, + "notFound": "Aucun <%= entityClassHumanized %> trouvé" },<% if (!microserviceAppName) { %> "created": "Un nouveau <%= entityClassHumanized %> a été créé avec l'identifiant {{ param }}", "updated": "Le <%= entityClassHumanized %> avec l'identifiant {{ param }} a été mis à jour", diff --git a/generators/entity-i18n/templates/i18n/entity_gl.json.ejs b/generators/entity-i18n/templates/i18n/entity_gl.json.ejs index cf2b778e3ad7..129d9e718f18 100644 --- a/generators/entity-i18n/templates/i18n/entity_gl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_gl.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "Crear novo <%= entityClassHumanized %>", "createOrEditLabel": "Crear ou editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Un novo <%= entityClassHumanized %> foi creado co identificador {{ param }}", "updated": "Un <%= entityClassHumanized %> foi actualizado co identificador {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_hi.json.ejs b/generators/entity-i18n/templates/i18n/entity_hi.json.ejs index 0e240409c313..da06263c99cf 100644 --- a/generators/entity-i18n/templates/i18n/entity_hi.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hi.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "नया <%= entityClassHumanized %> बनाएँ", "createOrEditLabel": "<%= entityClassHumanized %> बनाएँ या संपादित करें"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %> खोजें"<% } %> + "search": "<%= entityClassHumanized %> खोजें"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "एक नया <%= entityClassHumanized %> [identifier: {{ param }}] तैयार है", "updated": "एक <%= entityClassHumanized %> [identifier: {{ param }}] का अद्यतन हुआ है", diff --git a/generators/entity-i18n/templates/i18n/entity_hu.json.ejs b/generators/entity-i18n/templates/i18n/entity_hu.json.ejs index 466327de4601..8cb6aa9f21da 100644 --- a/generators/entity-i18n/templates/i18n/entity_hu.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hu.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "Egy új <%= entityClassHumanized %> létrehozása", "createOrEditLabel": "Hozzon létre, vagy módosítson <%= entityClassHumanized %>t"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %> keresése"<% } %> + "search": "<%= entityClassHumanized %> keresése"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Egy új <%= entityClassHumanized %> lett létrehozva {{ param }} azonosítóval", "updated": "A <%= entityClassHumanized %> módosítva lett {{ param }} azonosítóval", diff --git a/generators/entity-i18n/templates/i18n/entity_hy.json.ejs b/generators/entity-i18n/templates/i18n/entity_hy.json.ejs index 6bb9be4e89e8..68f8dce5cf54 100644 --- a/generators/entity-i18n/templates/i18n/entity_hy.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hy.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Ստեղծել նոր <%= entityClassHumanized %>", "createOrEditLabel": "Ստեղծել կամ փոփոխել <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Գտնել <%= entityClassHumanized %>"<% } %> + "search": "Գտնել <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Նոր <%= entityClassHumanized %> ստեղծված է {{ param }} նունացուցիչով", "updated": "<%= entityClassHumanized %> թարմացվաց է {{ param }} նունացուցիչով", diff --git a/generators/entity-i18n/templates/i18n/entity_id.json.ejs b/generators/entity-i18n/templates/i18n/entity_id.json.ejs index 9ddca7a43cf7..1653cb9c25d6 100644 --- a/generators/entity-i18n/templates/i18n/entity_id.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_id.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Buat <%= entityClassHumanized %> baru", "createOrEditLabel": "Buat atau edit <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Cari <%= entityClassHumanized %>"<% } %> + "search": "Cari <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> dengan id {{ param }} telah dibuat", "updated": "<%= entityClassHumanized %> dengan id {{ param }} telah diperbaharui", diff --git a/generators/entity-i18n/templates/i18n/entity_it.json.ejs b/generators/entity-i18n/templates/i18n/entity_it.json.ejs index 7fc3b1a6e323..6b3734753e3b 100644 --- a/generators/entity-i18n/templates/i18n/entity_it.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_it.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "Genera un nuovo <%= entityClassHumanized %>", "createOrEditLabel": "Genera o modifica un <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Cerca <%= entityClassHumanized %>"<% } %> + "search": "Cerca <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "È stato generato un nuovo <%= entityClassHumanized %> con identificatore {{ param }}", "updated": "È stato aggiornato <%= entityClassHumanized %> identificato da {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ja.json.ejs b/generators/entity-i18n/templates/i18n/entity_ja.json.ejs index c011669390b8..9784e4e32831 100644 --- a/generators/entity-i18n/templates/i18n/entity_ja.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ja.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPlural %>", "createLabel": "<%= entityClassHumanized %> を追加", "createOrEditLabel": "<%= entityClassHumanized %>を追加または編集"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ko.json.ejs b/generators/entity-i18n/templates/i18n/entity_ko.json.ejs index f615ca2075f0..aca6a0e0ad4d 100644 --- a/generators/entity-i18n/templates/i18n/entity_ko.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ko.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_mr.json.ejs b/generators/entity-i18n/templates/i18n/entity_mr.json.ejs index 62c570dc1208..fcd03621f8d7 100644 --- a/generators/entity-i18n/templates/i18n/entity_mr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_mr.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "नवीन <%= entityClassHumanized %> तयार करा", "createOrEditLabel": "<%= entityClassHumanized %> तयार किंवा संपादित करा"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %> शोधा"<% } %> + "search": "<%= entityClassHumanized %> शोधा"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> [identifier: {{ param }}] तयार आहे", "updated": "<%= entityClassHumanized %> [identifier: {{ param }}] सुधारित केले आहे", diff --git a/generators/entity-i18n/templates/i18n/entity_my.json.ejs b/generators/entity-i18n/templates/i18n/entity_my.json.ejs index 95cbf7ebebaf..5a1e0ec5d262 100644 --- a/generators/entity-i18n/templates/i18n/entity_my.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_my.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "<%= entityClassHumanized %> အသစ်ထည့်မည်", "createOrEditLabel": "<%= entityClassHumanized %> အသစ်ထည့်ခြင်း (သို့) ပြုပြင်ခြင်း"<% if (searchEngine === 'elasticsearch') { %>, - "search": "ရှာဖွေရန် <%= entityClassHumanized %>"<% } %> + "search": "ရှာဖွေရန် <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "{{ param }} အိုင်ဒီဖြင့် <%= entityClassHumanized %> အသစ်တစ်ခုအား ထည့်ပြီးပါပြီ။", "updated": "{{ param }} အိုင်ဒီဖြင့် <%= entityClassHumanized %> တစ်ခုအား ပြုပြင်ပြီးပါပြီ။", diff --git a/generators/entity-i18n/templates/i18n/entity_nl.json.ejs b/generators/entity-i18n/templates/i18n/entity_nl.json.ejs index 75a507d31759..7b8abed584f4 100644 --- a/generators/entity-i18n/templates/i18n/entity_nl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_nl.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Maak een nieuwe <%= entityClassHumanized %>", "createOrEditLabel": "Maak of wijzig een <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_pl.json.ejs b/generators/entity-i18n/templates/i18n/entity_pl.json.ejs index 2a7c1e72fdd7..e6635f3a0c0e 100644 --- a/generators/entity-i18n/templates/i18n/entity_pl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pl.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassHumanized %>", "createLabel": "Dodaj <%= entityClassHumanized %>", "createOrEditLabel": "Dodaj lub edytuj: <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Szukaj <%= entityClassHumanized %>"<% } %> + "search": "Szukaj <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Utworzono nowy obiekt typu <%= entityClassHumanized %> z identyfikatorem {{ param }}", "updated": "Uaktualniono obiekt typu <%= entityClassHumanized %> z identyfikatorem {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs b/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs index f5755e48b039..629dbac89bd1 100644 --- a/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Criar novo <%= entityClassHumanized %>", "createOrEditLabel": "Criar ou editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Pesquisar por <%= entityClassHumanized %>"<% } %> + "search": "Pesquisar por <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Um novo <%= entityClassHumanized %> foi criado com o identificador {{ param }}", "updated": "Um <%= entityClassHumanized %> foi atualizado com o identificador {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs b/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs index b46fab11307e..d1385aed3f27 100644 --- a/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Criar um(a) novo(a) <%= entityClassHumanized %>", "createOrEditLabel": "Criar ou editar um(a) <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ro.json.ejs b/generators/entity-i18n/templates/i18n/entity_ro.json.ejs index 702f455efb1d..d57f4777fbbc 100644 --- a/generators/entity-i18n/templates/i18n/entity_ro.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ro.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Creeare o nouă entitate <%= entityClassHumanized %>", "createOrEditLabel": "Creeare sau editare <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Căutare după <%= entityClassHumanized %>"<% } %> + "search": "Căutare după <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A fost creată o nouă entitate <%= entityClassHumanized %> cu identificatorul {{ param }}", "updated": "<%= entityClassHumanized %> cu identificatorul {{ param }} a fost actualizată", diff --git a/generators/entity-i18n/templates/i18n/entity_ru.json.ejs b/generators/entity-i18n/templates/i18n/entity_ru.json.ejs index 37758c73b0e0..53633fd706a0 100644 --- a/generators/entity-i18n/templates/i18n/entity_ru.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ru.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Создать новый <%= entityClassHumanized %>", "createOrEditLabel": "Создать или отредактировать <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Найти <%= entityClassHumanized %>"<% } %> + "search": "Найти <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новый <%= entityClassHumanized %> создан с идентификатором {{ param }}", "updated": "<%= entityClassHumanized %> обновлен с идентификатором {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_sk.json.ejs b/generators/entity-i18n/templates/i18n/entity_sk.json.ejs index 8369aa3701b2..62d46574e3c6 100644 --- a/generators/entity-i18n/templates/i18n/entity_sk.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sk.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Pridať <%= entityClassHumanized %>", "createOrEditLabel": "Pridať alebo upraviť <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Vyhľadať <%= entityClassHumanized %>"<% } %> + "search": "Vyhľadať <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Bol vytvorený potomok entity <%= entityClassHumanized %> s identifikátorom {{ param }}", "updated": "Potomok entity <%= entityClassHumanized %> s identifikátorom {{ param }} bol upravený.", diff --git a/generators/entity-i18n/templates/i18n/entity_sr.json.ejs b/generators/entity-i18n/templates/i18n/entity_sr.json.ejs index 66a01edb4a9a..f5eedeffb435 100644 --- a/generators/entity-i18n/templates/i18n/entity_sr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sr.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Kreiraj novi <%= entityClassHumanized %>", "createOrEditLabel": "Kreirajte ili izmenite <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Potražite <%= entityClassHumanized %>"<% } %> + "search": "Potražite <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Kreiran je novi <%= entityClassHumanized %> pod nazivom {{ param }}", "updated": "<%= entityClassHumanized %> pod nazivom {{ param }} je ažuriran", diff --git a/generators/entity-i18n/templates/i18n/entity_sv.json.ejs b/generators/entity-i18n/templates/i18n/entity_sv.json.ejs index baada9f25536..f499438a08cc 100644 --- a/generators/entity-i18n/templates/i18n/entity_sv.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sv.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Skapa en ny <%= entityClassHumanized %>", "createOrEditLabel": "Skapa eller ändra en <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Sök efter <%= entityClassHumanized %>"<% } %> + "search": "Sök efter <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "En ny <%= entityClassHumanized %> är skapad med id {{ param }}", "updated": "En <%= entityClassHumanized %> är uppdaterad med id {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ta.json.ejs b/generators/entity-i18n/templates/i18n/entity_ta.json.ejs index 972a6015e3ce..5e78d94e577c 100644 --- a/generators/entity-i18n/templates/i18n/entity_ta.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ta.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "<%= entityClassHumanized %>-ஐ உருவாக்கு", "createOrEditLabel": "<%= entityClassHumanized %> -ஐ மாற்று (அ) உருவாக்கு"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> புதிதாக உருவாக்கப்பட்டது, அடையாளம் {{ param }}", "updated": "<%= entityClassHumanized %> மாற்றப்பட்டது, அடையாளம் {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_te.json.ejs b/generators/entity-i18n/templates/i18n/entity_te.json.ejs index 5c6e98d0bb31..5ec0bfa7fa60 100644 --- a/generators/entity-i18n/templates/i18n/entity_te.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_te.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "కొత్త <%= entityClassHumanized %> సృష్టించండి", "createOrEditLabel": "<%= entityClassHumanized %> సృష్టించండి లేదా సవరించండి"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %> కొరకు శోధించండి"<% } %> + "search": "<%= entityClassHumanized %> కొరకు శోధించండి"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "{{ param }} ఐడీ తో ఒక కొత్త <%= entityClassHumanized %> సృష్టించబడినది", "updated": "{{ param }} ఐడీ తో ఒక కొత్త <%= entityClassHumanized %> సవరించబడినది", diff --git a/generators/entity-i18n/templates/i18n/entity_th.json.ejs b/generators/entity-i18n/templates/i18n/entity_th.json.ejs index 3de54cf1b47e..143bd0d09c67 100644 --- a/generators/entity-i18n/templates/i18n/entity_th.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_th.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "สร้าง <%= entityClassHumanized %>", "createOrEditLabel": "สร้างหรือแก้ไข <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "ค้นหา <%= entityClassHumanized %>"<% } %> + "search": "ค้นหา <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> ถูกสร้างด้วย {{ param }}", "updated": "<%= entityClassHumanized %> ถูกแก้ไขด้วย {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_tr.json.ejs b/generators/entity-i18n/templates/i18n/entity_tr.json.ejs index f615ca2075f0..aca6a0e0ad4d 100644 --- a/generators/entity-i18n/templates/i18n/entity_tr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_tr.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Search for <%= entityClassHumanized %>"<% } %> + "search": "Search for <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ua.json.ejs b/generators/entity-i18n/templates/i18n/entity_ua.json.ejs index 67ff9427c18f..5ac5ea5602a3 100644 --- a/generators/entity-i18n/templates/i18n/entity_ua.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ua.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Створити новий <%= entityClassHumanized %>", "createOrEditLabel": "Створити чи редагувати <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Знайти <%= entityClassHumanized %>"<% } %> + "search": "Знайти <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новий <%= entityClassHumanized %> створений з ідентифікатором {{ param }}", "updated": "<%= entityClassHumanized %> оновлений з ідентифікатором {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_uz-cyr.json.ejs b/generators/entity-i18n/templates/i18n/entity_uz-cyr.json.ejs index 949c028333e6..2aae913036f2 100644 --- a/generators/entity-i18n/templates/i18n/entity_uz-cyr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_uz-cyr.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Янги <%= entityClassHumanized %> қўшиш", "createOrEditLabel": "<%= entityClassHumanized %>ни таҳрирлаш"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %>ни излаш"<% } %> + "search": "<%= entityClassHumanized %>ни излаш"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} билан қўшилди.", "updated": "{{ param }}- <%= entityClassHumanized %> сақланди.", diff --git a/generators/entity-i18n/templates/i18n/entity_uz-lat.json.ejs b/generators/entity-i18n/templates/i18n/entity_uz-lat.json.ejs index eaec10a83f4c..85ddd7627fbe 100644 --- a/generators/entity-i18n/templates/i18n/entity_uz-lat.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_uz-lat.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Yangi <%= entityClassHumanized %> qo`shish", "createOrEditLabel": "<%= entityClassHumanized %>ni tahrirlash"<% if (searchEngine === 'elasticsearch') { %>, - "search": "<%= entityClassHumanized %>ni izlash"<% } %> + "search": "<%= entityClassHumanized %>ni izlash"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} bilan qo`shildi", "updated": "{{ param }}- <%= entityClassHumanized %> saqlandi", diff --git a/generators/entity-i18n/templates/i18n/entity_vi.json.ejs b/generators/entity-i18n/templates/i18n/entity_vi.json.ejs index 4a8a98cde5b8..5036f334b7ad 100644 --- a/generators/entity-i18n/templates/i18n/entity_vi.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_vi.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "Thêm mới một <%= entityClassHumanized %>", "createOrEditLabel": "Thêm mới hoặc cập nhật <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "Tìm <%= entityClassHumanized %>"<% } %> + "search": "Tìm <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Một <%= entityClassHumanized %> mới được tạo với định danh {{ param }}", "updated": "Một <%= entityClassHumanized %> cập nhật với định danh {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs b/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs index 3bd773c6609d..74dbaa0ddde9 100644 --- a/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "创建新 <%= entityClassHumanized %>", "createOrEditLabel": "创建或编辑 <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "查找 <%= entityClassHumanized %>"<% } %> + "search": "查找 <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} 创建成功", "updated": "<%= entityClassHumanized %> {{ param }} 更新成功", diff --git a/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs b/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs index af1cc3660806..116595eaff40 100644 --- a/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs @@ -24,7 +24,8 @@ let helpBlocks = 0; %> "title": "<%= entityClassPluralHumanized %>", "createLabel": "建立一筆新的 <%= entityClassHumanized %>", "createOrEditLabel": "建立或編輯 <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, - "search": "搜尋 <%= entityClassHumanized %>"<% } %> + "search": "搜尋 <%= entityClassHumanized %>"<% } %>, + "notFound": "No <%= entityClassHumanized %> found" },<% if (!microserviceAppName) { %> "created": "新的 <%= entityClassHumanized %> 建立成功,識別碼為 {{ param }}", "updated": "識別碼為 {{ param }} 的 <%= entityClassHumanized %> 更新成功", From 8d16b029044c547ae666703ccb6f4e3b749b4b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Fri, 17 May 2019 11:32:55 +0200 Subject: [PATCH 019/298] add itemCount on audit, user management and entity pages in React --- .../administration/audits/audits.tsx.ejs | 24 +- .../user-management/user-management.tsx.ejs | 24 +- .../main/webapp/app/entities/entity.tsx.ejs | 308 +++++++++--------- 3 files changed, 189 insertions(+), 167 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs index da248cc49517..a96064212ce2 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs @@ -24,6 +24,7 @@ import { Translate, TextFormat, JhiPagination, + JhiItemCount, getPaginationItemsNumber, getSortState, IPaginationBaseState @@ -145,14 +146,21 @@ export class AuditsPage extends React.Component
- - - + {audits && audits.length > 0 ? ( +
+ + + + + + +
+ ) : null}
); } diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs index b00e31d79c5b..19ed59cadf2d 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs @@ -26,6 +26,7 @@ import { ICrudPutAction, TextFormat, JhiPagination, + JhiItemCount, getPaginationItemsNumber, getSortState, IPaginationBaseState @@ -177,14 +178,21 @@ export class UserManagement extends React.Component - - - + {users && users.length > 0 ? ( +
+ + + + + + +
+ ) : null}
); } diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index f7b98f8867cc..506694258fe6 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -231,149 +231,149 @@ export class <%= entityReactName %> extends React.Component <%_ } _%> { - <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ? - ( - - - className="hand" onClick={this.sort('id')} <%_ } _%>>ID<% if (pagination !== 'no') { %> <% } %> - <%_ for (idx in fields) { _%> - className="hand" onClick={this.sort('<%=fields[idx].fieldName%>')} <%_ } _%>><%= fields[idx].fieldNameHumanized %><% if (pagination !== 'no') { %> <% } %> - <%_ } _%> - <%_ for (idx in relationships) { _%> - <%_ if (relationships[idx].relationshipType === 'many-to-one' - || (relationships[idx].relationshipType === 'one-to-one' && relationships[idx].ownerSide === true) - || (relationships[idx].relationshipType === 'many-to-many' && relationships[idx].ownerSide === true && pagination === 'no')) { - const fieldName = dto === 'no' ? "." + relationships[idx].otherEntityField : relationships[idx].otherEntityFieldCapitalized;_%> - <% } %>><%= relationships[idx].relationshipNameHumanized %><% if (pagination !== 'no') { %> <% } %> + <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ?( +
+ + + className="hand" onClick={this.sort('id')} <%_ } _%>>ID<% if (pagination !== 'no') { %> <% } %> + <%_ for (idx in fields) { _%> + className="hand" onClick={this.sort('<%=fields[idx].fieldName%>')} <%_ } _%>><%= fields[idx].fieldNameHumanized %><% if (pagination !== 'no') { %> <% } %> <%_ } _%> - <%_ } _%> - - - - { - <%= entityInstance %>List.map((<%=entityInstance %>, i) => ( - - - <%_ for (idx in fields) { - const fieldType = fields[idx].fieldType; - const fieldName = fields[idx].fieldName; - const fieldIsEnum = fields[idx].fieldIsEnum; - _%> - - <%_ } _%> - <%_ for (idx in relationships) { - const relationshipType = relationships[idx].relationshipType; - const ownerSide = relationships[idx].ownerSide; - const relationshipFieldName = relationships[idx].relationshipFieldName; - const relationshipFieldNamePlural = relationships[idx].relationshipFieldNamePlural; - const otherEntityName = relationships[idx].otherEntityName; - const otherEntityStateName = relationships[idx].otherEntityStateName; - const otherEntityField = relationships[idx].otherEntityField; - const otherEntityFieldCapitalized = relationships[idx].otherEntityFieldCapitalized; _%> - <%_ if (relationshipType === 'many-to-one' - || (relationshipType === 'one-to-one' && ownerSide === true) - || (relationshipType === 'many-to-many' && ownerSide === true && pagination === 'no')) { _%> - + + + { + <%= entityInstance %>List.map((<%=entityInstance %>, i) => ( + + + <%_ for (idx in fields) { + const fieldType = fields[idx].fieldType; + const fieldName = fields[idx].fieldName; + const fieldIsEnum = fields[idx].fieldIsEnum; + _%> + + <%_ } _%> + <%_ for (idx in relationships) { + const relationshipType = relationships[idx].relationshipType; + const ownerSide = relationships[idx].ownerSide; + const relationshipFieldName = relationships[idx].relationshipFieldName; + const relationshipFieldNamePlural = relationships[idx].relationshipFieldNamePlural; + const otherEntityName = relationships[idx].otherEntityName; + const otherEntityStateName = relationships[idx].otherEntityStateName; + const otherEntityField = relationships[idx].otherEntityField; + const otherEntityFieldCapitalized = relationships[idx].otherEntityFieldCapitalized; _%> + <%_ if (relationshipType === 'many-to-one' + || (relationshipType === 'one-to-one' && ownerSide === true) + || (relationshipType === 'many-to-many' && ownerSide === true && pagination === 'no')) { _%> + <%_ } _%> - <%_ } _%> - - <%_ } _%> - <%_ } _%> - - - )) - } - -
-
- - - <%_ if (fieldType === 'Boolean') { _%> - {<%= entityInstance %>.<%=fields[idx].fieldName%> ? 'true' : 'false'} - <%_ } else if (fieldType === 'Instant' || fieldType === 'ZonedDateTime') { _%> - .<%=fieldName%>} format={APP_DATE_FORMAT} /> - <%_ } else if (fieldType === 'LocalDate') { _%> - .<%=fieldName%>} format={APP_LOCAL_DATE_FORMAT} /> - <%_ } else if (fieldIsEnum && enableTranslation) { _%> - .<%= fieldType %>.${<%= entityInstance %>.<%= fieldName %>}`} /> - <%_ } else if (['byte[]', 'ByteBuffer'].includes(fieldType)) { _%> - <%_ - // blobFields - const fieldBlobType = fields[idx].fieldTypeBlobContent; - if (fieldBlobType !== 'text') { - _%> - {<%= entityInstance %>.<%= fieldName %> ? ( - - ) : null} - <%_ } else { _%> - {<%= entityInstance %>.<%= fieldName %>} + <%_ for (idx in relationships) { _%> + <%_ if (relationships[idx].relationshipType === 'many-to-one' + || (relationships[idx].relationshipType === 'one-to-one' && relationships[idx].ownerSide === true) + || (relationships[idx].relationshipType === 'many-to-many' && relationships[idx].ownerSide === true && pagination === 'no')) { + const fieldName = dto === 'no' ? "." + relationships[idx].otherEntityField : relationships[idx].otherEntityFieldCapitalized;_%> + <% } %>><%= relationships[idx].relationshipNameHumanized %><% if (pagination !== 'no') { %> <% } %> + <%_ } _%> <%_ } _%> - <%_ } else { _%> - {<%= entityInstance %>.<%= fieldName %>} - <%_ } _%> - - <%_ if (otherEntityName === 'user') { _%> - <%_ if (relationshipType === 'many-to-many') { _%> - { - (<%= entityInstance %>.<%= relationshipFieldNamePlural %>) ? - (<%= entityInstance %>.<%= relationshipFieldNamePlural %>.map((val, j) => - {val.<%= otherEntityField %>}{(j === <%= entityInstance %>.<%= relationshipFieldNamePlural %>.length - 1) ? '' : ', '} - ) - ) : null - } - <%_ } else { _%> - <%_ if (dto === 'no') { _%> - {<%= entityInstance + "." + relationshipFieldName %> ? <%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %> : ''} + +
+ + + <%_ if (fieldType === 'Boolean') { _%> + {<%= entityInstance %>.<%=fields[idx].fieldName%> ? 'true' : 'false'} + <%_ } else if (fieldType === 'Instant' || fieldType === 'ZonedDateTime') { _%> + .<%=fieldName%>} format={APP_DATE_FORMAT} /> + <%_ } else if (fieldType === 'LocalDate') { _%> + .<%=fieldName%>} format={APP_LOCAL_DATE_FORMAT} /> + <%_ } else if (fieldIsEnum && enableTranslation) { _%> + .<%= fieldType %>.${<%= entityInstance %>.<%= fieldName %>}`} /> + <%_ } else if (['byte[]', 'ByteBuffer'].includes(fieldType)) { _%> + <%_ + // blobFields + const fieldBlobType = fields[idx].fieldTypeBlobContent; + if (fieldBlobType !== 'text') { + _%> + {<%= entityInstance %>.<%= fieldName %> ? ( + + ) : null} <%_ } else { _%> - {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> ? <%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> : ''} - <%_ } _%> - <%_ } _%> + {<%= entityInstance %>.<%= fieldName %>} + <%_ } _%> <%_ } else { _%> - <%_ if (relationshipType === 'many-to-many') { _%> - { - (<%= entityInstance %>.<%= relationshipFieldNamePlural %>) ? - (<%= entityInstance %>.<%= relationshipFieldNamePlural %>.map((val, j) => - /${val.id}`}>{val.<%= otherEntityField %>}{(j === <%= entityInstance %>.<%= relationshipFieldNamePlural %>.length - 1) ? '' : ', '} - ) - ) : null - } - <%_ } else { _%> + {<%= entityInstance %>.<%= fieldName %>} + <%_ } _%> + + <%_ if (otherEntityName === 'user') { _%> + <%_ if (relationshipType === 'many-to-many') { _%> + { + (<%= entityInstance %>.<%= relationshipFieldNamePlural %>) ? + (<%= entityInstance %>.<%= relationshipFieldNamePlural %>.map((val, j) => + {val.<%= otherEntityField %>}{(j === <%= entityInstance %>.<%= relationshipFieldNamePlural %>.length - 1) ? '' : ', '} + ) + ) : null + } + <%_ } else { _%> <%_ if (dto === 'no') { _%> - {<%= entityInstance + "." + relationshipFieldName %> ? - /${<%= entityInstance + "." + relationshipFieldName + ".id}" %>`}> - {<%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %>} - : ''} + {<%= entityInstance + "." + relationshipFieldName %> ? <%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %> : ''} <%_ } else { _%> - {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> ? - /${<%= entityInstance + "." + relationshipFieldName + "Id}" %>`}> - {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %>} - : ''} + {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> ? <%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> : ''} + <%_ } _%> + <%_ } _%> + <%_ } else { _%> + <%_ if (relationshipType === 'many-to-many') { _%> + { + (<%= entityInstance %>.<%= relationshipFieldNamePlural %>) ? + (<%= entityInstance %>.<%= relationshipFieldNamePlural %>.map((val, j) => + /${val.id}`}>{val.<%= otherEntityField %>}{(j === <%= entityInstance %>.<%= relationshipFieldNamePlural %>.length - 1) ? '' : ', '} + ) + ) : null + } + <%_ } else { _%> + <%_ if (dto === 'no') { _%> + {<%= entityInstance + "." + relationshipFieldName %> ? + /${<%= entityInstance + "." + relationshipFieldName + ".id}" %>`}> + {<%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %>} + : ''} + <%_ } else { _%> + {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %> ? + /${<%= entityInstance + "." + relationshipFieldName + "Id}" %>`}> + {<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %>} + : ''} + <%_ } _%> <%_ } _%> + <%_ } _%> + -
- - - -
-
) : - ( + <%_ } _%> + +
+ + + +
+ + + )) + } + + + ) : (
No <%= entityClassPluralHumanized %> found
@@ -384,22 +384,28 @@ export class <%= entityReactName %> extends React.Component
<%_ if (pagination === 'pagination' || pagination === 'pager') { _%> - - i18nEnabled<% }}%> - /> - - - - + { + <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ? ( +
+ + i18nEnabled<% }}%> + /> + + + + +
+ ) : null + } <% } _%>
); From 2d7f2de37ada312a9dee1747fc4ae1723f859cb9 Mon Sep 17 00:00:00 2001 From: Youssef El Houti Date: Fri, 17 May 2019 11:45:13 +0200 Subject: [PATCH 020/298] remove unused and confusing import --- .../angular/src/main/webapp/app/shared/shared.module.ts.ejs | 2 -- 1 file changed, 2 deletions(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/shared.module.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/shared/shared.module.ts.ejs index cae1ad7798fd..37c7d47b203f 100644 --- a/generators/client/templates/angular/src/main/webapp/app/shared/shared.module.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/shared/shared.module.ts.ejs @@ -18,7 +18,6 @@ -%> import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { - <%=angularXAppName%>SharedLibsModule, <%=angularXAppName%>SharedCommonModule, <%_ if (authenticationType !== 'oauth2') { _%> <%=jhiPrefixCapitalized%>LoginModalComponent, @@ -28,7 +27,6 @@ import { @NgModule({ imports: [ - <%=angularXAppName%>SharedLibsModule, <%=angularXAppName%>SharedCommonModule ], declarations: [ From c0855653bbc7d9580b75e88f73772129d98761a9 Mon Sep 17 00:00:00 2001 From: cbornet Date: Fri, 17 May 2019 22:56:42 +0200 Subject: [PATCH 021/298] Allow localhost redirect URIs on all ports and CORS origin for keycloak --- .../config/realm-config/jhipster-realm.json.ejs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs index a166564b4317..151bd603894f 100644 --- a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +++ b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs @@ -820,18 +820,12 @@ "clientAuthenticatorType": "client-secret", "secret": "web_app", "redirectUris": [ - "http://localhost:<%= serverPort %>/*", - "https://localhost:<%= serverPort %>/*", - "http://localhost:8100/*", - "http://127.0.0.1:8761/*", - "http://localhost:9000/*" - ], - "webOrigins": [ - "http://localhost:<%= serverPort %>/*", - "http://localhost:8100/*", - "http://127.0.0.1:8761/*", - "http://localhost:9000/*" + "http://localhost:*", + "https://localhost:*", + "http://127.0.0.1:*", + "https://127.0.0.1:*" ], + "webOrigins": ["*"], "notBefore": 0, "bearerOnly": false, "consentRequired": false, From a4dd55acdae51202d28d5c61793d71076113cfd9 Mon Sep 17 00:00:00 2001 From: codelano Date: Sun, 19 May 2019 18:19:03 +0300 Subject: [PATCH 022/298] Only show health details for admin user Health details might contain some sensitive information so it should be showed to admin user only. Example of health details response: ``` { "status": "UP", "details": { "diskSpace": { "status": "UP", "details": { "total": 254930841600, "free": 29542526976, "threshold": 10485760 } }, "mongo": { "status": "UP", "details": { "version": "4.0.6" } } } } ``` --- .../templates/src/main/resources/config/application.yml.ejs | 1 + 1 file changed, 1 insertion(+) diff --git a/generators/server/templates/src/main/resources/config/application.yml.ejs b/generators/server/templates/src/main/resources/config/application.yml.ejs index 4d7de8be3a10..3853d1de8957 100644 --- a/generators/server/templates/src/main/resources/config/application.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application.yml.ejs @@ -116,6 +116,7 @@ management: endpoint: health: show-details: when-authorized + roles: "ROLE_ADMIN" jhimetrics: enabled: true info: From c971cc2796e6ffadb3cf1b9f22b3b51460e83d1e Mon Sep 17 00:00:00 2001 From: charliemordant Date: Mon, 20 May 2019 14:55:09 +0200 Subject: [PATCH 023/298] Angular relation required validation --- ...ntity-management-update.component.html.ejs | 88 +++++++++---------- .../entity-management-update.component.ts.ejs | 1 - 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.html.ejs index 8bbca71f921d..d8926c4d95f7 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.html.ejs @@ -174,85 +174,85 @@ _%> <%_ } _%> - <%_ for (idx in relationships) { - const relationshipType = relationships[idx].relationshipType; - const ownerSide = relationships[idx].ownerSide; - const otherEntityName = relationships[idx].otherEntityName; - const otherEntityNamePlural = relationships[idx].otherEntityNamePlural; - const otherEntityNameCapitalized = relationships[idx].otherEntityNameCapitalized; - const relationshipName = relationships[idx].relationshipName; - const relationshipNameHumanized = relationships[idx].relationshipNameHumanized; - const relationshipFieldName = relationships[idx].relationshipFieldName; - const relationshipFieldNamePlural = relationships[idx].relationshipFieldNamePlural; - const otherEntityField = relationships[idx].otherEntityField; - const otherEntityFieldCapitalized = relationships[idx].otherEntityFieldCapitalized; - const relationshipRequired = relationships[idx].relationshipRequired; - const translationKey = `${i18nKeyPrefix}.${relationshipName}`; _%> - <%_ if (relationshipType === 'many-to-one' || (relationshipType === 'one-to-one' && ownerSide === true && otherEntityName === 'user')) { _%> +<%_ for (idx in relationships) { +const relationshipType = relationships[idx].relationshipType; +const ownerSide = relationships[idx].ownerSide; +const otherEntityName = relationships[idx].otherEntityName; +const otherEntityNamePlural = relationships[idx].otherEntityNamePlural; +const otherEntityNameCapitalized = relationships[idx].otherEntityNameCapitalized; +const relationshipName = relationships[idx].relationshipName; +const relationshipNameHumanized = relationships[idx].relationshipNameHumanized; +const relationshipFieldName = relationships[idx].relationshipFieldName; +const relationshipFieldNamePlural = relationships[idx].relationshipFieldNamePlural; +const otherEntityField = relationships[idx].otherEntityField; +const otherEntityFieldCapitalized = relationships[idx].otherEntityFieldCapitalized; +const relationshipRequired = relationships[idx].relationshipRequired; +const translationKey = `${i18nKeyPrefix}.${relationshipName}`; _%> + <%_ if (relationshipType === 'many-to-one' || (relationshipType === 'one-to-one' && ownerSide === true && otherEntityName === 'user')) { _%>
- <%_ if (dto === 'no') { _%> + <%_ if (dto === 'no') { _%> - <%_ } else { _%> + <%_ } else { _%> - <%_ } _%> + <%_ } _%>
- <%_ } else if (relationshipType === 'one-to-one' && ownerSide === true) { _%> + <%_ } else if (relationshipType === 'one-to-one' && ownerSide === true) { _%>
- <%_ if (dto === 'no') { _%> + <%_ if (dto === 'no') { _%> - <%_ } else { _%> + <%_ } else { _%> - <%_ } _%> + <%_ } _%>
- <%_ } else if (relationshipType === 'many-to-many' && relationships[idx].ownerSide === true) { _%> + <%_ } else if (relationshipType === 'many-to-many' && relationships[idx].ownerSide === true) { _%>
- <%_ } _%> - <%_ if (relationships[idx].relationshipValidate === true) { _%> -
- <%_ if (relationshipRequired) { _%> + <%_ } _%> + <%_ if (relationships[idx].relationshipValidate === true) { _%> +
+ <%_ if (relationshipRequired) { _%> + *ngIf="editForm.get('<% if (relationshipType === 'many-to-one' || (relationshipType === 'one-to-one' && ownerSide === true)) { %><%= relationshipName %><% if (dto !== 'no') { %>Id<% } %><%_ } else if (relationshipType === 'many-to-many' && relationships[idx].ownerSide === true) { _%><%=relationshipFieldNamePlural %><% } %>').errors.required" jhiTranslate="entity.validation.required"> This field is required. - <%_ } _%> + <%_ } _%>
- <%_ } _%> - <%_ } _%> + <%_ } _%> +<%_ } _%>
<%_ } else if (pagination === 'pagination') { _%> -
+
From 340815d5c4a8c9eadb1fef4272b05b72e3db0288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Fri, 31 May 2019 16:07:19 +0200 Subject: [PATCH 083/298] fix #9808 for react pagination --- .../administration.reducer.ts.ejs | 2 +- .../administration/audits/audits.tsx.ejs | 30 ++++++------- .../user-management.reducer.ts.ejs | 2 +- .../user-management/user-management.tsx.ejs | 30 ++++++------- .../webapp/app/entities/entity.reducer.ts.ejs | 2 +- .../main/webapp/app/entities/entity.tsx.ejs | 43 +++++++++---------- 6 files changed, 51 insertions(+), 58 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs index 353f00d5234e..3a26d4823612 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs @@ -162,7 +162,7 @@ export default (state: AdministrationState = initialState, action): Administrati ...state, loading: false, audits: action.payload.data, - totalItems: action.payload.headers['x-total-count'] + totalItems: parseInt(action.payload.headers['x-total-count'], 10) }; <%_ } _%> case SUCCESS(ACTION_TYPES.FETCH_HEALTH): diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs index a96064212ce2..b57c04868e44 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs @@ -25,7 +25,6 @@ import { TextFormat, JhiPagination, JhiItemCount, - getPaginationItemsNumber, getSortState, IPaginationBaseState } from 'react-jhipster'; @@ -146,21 +145,20 @@ export class AuditsPage extends React.Component - {audits && audits.length > 0 ? ( -
- - - - - - -
- ) : null} +
0 ? '' : 'd-none' }> + + + + + + +
); } diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs index a4ff6f34c092..f654b90be7a8 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs @@ -92,7 +92,7 @@ export default (state: UserManagementState = initialState, action): UserManageme ...state, loading: false, users: action.payload.data, - totalItems: action.payload.headers['x-total-count'] + totalItems: parseInt(action.payload.headers['x-total-count'], 10) }; case SUCCESS(ACTION_TYPES.FETCH_USER): return { diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs index 19ed59cadf2d..bab0a717a570 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs @@ -27,7 +27,6 @@ import { TextFormat, JhiPagination, JhiItemCount, - getPaginationItemsNumber, getSortState, IPaginationBaseState } from 'react-jhipster'; @@ -178,21 +177,20 @@ export class UserManagement extends React.Component - {users && users.length > 0 ? ( -
- - - - - - -
- ) : null} +
0 ? '' : 'd-none' }> + + + + + + +
); } diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs index 71047a8062f9..92f2ff8ff3f9 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs @@ -126,7 +126,7 @@ export default (state: <%= entityReactName %>State = initialState, action): <%= <%_ } _%> loading: false, <%_ if (pagination !== 'no') { _%> - totalItems: action.payload.headers['x-total-count'], + totalItems: parseInt(action.payload.headers['x-total-count'], 10), <%_ } _%> <%_ if (pagination === 'infinite-scroll') { _%> entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links) diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index 1b561f5a6e54..1cfc622a56d1 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -39,7 +39,7 @@ import { <%_ if (pagination !== 'no') { _%> , getSortState, IPaginationBaseState <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> - , getPaginationItemsNumber, JhiPagination, JhiItemCount + , JhiPagination, JhiItemCount <%_ }} _%> } from 'react-jhipster'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -386,28 +386,25 @@ export class <%= entityReactName %> extends React.Component <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> - { - <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ? ( -
- - i18nEnabled<% }}%> - /> - - - - -
- ) : null - } +
List && <%= entityInstance %>List.length > 0 ? '' : 'd-none' }> + + i18nEnabled<% }}%> + /> + + + + +
<% } _%> ); From 0ef1e00626058581484ea3806052c8214204445f Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Fri, 31 May 2019 20:06:17 +0530 Subject: [PATCH 084/298] Disable cli analytics --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index cb4455e0ae7d..a50d86e573b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,7 @@ env: - JHI_DISABLE_WEBPACK_LOGS=true - JHI_E2E_HEADLESS=true - JHI_SCRIPTS=$TRAVIS_BUILD_DIR/test-integration/scripts + - NG_CLI_ANALYTICS="false" matrix: - JHI_APP=ngx-default JHI_PROFILE=prod JHI_PROTRACTOR=1 JHI_ENTITY=sql JHI_SONAR=1 - JHI_APP=ngx-psql-es-noi18n-mapsid JHI_PROFILE=prod JHI_PROTRACTOR=1 JHI_ENTITY=sqlfull From ead74ade9c0c246cb4eb67fe3e58dbee415d7cc6 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Sun, 2 Jun 2019 16:53:55 +0300 Subject: [PATCH 085/298] Gradle- JAXB runtime must always be present when using JPA and JDK 11 --- generators/server/templates/build.gradle.ejs | 2 -- 1 file changed, 2 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index b38916ab1102..6cf3950e96fb 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -468,9 +468,7 @@ dependencies { annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}" <%_ if (databaseType === 'sql') { _%> annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernate_version}" - <%_ if (authenticationType !== 'uaa') { _%> annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}" - <%_ } _%> <%_ } _%> annotationProcessor ("org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}") { exclude group: "com.vaadin.external.google", module: "android-json" From 19a8dc5fcda2ad5b82d7516cdc9502720fcd0e57 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Sun, 2 Jun 2019 19:00:46 +0300 Subject: [PATCH 086/298] Compute default JAVA_HOME instead of hard-coding it when using JDK 11 --- test-integration/scripts/00-init-env.sh | 2 +- test-integration/scripts/01-display-configuration.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test-integration/scripts/00-init-env.sh b/test-integration/scripts/00-init-env.sh index 1215a724c960..2498e0ecd9a6 100755 --- a/test-integration/scripts/00-init-env.sh +++ b/test-integration/scripts/00-init-env.sh @@ -43,5 +43,5 @@ fi # set correct OpenJDK version if [[ "$JHI_JDK" == "11" ]]; then - JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ + JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") fi diff --git a/test-integration/scripts/01-display-configuration.sh b/test-integration/scripts/01-display-configuration.sh index aa80a3d340af..28ce1b35eb50 100755 --- a/test-integration/scripts/01-display-configuration.sh +++ b/test-integration/scripts/01-display-configuration.sh @@ -24,3 +24,4 @@ echo JHI_SAMPLES="$JHI_SAMPLES" echo JHI_SCRIPTS="$JHI_SCRIPTS" echo JHI_FOLDER_APP="$JHI_FOLDER_APP" echo JHI_FOLDER_UAA="$JHI_FOLDER_UAA" +echo JAVA_HOME="$JAVA_HOME" From 9071d4c71527cd0d23c23889ca186dbd5b13f883 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Sun, 2 Jun 2019 20:36:08 +0300 Subject: [PATCH 087/298] Fix javadoc issue that prevents JDK 11 from building the javadoc when using Couchbase --- .../src/main/java/package/config/DatabaseConfiguration.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs index 23de74652b23..2f67bc75d1b4 100644 --- a/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs @@ -333,7 +333,7 @@ public class DatabaseConfiguration { } /** - * Simple singleton to convert from {@link String} {@link byte[]} representation. + * Simple singleton to convert from {@link String} {@code byte[]} representation. */ @ReadingConverter public enum StringToByteConverter implements Converter { From 4665d8cc181b403124eed0f3a2e724d689f121e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 3 Jun 2019 09:58:35 +0200 Subject: [PATCH 088/298] update react-jhipster version --- generators/client/templates/react/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json.ejs b/generators/client/templates/react/package.json.ejs index f047e1cdee61..641c12ef1666 100644 --- a/generators/client/templates/react/package.json.ejs +++ b/generators/client/templates/react/package.json.ejs @@ -42,7 +42,7 @@ limitations under the License. "react": "16.8.5", "react-dom": "16.8.5", "react-hot-loader": "4.8.0", - "react-jhipster": "0.8.0", + "react-jhipster": "0.9.0", "react-loadable": "5.5.0", "react-redux": "6.0.1", "react-redux-loading-bar": "4.2.0", From 0012f89da533b472e1d4814949ed9227decb6501 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Mon, 3 Jun 2019 13:17:20 +0200 Subject: [PATCH 089/298] Format with prettier --- generators/client/needle-api/needle-client-angular.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/generators/client/needle-api/needle-client-angular.js b/generators/client/needle-api/needle-client-angular.js index 959f19be0c4f..ec3e19551dfe 100644 --- a/generators/client/needle-api/needle-client-angular.js +++ b/generators/client/needle-api/needle-client-angular.js @@ -188,11 +188,7 @@ module.exports = class extends needleClientBase { if (!isSpecificEntityAlreadyGenerated) { const appName = this.generator.getAngularXAppName(); - const isAnyEntityAlreadyGenerated = jhipsterUtils.checkStringInFile( - entityModulePath, - 'loadChildren', - this.generator - ); + const isAnyEntityAlreadyGenerated = jhipsterUtils.checkStringInFile(entityModulePath, 'loadChildren', this.generator); const modulePath = `./${entityFolderName}/${entityFileName}.module`; const moduleName = microServiceName From 33b475dacfdcf9db3672a1ac091b687013c53177 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 3 Jun 2019 13:46:10 +0100 Subject: [PATCH 090/298] Implements SecurityAdviceTrait since it is optional now --- .../java/package/web/rest/errors/ExceptionTranslator.java.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs b/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs index 66d1fbf7c432..686af537e5e9 100644 --- a/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs @@ -43,6 +43,7 @@ import org.zalando.problem.Problem; import org.zalando.problem.ProblemBuilder; import org.zalando.problem.Status; import org.zalando.problem.spring.web<% if (reactive) { %>flux<% } %>.advice.ProblemHandling; +import org.zalando.problem.spring.web<% if (reactive) { %>flux<% } %>.advice.security.SecurityAdviceTrait; import org.zalando.problem.violations.ConstraintViolationProblem; <%_ if (reactive) { _%> import reactor.core.publisher.Mono; @@ -64,7 +65,7 @@ import java.util.stream.Collectors; * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807). */ @ControllerAdvice -public class ExceptionTranslator implements ProblemHandling { +public class ExceptionTranslator implements ProblemHandling, SecurityAdviceTrait { <%_ let returnType; From 410f0bbbc85c537a6d309d42cb28eb6df86a3c79 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 3 Jun 2019 13:46:32 +0100 Subject: [PATCH 091/298] Remove unused imports --- .../web/rest/errors/ExceptionTranslatorTestController.java.ejs | 2 -- 1 file changed, 2 deletions(-) diff --git a/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorTestController.java.ejs b/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorTestController.java.ejs index 7f314090a3c5..9763e36f6d83 100644 --- a/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorTestController.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorTestController.java.ejs @@ -28,8 +28,6 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import java.util.HashMap; -import java.util.Map; @RestController public class ExceptionTranslatorTestController { From 0313fa6a68eb9b9d7a6284f62d6ab0fcd02928a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 3 Jun 2019 16:58:55 +0200 Subject: [PATCH 092/298] replace audit table by message when no audit found --- .../admin/audits/audits.component.html.ejs | 7 +- .../administration/audits/audits.tsx.ejs | 78 +++++++++++-------- .../entity-management.component.html.ejs | 2 +- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/audits/audits.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/audits/audits.component.html.ejs index 1b15eb9e8c42..902233e4a6c5 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/audits/audits.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/audits/audits.component.html.ejs @@ -36,7 +36,10 @@ -
+
+ No audit found +
+
@@ -59,7 +62,7 @@
-
+
diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs index b57c04868e44..0fb1446c5548 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/audits/audits.tsx.ejs @@ -111,40 +111,50 @@ export class AuditsPage extends React.Component to - - - - - - - - - - - {audits.map((audit, i) => ( - - - - - - - ))} - -
- Date - - - User - - - State - - - Extra data -
{}{audit.principal}{audit.type} - {audit.data ? audit.data.message : null} - {audit.data ? audit.data.remoteAddress : null} -
+ { + audits && audits.length > 0 ?( + + + + + + + + + + + {audits.map((audit, i) => ( + + + + + + + ))} + +
+ Date + + + User + + + State + + + Extra data +
{}{audit.principal}{audit.type} + {audit.data ? audit.data.message : null} + {audit.data ? audit.data.remoteAddress : null} +
+ ) : ( +
+ + No audit found + +
+ ) + }
0 ? '' : 'd-none' }> diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs index 68c5b7651b63..0dc858b25e1c 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.component.html.ejs @@ -173,7 +173,7 @@ <%_ if (databaseType !== 'cassandra') { _%> <%_ if (pagination === 'pager') { _%> -
+
From f44e9274c0011d9dc7666a620b220c6cfd45dbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 3 Jun 2019 16:59:09 +0200 Subject: [PATCH 093/298] add missing translation --- .../languages/templates/src/main/webapp/i18n/al/audits.json | 3 ++- .../templates/src/main/webapp/i18n/ar-ly/audits.json | 5 +++-- .../languages/templates/src/main/webapp/i18n/bn/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/by/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ca/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/cs/audits.json | 5 +++-- .../languages/templates/src/main/webapp/i18n/da/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/de/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/el/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/en/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/es/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/et/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/fa/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/fr/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/gl/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/hi/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/hu/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/hy/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/in/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/it/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ja/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ko/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/mr/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/my/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/nl/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/pl/audits.json | 3 ++- .../templates/src/main/webapp/i18n/pt-br/audits.json | 3 ++- .../templates/src/main/webapp/i18n/pt-pt/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ro/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ru/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/sk/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/sr/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ta/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/te/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/th/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/tr/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/ua/audits.json | 3 ++- .../templates/src/main/webapp/i18n/uz-Cyrl-uz/audits.json | 3 ++- .../templates/src/main/webapp/i18n/uz-Latn-uz/audits.json | 3 ++- .../languages/templates/src/main/webapp/i18n/vi/audits.json | 3 ++- .../templates/src/main/webapp/i18n/zh-cn/audits.json | 3 ++- .../templates/src/main/webapp/i18n/zh-tw/audits.json | 3 ++- package-lock.json | 6 +++--- 43 files changed, 89 insertions(+), 47 deletions(-) diff --git a/generators/languages/templates/src/main/webapp/i18n/al/audits.json b/generators/languages/templates/src/main/webapp/i18n/al/audits.json index 0d2f430cc690..885cf54179e9 100644 --- a/generators/languages/templates/src/main/webapp/i18n/al/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/al/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Adresa e jashtëme: " } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ar-ly/audits.json b/generators/languages/templates/src/main/webapp/i18n/ar-ly/audits.json index 5f928621d6d6..00a86bd160d2 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ar-ly/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ar-ly/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "العنوان" } - } + }, + "notFound": "No audit found" } -} \ No newline at end of file +} diff --git a/generators/languages/templates/src/main/webapp/i18n/bn/audits.json b/generators/languages/templates/src/main/webapp/i18n/bn/audits.json index 1d1ce5636002..8ba00685ce97 100644 --- a/generators/languages/templates/src/main/webapp/i18n/bn/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/bn/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "রিমোট অ্যাড্রেস:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/by/audits.json b/generators/languages/templates/src/main/webapp/i18n/by/audits.json index aff9536ad18d..d7771b277c33 100644 --- a/generators/languages/templates/src/main/webapp/i18n/by/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/by/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Аддалены адрас:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ca/audits.json b/generators/languages/templates/src/main/webapp/i18n/ca/audits.json index dee7ff3c3e56..0ee9ff78acf0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ca/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ca/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Adreça remota:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/cs/audits.json b/generators/languages/templates/src/main/webapp/i18n/cs/audits.json index 031a3a5a57cc..2712074ae0dc 100644 --- a/generators/languages/templates/src/main/webapp/i18n/cs/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/cs/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Vzdálená adresa:" } - } - } + }, + "notFound": "No audit found" + } } diff --git a/generators/languages/templates/src/main/webapp/i18n/da/audits.json b/generators/languages/templates/src/main/webapp/i18n/da/audits.json index 830933fd6c74..91834f64a0a0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/da/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/da/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote Address:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/de/audits.json b/generators/languages/templates/src/main/webapp/i18n/de/audits.json index 28b324cfb0f5..7a1c3baabf65 100644 --- a/generators/languages/templates/src/main/webapp/i18n/de/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/de/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote-Adresse:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/el/audits.json b/generators/languages/templates/src/main/webapp/i18n/el/audits.json index ed3be851d758..02cde4be5e7c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/el/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/el/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Απομακρυσμένη Διεύθυνση:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/en/audits.json b/generators/languages/templates/src/main/webapp/i18n/en/audits.json index ed5e16d4c544..51642afbc2a1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/en/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/en/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote Address:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/es/audits.json b/generators/languages/templates/src/main/webapp/i18n/es/audits.json index a77e1390f7cf..40627fb34884 100644 --- a/generators/languages/templates/src/main/webapp/i18n/es/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/es/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Dirección remota:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/et/audits.json b/generators/languages/templates/src/main/webapp/i18n/et/audits.json index 9e2b6f89e547..845ce1c2dfa0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/et/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/et/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "IP aadress:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/fa/audits.json b/generators/languages/templates/src/main/webapp/i18n/fa/audits.json index 30e9eadcf4ff..b1236f5fc219 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fa/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/fa/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "آدرس ریموت:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/fr/audits.json b/generators/languages/templates/src/main/webapp/i18n/fr/audits.json index d4c4e06ab78e..61eef823d966 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fr/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/fr/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Adresse Distante :" } - } + }, + "notFound": "Aucun audit trouvé" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/gl/audits.json b/generators/languages/templates/src/main/webapp/i18n/gl/audits.json index 196d8d8b42c3..482bde1c0b1b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/gl/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/gl/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Dirección remota:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/hi/audits.json b/generators/languages/templates/src/main/webapp/i18n/hi/audits.json index 7f705ef497b7..63f9f7b7c58e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hi/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/hi/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "दूरस्थ पते:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/hu/audits.json b/generators/languages/templates/src/main/webapp/i18n/hu/audits.json index 4bf2cfb7cd34..0347a254cc4f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hu/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/hu/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "IP cím:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/hy/audits.json b/generators/languages/templates/src/main/webapp/i18n/hy/audits.json index d7a0b5623e88..6ba154bbe6bf 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hy/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/hy/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote Address:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/in/audits.json b/generators/languages/templates/src/main/webapp/i18n/in/audits.json index ffe870abbd34..189a0b3cabe7 100644 --- a/generators/languages/templates/src/main/webapp/i18n/in/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/in/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Alamat Remote:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/it/audits.json b/generators/languages/templates/src/main/webapp/i18n/it/audits.json index 10c0abeb88a1..54cccd28828e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/it/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/it/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Indirizzo remoto:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ja/audits.json b/generators/languages/templates/src/main/webapp/i18n/ja/audits.json index c0c2d00d4fd5..0405de19ad5f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ja/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ja/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "リモートアドレス:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ko/audits.json b/generators/languages/templates/src/main/webapp/i18n/ko/audits.json index 1a97184d60c5..50f5566d0d9f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ko/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ko/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "원격 주소:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/mr/audits.json b/generators/languages/templates/src/main/webapp/i18n/mr/audits.json index 9ce0d1143dd5..a9cc8a97b62e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/mr/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/mr/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "दूरस्थ पत्ता:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/my/audits.json b/generators/languages/templates/src/main/webapp/i18n/my/audits.json index 435cbe9141a6..fa0f9dae97d3 100644 --- a/generators/languages/templates/src/main/webapp/i18n/my/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/my/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote Address:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/nl/audits.json b/generators/languages/templates/src/main/webapp/i18n/nl/audits.json index ab1b5bf69511..8a678812d542 100644 --- a/generators/languages/templates/src/main/webapp/i18n/nl/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/nl/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Remote Adres:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/pl/audits.json b/generators/languages/templates/src/main/webapp/i18n/pl/audits.json index 85a166f760d2..7d2a45854dd9 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pl/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/pl/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Zdalny adres:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json b/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json index bb2d51246bc3..7dc2837ba24a 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Endereço remoto:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-pt/audits.json b/generators/languages/templates/src/main/webapp/i18n/pt-pt/audits.json index 9ad4a6ead9f2..096b94c0e37f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-pt/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/pt-pt/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Endereço remoto:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ro/audits.json b/generators/languages/templates/src/main/webapp/i18n/ro/audits.json index f382891e5a26..3ef25eca4683 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ro/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ro/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Adresa:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ru/audits.json b/generators/languages/templates/src/main/webapp/i18n/ru/audits.json index 70920aa9ce07..2ff100853749 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ru/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ru/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Удалённый адрес:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/sk/audits.json b/generators/languages/templates/src/main/webapp/i18n/sk/audits.json index 196d4ac86e22..722870ce2a52 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sk/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/sk/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Vzdialená adresa:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/sr/audits.json b/generators/languages/templates/src/main/webapp/i18n/sr/audits.json index 196882868246..25dd58578b1f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sr/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/sr/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Adresa pristupa:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ta/audits.json b/generators/languages/templates/src/main/webapp/i18n/ta/audits.json index ee71d6db2051..8171c696e81e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ta/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ta/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "தொலை முகவரி:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/te/audits.json b/generators/languages/templates/src/main/webapp/i18n/te/audits.json index b961a4f6c71d..8045921b130a 100644 --- a/generators/languages/templates/src/main/webapp/i18n/te/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/te/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "రిమోట్ అడ్రస్:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/th/audits.json b/generators/languages/templates/src/main/webapp/i18n/th/audits.json index 24a88f4d37fa..75e82dd1ec51 100644 --- a/generators/languages/templates/src/main/webapp/i18n/th/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/th/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "ที่อยู่ปลายทาง:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/tr/audits.json b/generators/languages/templates/src/main/webapp/i18n/tr/audits.json index 4afe8d8292b6..e07572b949ee 100644 --- a/generators/languages/templates/src/main/webapp/i18n/tr/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/tr/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Uzak Adres:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/ua/audits.json b/generators/languages/templates/src/main/webapp/i18n/ua/audits.json index eb692fb16e4d..6e5c4347b23f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ua/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/ua/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Віддалена адреса:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/audits.json b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/audits.json index 2d03fd02760e..346998743731 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Масофадаги манзил:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/audits.json b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/audits.json index b9946869117b..2678e017ce91 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Ip adres:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/vi/audits.json b/generators/languages/templates/src/main/webapp/i18n/vi/audits.json index c02cb3fb6b57..465d2d929ab3 100644 --- a/generators/languages/templates/src/main/webapp/i18n/vi/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/vi/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "Địa chỉ máy khách:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-cn/audits.json b/generators/languages/templates/src/main/webapp/i18n/zh-cn/audits.json index abfda6cc5764..fd6a03c2b24d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-cn/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/zh-cn/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "远程地址:" } - } + }, + "notFound": "No audit found" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-tw/audits.json b/generators/languages/templates/src/main/webapp/i18n/zh-tw/audits.json index 638d65743570..fb71c41dcd46 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-tw/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/zh-tw/audits.json @@ -22,6 +22,7 @@ "data": { "remoteAddress": "遠端位址:" } - } + }, + "notFound": "No audit found" } } diff --git a/package-lock.json b/package-lock.json index c590a6e327c0..55a47040e43a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1134,7 +1134,7 @@ }, "enabled": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "requires": { "env-variable": "0.0.x" @@ -1464,7 +1464,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -1827,7 +1827,7 @@ }, "fecha": { "version": "2.3.3", - "resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" }, "figures": { From b3fe9499d636caf9b2955db3b659a95f74127a93 Mon Sep 17 00:00:00 2001 From: Jukka Pelto-aho Date: Mon, 3 Jun 2019 21:48:40 +0300 Subject: [PATCH 094/298] entity json added --- .../templates/i18n/entity_fi.json.ejs | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 generators/entity-i18n/templates/i18n/entity_fi.json.ejs diff --git a/generators/entity-i18n/templates/i18n/entity_fi.json.ejs b/generators/entity-i18n/templates/i18n/entity_fi.json.ejs new file mode 100644 index 000000000000..3c9de32d44d5 --- /dev/null +++ b/generators/entity-i18n/templates/i18n/entity_fi.json.ejs @@ -0,0 +1,58 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%><% +let helpBlocks = 0; %> +{ + "<%= angularAppName %>": { + "<%= entityTranslationKey %>" : { + "home": { + "title": "<%= entityClassPluralHumanized %>", + "createLabel": "Luo <%= entityClassHumanized %>", + "createOrEditLabel": "Luo tai muokkaa <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, + "search": "Etsi <%= entityClassHumanized %>"<% } %>, + "notFound": "<%= entityClassHumanized %> ei löytynyt"<% %> + },<% if (!microserviceAppName) { %> + "created": "Uusi <%= entityClassHumanized %> on luotu, id: {{ param }}", + "updated": "<%= entityClassHumanized %> on päivitetty, id: {{ param }}", + "deleted": "<%= entityClassHumanized %> on päivitetty, id: {{ param }}",<% } %> + "delete": { + "question": "Haluatko varmasti poistaa <%= entityClassHumanized %> {{ id }}?" + }, + "detail": { + "title": "<%= entityClassHumanized %>" + }<% for (idx in fields) { + if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>, + "<%=fields[idx].fieldName%>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>, + "<%=relationships[idx].relationshipName%>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0){%>, + "help": {<% for (idx in fields) { + if (fields[idx].javadoc) { + --helpBlocks; %> + "<%=fields[idx].fieldName%>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<%} + } + } %> + }<% } %> + } + }<% if (microserviceAppName) { %>, + "<%= microserviceAppName %>": { + "<%= entityTranslationKey %>" : { + "created": "Uusi <%= entityClassHumanized %> on luotu, id: {{ param }}", + "updated": "<%= entityClassHumanized %> on päivitetty, id: {{ param }}", + "deleted": "<%= entityClassHumanized %> on poistettu, id: {{ param }}" + } + }<% } %> +} From 10b6ee64174c1531d4aa2004e6364aa55b286827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Mon, 3 Jun 2019 23:57:59 +0200 Subject: [PATCH 095/298] Use mainstream Couchbase testcontainer --- generators/server/templates/build.gradle.ejs | 2 +- generators/server/templates/pom.xml.ejs | 4 ++-- .../java/package/config/DatabaseConfigurationIT.java.ejs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 6cf3950e96fb..20e2afe1683b 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -501,7 +501,7 @@ dependencies { testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo" <%_ } _%> <%_ if (databaseType === 'couchbase') { _%> - testImplementation "com.github.differentway:couchbase-testcontainer" + testImplementation "org.testcontainers:couchbase" <%_ } _%> testImplementation "org.hamcrest:hamcrest-library" <%_ if (databaseType === 'sql') { _%> diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 4b9d19cba76f..9c2c6e3cfb43 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -318,8 +318,8 @@ <%_ } _%> <%_ if (databaseType === 'couchbase') { _%> - com.github.differentway - couchbase-testcontainer + org.testcontainers + couchbase test diff --git a/generators/server/templates/src/test/java/package/config/DatabaseConfigurationIT.java.ejs b/generators/server/templates/src/test/java/package/config/DatabaseConfigurationIT.java.ejs index 30e14c38dfdb..64251e8ac1a9 100644 --- a/generators/server/templates/src/test/java/package/config/DatabaseConfigurationIT.java.ejs +++ b/generators/server/templates/src/test/java/package/config/DatabaseConfigurationIT.java.ejs @@ -38,7 +38,7 @@ public class DatabaseConfigurationIT extends AbstractCouchbaseConfiguration { private CouchbaseProperties couchbaseProperties; - private static CouchbaseContainer> couchbaseContainer; + private static CouchbaseContainer couchbaseContainer; public DatabaseConfigurationIT(CouchbaseProperties couchbaseProperties) { this.couchbaseProperties = couchbaseProperties; @@ -75,11 +75,11 @@ public class DatabaseConfigurationIT extends AbstractCouchbaseConfiguration { return this; } - private CouchbaseContainer> getCouchbaseContainer() { + private CouchbaseContainer getCouchbaseContainer() { if (couchbaseContainer != null) { return couchbaseContainer; } - couchbaseContainer = new CouchbaseContainer<>("<%= DOCKER_COUCHBASE %>"); + couchbaseContainer = new CouchbaseContainer("<%= DOCKER_COUCHBASE %>"); couchbaseContainer .withNewBucket(DefaultBucketSettings.builder() .name(getBucketName()) From 7844104ae28c317a500faff2580cdc0aa3884bec Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 4 Jun 2019 07:54:49 +0200 Subject: [PATCH 096/298] Set NG_CLI_ANALYTICS to false --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8f5781430057..be75b43c0382 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,6 +38,7 @@ jobs: JHI_DISABLE_WEBPACK_LOGS: true JHI_E2E_HEADLESS: true JHI_SCRIPTS: $(Build.Repository.LocalPath)/test-integration/scripts + NG_CLI_ANALYTICS: false strategy: matrix: From 8c537f662b55b3519fb6e3d60cb01a82ba2a282a Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Tue, 4 Jun 2019 14:11:12 +0300 Subject: [PATCH 097/298] Gradle - Use custom configuration to avoid launching the Spring Boot devtools when running tests (#9855) --- .../server/templates/gradle/profile_dev.gradle.ejs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/generators/server/templates/gradle/profile_dev.gradle.ejs b/generators/server/templates/gradle/profile_dev.gradle.ejs index 25a52c95eeee..4dbe8e13895c 100644 --- a/generators/server/templates/gradle/profile_dev.gradle.ejs +++ b/generators/server/templates/gradle/profile_dev.gradle.ejs @@ -16,8 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. -%> +configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } +} + dependencies { - runtimeOnly "org.springframework.boot:spring-boot-devtools" + developmentOnly "org.springframework.boot:spring-boot-devtools" <%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%> implementation "com.h2database:h2" <%_ } _%> From 59e36b1d7314fb32fb6b63b98e6f643df368bd51 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Tue, 4 Jun 2019 14:12:07 +0300 Subject: [PATCH 098/298] Disable H2 MULTI_THREADED feature to avoid possible deadlock when running ITs (#9854) --- .../templates/src/test/resources/config/application.yml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/test/resources/config/application.yml.ejs b/generators/server/templates/src/test/resources/config/application.yml.ejs index 97e6a8f28aec..501cd5794c64 100644 --- a/generators/server/templates/src/test/resources/config/application.yml.ejs +++ b/generators/server/templates/src/test/resources/config/application.yml.ejs @@ -57,7 +57,7 @@ spring: <%_ if (databaseType === 'sql') { _%> datasource: type: com.zaxxer.hikari.HikariDataSource - url: jdbc:h2:mem:<%= baseName %>;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + url: jdbc:h2:mem:<%= baseName %>;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MULTI_THREADED=FALSE name: username: password: From 5a1d9443b6f2fe40e32a23a91f6faa6e5d4f416a Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 4 Jun 2019 08:01:22 +0200 Subject: [PATCH 099/298] Upgrade ng-jhipster to 0.10.1 --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 34ac95cf8d7d..d7ca08b37f61 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -46,7 +46,7 @@ <%_ } _%> "core-js": "3.1.3", "moment": "2.24.0", - "ng-jhipster": "0.9.3", + "ng-jhipster": "0.10.1", "ngx-cookie": "4.0.2", "ngx-infinite-scroll": "7.1.0", "ngx-webstorage": "4.0.0", From 3732469e1c17fd3c816c7531ac75dec872351658 Mon Sep 17 00:00:00 2001 From: Jonathan Ruddell Date: Tue, 4 Jun 2019 11:46:11 -0700 Subject: [PATCH 100/298] fix webpack proxy when client/server are separated when using separate client/server, index.html does not exist on the backend, so refreshing gives a server-side 404 error Fix #9839 --- .../templates/angular/webpack/webpack.dev.js.ejs | 13 +++++++++++-- .../templates/react/webpack/webpack.dev.js.ejs | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/generators/client/templates/angular/webpack/webpack.dev.js.ejs b/generators/client/templates/angular/webpack/webpack.dev.js.ejs index d7f1cce3ee90..ad0908016e52 100644 --- a/generators/client/templates/angular/webpack/webpack.dev.js.ejs +++ b/generators/client/templates/angular/webpack/webpack.dev.js.ejs @@ -38,7 +38,15 @@ module.exports = (options) => webpackMerge(commonConfig({ env: ENV }), { contentBase: './<%= DIST_DIR %>', proxy: [{ context: [ - '/' + '/api', + '/services', + '/management', + '/swagger-resources', + '/v2/api-docs', + '/h2-console',<% if (authenticationType === 'oauth2') { %> + '/oauth2', + '/login',<% } %> + '/auth' ], target: `http${options.tls ? 's' : ''}://localhost:<%= serverPort %>`, secure: false, @@ -54,7 +62,8 @@ module.exports = (options) => webpackMerge(commonConfig({ env: ENV }), { watchOptions: { ignored: /node_modules/ }, - https: options.tls + https: options.tls, + historyApiFallback: true }, entry: { polyfills: './<%= MAIN_SRC_DIR %>app/polyfills', diff --git a/generators/client/templates/react/webpack/webpack.dev.js.ejs b/generators/client/templates/react/webpack/webpack.dev.js.ejs index cc60d6adb392..61b01b9d3176 100644 --- a/generators/client/templates/react/webpack/webpack.dev.js.ejs +++ b/generators/client/templates/react/webpack/webpack.dev.js.ejs @@ -60,7 +60,15 @@ module.exports = (options) => webpackMerge(commonConfig({ env: ENV }), { contentBase: './<%= DIST_DIR %>', proxy: [{ context: [ - '/' + '/api', + '/services', + '/management', + '/swagger-resources', + '/v2/api-docs', + '/h2-console',<% if (authenticationType === 'oauth2') { %> + '/oauth2', + '/login',<% } %> + '/auth' ], target: `http${options.tls ? 's' : ''}://localhost:<%= serverPort %>`, secure: false, @@ -75,7 +83,8 @@ module.exports = (options) => webpackMerge(commonConfig({ env: ENV }), { watchOptions: { ignored: /node_modules/ }, - https: options.tls + https: options.tls, + historyApiFallback: true }, stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats, plugins: [ From 73bc853683ba6fb3ab97bdcf01b17dc2ef2d54bb Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 4 Jun 2019 21:24:13 +0200 Subject: [PATCH 101/298] Daily builds: add missing badges [skip ci] (#9852) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 8ff416e8b336..f0aaddccd1f7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Additional builds at [hipster-labs/jhipster-daily-builds](https://github.com/hip | Type | Status | | :------------------- | :----------------------------------------------------- | | Docker | [![Build Status][img-docker]][azure-url] | +| Official | [![Build Status][img-official]][azure-url] | | Angular.Maven | [![Build Status][img-angular-maven]][azure-url] | | Angular.Maven.NoSQL | [![Build Status][img-angular-maven-nosql]][azure-url] | | Angular.Gradle | [![Build Status][img-angular-gradle]][azure-url] | @@ -55,6 +56,10 @@ Additional builds at [hipster-labs/jhipster-daily-builds](https://github.com/hip | Microservices.JWT | [![Build Status][img-ms-jwt]][azure-url] | | Microservices.OAuth2 | [![Build Status][img-ms-oauth2]][azure-url] | | Microservices.UAA | [![Build Status][img-ms-uaa]][azure-url] | +| Monolith.OAuth2 | [![Build Status][img-monolith-oauth2]][azure-url] | +| Official OpenJDK 8 | [![Build Status][img-official-openjdk8]][azure-url] | +| Yarn | [![Build Status][img-yarn]][azure-url] | +| No Database | [![Build Status][img-nodatabase]][azure-url] | ## Analysis of the sample JHipster project @@ -62,6 +67,7 @@ Additional builds at [hipster-labs/jhipster-daily-builds](https://github.com/hip [azure-url]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_build [img-docker]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Docker.Image +[img-official]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Official [img-angular-maven]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Angular.Maven [img-angular-maven-nosql]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Angular.Maven.NoSQL [img-angular-gradle]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Angular.Gradle @@ -74,6 +80,10 @@ Additional builds at [hipster-labs/jhipster-daily-builds](https://github.com/hip [img-ms-jwt]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Microservices.JWT [img-ms-oauth2]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Microservices.OAuth2 [img-ms-uaa]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Microservices.UAA +[img-monolith-oauth2]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Monolith.OAuth2 +[img-official-openjdk8]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Official.OpenJDK8 +[img-yarn]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/Yarn +[img-nodatabase]: https://dev.azure.com/hipster-labs/jhipster-daily-builds/_apis/build/status/NoDatabase [sonar-url]: https://sonarcloud.io/dashboard?id=io.github.jhipster.sample%3Ajhipster-sample-application [sonar-quality-gate]: https://sonarcloud.io/api/project_badges/measure?project=io.github.jhipster.sample%3Ajhipster-sample-application&metric=alert_status [sonar-coverage]: https://sonarcloud.io/api/project_badges/measure?project=io.github.jhipster.sample%3Ajhipster-sample-application&metric=coverage From 722f6613a25d7b93a3f8985520e7e4acaabc4ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Wed, 5 Jun 2019 11:57:35 +0200 Subject: [PATCH 102/298] remove pagination with cassandra in react --- .../user-management.reducer.ts.ejs | 4 +- .../user-management/user-management.tsx.ejs | 30 +++++++------ .../webapp/app/entities/entity.reducer.ts.ejs | 17 ++++--- .../main/webapp/app/entities/entity.tsx.ejs | 44 ++++++++++--------- 4 files changed, 52 insertions(+), 43 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs index f654b90be7a8..f846a6fcc69d 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.reducer.ts.ejs @@ -92,7 +92,9 @@ export default (state: UserManagementState = initialState, action): UserManageme ...state, loading: false, users: action.payload.data, - totalItems: parseInt(action.payload.headers['x-total-count'], 10) + <%_ if (databaseType !== 'cassandra') { _%> + totalItems: parseInt(action.payload.headers['x-total-count'], 10) + <%_ } _%> }; case SUCCESS(ACTION_TYPES.FETCH_USER): return { diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs index bab0a717a570..aa98a055616e 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs @@ -177,20 +177,22 @@ export class UserManagement extends React.Component -
0 ? '' : 'd-none' }> - - - - - - -
+ <%_ if (databaseType !== 'cassandra') { _%> +
0 ? '' : 'd-none' }> + + + + + + +
+ <%_ } _%>
); } diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs index 92f2ff8ff3f9..d077995c9817 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs @@ -119,19 +119,22 @@ export default (state: <%= entityReactName %>State = initialState, action): <%= <%_ if (pagination === 'infinite-scroll') { _%> const links = parseHeaderForLinks(action.payload.headers.link); <%_ } _%> + return { ...state, + loading: false, <%_ if (pagination === 'infinite-scroll') { _%> + <%_ if (databaseType !== 'cassandra') { _%> links, + entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links), + <%_ } _%> + <%_ } else { _%> + entities: action.payload.data, <%_ } _%> - loading: false, <%_ if (pagination !== 'no') { _%> - totalItems: parseInt(action.payload.headers['x-total-count'], 10), - <%_ } _%> - <%_ if (pagination === 'infinite-scroll') { _%> - entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links) - <%_ } else { _%> - entities: action.payload.data + <%_ if (databaseType !== 'cassandra') { _%> + totalItems: parseInt(action.payload.headers['x-total-count'], 10) + <%_ } _%> <%_ } _%> }; case SUCCESS(ACTION_TYPES.FETCH_<%= entityActionName %>): diff --git a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs index 1cfc622a56d1..929616331747 100644 --- a/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +++ b/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs @@ -385,27 +385,29 @@ export class <%= entityReactName %> extends React.Component <%_ } _%>
- <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> -
List && <%= entityInstance %>List.length > 0 ? '' : 'd-none' }> - - i18nEnabled<% }}%> - /> - - - - -
- <% } _%> + <%_ if (databaseType !== 'cassandra') { _%> + <%_ if (pagination === 'pagination' || pagination === 'pager') { _%> +
List && <%= entityInstance %>List.length > 0 ? '' : 'd-none' }> + + i18nEnabled<% }}%> + /> + + + + +
+ <% } _%> + <%_ } _%>
); } From d13bf9d71bb64937979840ca9efd8ad8708ae9da Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 5 Jun 2019 17:58:42 +0530 Subject: [PATCH 103/298] Minor fix avoid side effects by reverting the change made to logger.error() --- cli/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/utils.js b/cli/utils.js index d18d64ef7f15..2cd457e59887 100644 --- a/cli/utils.js +++ b/cli/utils.js @@ -46,7 +46,7 @@ const error = function(msg, trace) { if (trace) { console.log(trace); } - return; // eslint-disable-line + process.exit(1); }; const init = function(program) { @@ -88,7 +88,7 @@ const initHelp = (program, cliName) => { }); program.on('command:*', name => { - logger.error(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); + console.log(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); const cmd = Object.values(name).join(''); const availableCommands = program.commands.map(cmd => { From 8d34cc6e6fc4ab40f80c7f2466fac72b56bb8975 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 5 Jun 2019 18:04:51 +0530 Subject: [PATCH 104/298] refactor --- cli/utils.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/utils.js b/cli/utils.js index 2cd457e59887..56c27215b12d 100644 --- a/cli/utils.js +++ b/cli/utils.js @@ -91,9 +91,7 @@ const initHelp = (program, cliName) => { console.log(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); const cmd = Object.values(name).join(''); - const availableCommands = program.commands.map(cmd => { - return cmd._name; - }); + const availableCommands = program.commands.map(c => c._name); const suggestion = didYouMean(cmd, availableCommands); if (suggestion) { From d374351ba78c7a8d10aefedf84e6fca2dc89478f Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 5 Jun 2019 18:41:56 +0530 Subject: [PATCH 105/298] Minor fix --- cli/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/utils.js b/cli/utils.js index 56c27215b12d..719ea0b2ca81 100644 --- a/cli/utils.js +++ b/cli/utils.js @@ -88,7 +88,7 @@ const initHelp = (program, cliName) => { }); program.on('command:*', name => { - console.log(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); + console.error(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); const cmd = Object.values(name).join(''); const availableCommands = program.commands.map(c => c._name); From b734c43e2189b29d8fe9e30d10797443b552e3bf Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Wed, 5 Jun 2019 18:50:34 +0530 Subject: [PATCH 106/298] refactor --- cli/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/utils.js b/cli/utils.js index 719ea0b2ca81..a5d579404f78 100644 --- a/cli/utils.js +++ b/cli/utils.js @@ -88,7 +88,7 @@ const initHelp = (program, cliName) => { }); program.on('command:*', name => { - console.error(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`); + console.error(chalk.red(`${chalk.yellow(name)} is not a known command. See '${chalk.white(`${cliName} --help`)}'.`)); const cmd = Object.values(name).join(''); const availableCommands = program.commands.map(c => c._name); From 172c487dd203b7083d9fda0f94cdaecc0ee1470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Thu, 6 Jun 2019 11:35:52 +0200 Subject: [PATCH 107/298] fix user-management tests with react and cassandra --- .../user-management/user-management.reducer.spec.ts.ejs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generators/client/templates/react/src/test/javascript/spec/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs b/generators/client/templates/react/src/test/javascript/spec/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs index 8136098c6de6..a605b13ac2ef 100644 --- a/generators/client/templates/react/src/test/javascript/spec/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs +++ b/generators/client/templates/react/src/test/javascript/spec/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs @@ -126,14 +126,20 @@ describe('User management reducer tests', () => { describe('Success', () => { it('should update state according to a successful fetch users request', () => { + <%_ if (databaseType !== 'cassandra') { _%> const headers = { ['x-total-count']: 42 }; const payload = { data: 'some handsome users', headers }; + <%_ } else { _%> + const payload = { data: 'some handsome users' }; + <%_ } _%> const toTest = userManagement(undefined, { type: SUCCESS(ACTION_TYPES.FETCH_USERS), payload }); expect(toTest).toMatchObject({ loading: false, users: payload.data, + <%_ if (databaseType !== 'cassandra') { _%> totalItems: headers['x-total-count'] + <%_ } _%> }); }); From ec8f28febddd1bf29a8c0513b883cae6bb4e5c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Thu, 6 Jun 2019 14:35:17 +0200 Subject: [PATCH 108/298] removed rate limiting feature for gateways when not using hazelcast --- generators/server/files.js | 14 ++++++++++---- .../package/config/GatewayConfiguration.java.ejs | 5 ++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/generators/server/files.js b/generators/server/files.js index 357b491022a2..feb467c5892f 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -503,10 +503,6 @@ const serverFiles = { file: 'package/config/apidoc/GatewaySwaggerResourcesProvider.java', renameTo: generator => `${generator.javaDir}config/apidoc/GatewaySwaggerResourcesProvider.java` }, - { - file: 'package/gateway/ratelimiting/RateLimitingFilter.java', - renameTo: generator => `${generator.javaDir}gateway/ratelimiting/RateLimitingFilter.java` - }, { file: 'package/gateway/accesscontrol/AccessControlFilter.java', renameTo: generator => `${generator.javaDir}gateway/accesscontrol/AccessControlFilter.java` @@ -522,6 +518,16 @@ const serverFiles = { } ] }, + { + condition: generator => generator.applicationType === 'gateway' && generator.serviceDiscoveryType && generator.cacheProvider === 'hazelcast', + path: SERVER_MAIN_SRC_DIR, + templates: [ + { + file: 'package/gateway/ratelimiting/RateLimitingFilter.java', + renameTo: generator => `${generator.javaDir}gateway/ratelimiting/RateLimitingFilter.java` + } + ] + }, { condition: generator => generator.applicationType === 'gateway' && generator.authenticationType === 'jwt' && generator.serviceDiscoveryType, diff --git a/generators/server/templates/src/main/java/package/config/GatewayConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/GatewayConfiguration.java.ejs index 14065298b70a..da4faa101ca7 100644 --- a/generators/server/templates/src/main/java/package/config/GatewayConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/GatewayConfiguration.java.ejs @@ -20,7 +20,9 @@ package <%=packageName%>.config; import io.github.jhipster.config.JHipsterProperties; +<%_ if (cacheProvider === 'hazelcast') { _%> import <%=packageName%>.gateway.ratelimiting.RateLimitingFilter; +<%_ } _%> import <%=packageName%>.gateway.accesscontrol.AccessControlFilter; import <%=packageName%>.gateway.responserewriting.SwaggerBasePathRewritingFilter; @@ -64,10 +66,11 @@ public class GatewayConfiguration { public RateLimitingConfiguration(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } - + <%_ if (cacheProvider === 'hazelcast') { _%> @Bean public RateLimitingFilter rateLimitingFilter() { return new RateLimitingFilter(jHipsterProperties); } + <%_ } _%> } } From 83c535213833d6ccd55040e459f3bdb946b9019e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Thu, 6 Jun 2019 15:01:04 +0200 Subject: [PATCH 109/298] fixed linting for generator-jhipster --- generators/server/files.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generators/server/files.js b/generators/server/files.js index feb467c5892f..0d4a4dd4fc62 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -519,7 +519,8 @@ const serverFiles = { ] }, { - condition: generator => generator.applicationType === 'gateway' && generator.serviceDiscoveryType && generator.cacheProvider === 'hazelcast', + condition: generator => + generator.applicationType === 'gateway' && generator.serviceDiscoveryType && generator.cacheProvider === 'hazelcast', path: SERVER_MAIN_SRC_DIR, templates: [ { From f8f84193e9af6b8ce863bd13dae3fe0bfadfc9a9 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 6 Jun 2019 19:41:04 +0530 Subject: [PATCH 110/298] Bump ngx-webstorage to fix peer warnings during install --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index d7ca08b37f61..ef0e70ac3fd6 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -49,7 +49,7 @@ "ng-jhipster": "0.10.1", "ngx-cookie": "4.0.2", "ngx-infinite-scroll": "7.1.0", - "ngx-webstorage": "4.0.0", + "ngx-webstorage": "4.0.1", "rxjs": "6.5.2", "swagger-ui": "2.2.10", <%_ if (websocket === 'spring-websocket') { _%> From 4ffb02045016b5a4086a6cef7d799ef4d7b8aba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Thu, 6 Jun 2019 16:21:45 +0200 Subject: [PATCH 111/298] adapted travis tests --- test/app.spec.js | 80 ++++++++++++++++++++++++++++++++++++ test/utils/expected-files.js | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/test/app.spec.js b/test/app.spec.js index 835ce0907997..c63c4af8efaa 100644 --- a/test/app.spec.js +++ b/test/app.spec.js @@ -1549,6 +1549,45 @@ describe('JHipster generator', () => { it('creates expected files with the gateway application type', () => { assert.file(expectedFiles.jwtServer); assert.file(expectedFiles.gateway); + assert.noFile(expectedFiles.rateLimitingFilesForGateways); + assert.file(expectedFiles.feignConfig); + assert.file(expectedFiles.eureka); + assert.noFile(expectedFiles.consul); + }); + }); + + describe('gateway with eureka and rate limiting', () => { + before(done => { + helpers + .run(path.join(__dirname, '../generators/app')) + .withOptions({ 'from-cli': true, skipInstall: true, skipChecks: true }) + .withPrompts({ + applicationType: 'gateway', + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + clientFramework: 'angularX', + serviceDiscoveryType: 'eureka', + authenticationType: 'jwt', + cacheProvider: 'hazelcast', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); + + it('creates expected files with the gateway application type', () => { + assert.file(expectedFiles.jwtServer); + assert.file(expectedFiles.gateway); + assert.file(expectedFiles.rateLimitingFilesForGateways); assert.file(expectedFiles.feignConfig); assert.file(expectedFiles.eureka); assert.noFile(expectedFiles.consul); @@ -1740,6 +1779,7 @@ describe('JHipster generator', () => { it('creates expected files for UAA auth with the Gateway application type', () => { assert.file(expectedFiles.gateway); + assert.file(expectedFiles.rateLimitingFilesForGateways); assert.file(expectedFiles.gatewayWithUaa); assert.file(expectedFiles.dockerServices); assert.file(expectedFiles.eureka); @@ -1780,6 +1820,44 @@ describe('JHipster generator', () => { it('creates expected files with the gateway application type', () => { assert.file(expectedFiles.jwtServer); assert.file(expectedFiles.gateway); + assert.noFile(expectedFiles.rateLimitingFilesForGateways); + assert.noFile(expectedFiles.eureka); + assert.file(expectedFiles.consul); + }); + }); + + describe('gateway with consul and rate limiting', () => { + before(done => { + helpers + .run(path.join(__dirname, '../generators/app')) + .withOptions({ 'from-cli': true, skipInstall: true, skipChecks: true }) + .withPrompts({ + applicationType: 'gateway', + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + clientFramework: 'angularX', + serviceDiscoveryType: 'consul', + authenticationType: 'jwt', + cacheProvider: 'hazelcast', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); + + it('creates expected files with the gateway application type', () => { + assert.file(expectedFiles.jwtServer); + assert.file(expectedFiles.gateway); + assert.file(expectedFiles.rateLimitingFilesForGateways); assert.noFile(expectedFiles.eureka); assert.file(expectedFiles.consul); }); @@ -1854,6 +1932,7 @@ describe('JHipster generator', () => { it('creates expected files with the gateway application type', () => { assert.file(expectedFiles.jwtServer); assert.noFile(expectedFiles.gateway); + assert.noFile(expectedFiles.rateLimitingFilesForGateways); assert.noFile(expectedFiles.eureka); assert.noFile(expectedFiles.consul); }); @@ -1891,6 +1970,7 @@ describe('JHipster generator', () => { it('creates expected files with the gateway application type', () => { assert.file(expectedFiles.gatewayWithUaa); assert.noFile(expectedFiles.gateway); + assert.noFile(expectedFiles.rateLimitingFilesForGateways); assert.noFile(expectedFiles.eureka); assert.noFile(expectedFiles.consul); }); diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index 20f8ee1021b1..62e44b09118e 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -601,7 +601,6 @@ const expectedFiles = { `${SERVER_TEST_RES_DIR}config/bootstrap.yml`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/GatewayConfiguration.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/apidoc/GatewaySwaggerResourcesProvider.java`, - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/gateway/ratelimiting/RateLimitingFilter.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/gateway/accesscontrol/AccessControlFilter.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/gateway/responserewriting/SwaggerBasePathRewritingFilter.java`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java`, @@ -613,6 +612,8 @@ const expectedFiles = { `${CLIENT_MAIN_SRC_DIR}app/admin/gateway/gateway-routes.service.ts` ], + rateLimitingFilesForGateways: [`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/gateway/ratelimiting/RateLimitingFilter.java`], + gatewayWithUaa: [ `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/AuthResource.java`, From ddd3d02a22eaaf6cd0c29544d7fd9a23f24caea2 Mon Sep 17 00:00:00 2001 From: Frederik Hahne Date: Fri, 31 May 2019 22:58:12 +0200 Subject: [PATCH 112/298] improve security headers by setting conten-security and feature policy and deny embedding in an iFrame closes #9549 --- .../java/package/config/SecurityConfiguration.java.ejs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 48ca959db3c1..ed677d293824 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -88,6 +88,7 @@ import org.springframework.security.web.csrf.CsrfFilter; <%_ if (authenticationType === 'jwt' && applicationType !== 'microservice') { _%> import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; <%_ } _%> +import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter; <%_ if (applicationType !== 'microservice') { _%> import org.springframework.web.filter.CorsFilter; <%_ } _%> @@ -223,8 +224,14 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> .and() .headers() + .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'") + .and() + .referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN) + .and() + .featurePolicy("geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; fullscreen 'self'; payment 'none'") + .and() .frameOptions() - .disable() + .deny() .and() <%_ if (authenticationType === 'jwt' || (authenticationType === 'oauth2' && applicationType === 'microservice')) { _%> .sessionManagement() From 6ed18d7835a4308cc8c6dc6770eb4909cfb74e17 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Fri, 7 Jun 2019 21:00:54 +0530 Subject: [PATCH 113/298] Map authorities from access token claim --- .../realm-config/jhipster-realm.json.ejs | 1 + .../realm-config/jhipster-realm.json.ejs | 1 + .../config/SecurityConfiguration.java.ejs | 65 +++++++++++++------ 3 files changed, 48 insertions(+), 19 deletions(-) diff --git a/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs b/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs index 4098b3e1f329..bedd153de023 100644 --- a/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +++ b/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs @@ -989,6 +989,7 @@ "protocolMapper": "oidc-usermodel-realm-role-mapper", "consentRequired": false, "config": { + "access.token.claim": "true", "claim.name": "roles", "jsonType.label": "String", "multivalued": "true", diff --git a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs index 151bd603894f..8e2a564b291d 100644 --- a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +++ b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs @@ -984,6 +984,7 @@ "protocolMapper": "oidc-usermodel-realm-role-mapper", "consentRequired": false, "config": { + "access.token.claim": "true", "claim.name": "roles", "jsonType.label": "String", "multivalued": "true", diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index ed677d293824..df904bf89f61 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -55,10 +55,13 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; <%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> +import org.springframework.core.convert.converter.Converter; +import org.springframework.security.authentication.AbstractAuthenticationToken; import <%= packageName %>.security.oauth2.AudienceValidator; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jwt.*; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; <%_ if (applicationType === 'gateway') { _%> import <%=packageName%>.security.oauth2.AuthorizationHeaderFilter; import <%=packageName%>.security.oauth2.AuthorizationHeaderUtil; @@ -66,12 +69,11 @@ import <%=packageName%>.security.oauth2.AuthorizationHeaderUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; +<%_ if (applicationType !== 'microservice') { _%> import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; -import org.springframework.security.oauth2.core.oidc.OidcUserInfo; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; +<%_ } _%> +import java.util.*; import java.util.stream.Collectors; <%_ } _%> <%_ if (authenticationType === 'session') { _%> @@ -273,7 +275,9 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .oauth2Login() <%_ } _%> .and() - .oauth2ResourceServer().jwt(); + .oauth2ResourceServer() + .jwt() + .jwtAuthenticationConverter(mapGroupOrRolesClaimToGrantedAuthorities()); <%_ } _%> // @formatter:on } @@ -285,34 +289,57 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> + <%_ if (applicationType !== 'microservice') { _%> /** - * Map authorities from "groups" or "roles" claim in ID Token. - * - * @return a {@link GrantedAuthoritiesMapper} that maps groups from - * the IdP to Spring Security Authorities. - */ + * Map authorities from "groups" or "roles" claim in ID Token. + * + * @return a {@link GrantedAuthoritiesMapper} that maps groups from + * the IdP to Spring Security Authorities. + */ @Bean - @SuppressWarnings("unchecked") public GrantedAuthoritiesMapper userAuthoritiesMapper() { return (authorities) -> { Set mappedAuthorities = new HashSet<>(); authorities.forEach(authority -> { OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority; - OidcUserInfo userInfo = oidcUserAuthority.getUserInfo(); - Collection groups = (Collection) userInfo.getClaims().get("groups"); - if (groups == null) { - groups = (Collection) userInfo.getClaims().get("roles"); - } - mappedAuthorities.addAll(groups.stream() - .filter(group -> group.startsWith("ROLE_")) - .map(SimpleGrantedAuthority::new).collect(Collectors.toList())); + mappedAuthorities.addAll(mapRolesToGrantedAuthorities( + getRolesFromClaims(oidcUserAuthority.getUserInfo().getClaims()))); }); return mappedAuthorities; }; } + <%_ } _%> + private Converter mapGroupOrRolesClaimToGrantedAuthorities() { + return new JwtAuthenticationConverter() { + @Override + protected Collection extractAuthorities(Jwt jwt) { + return mapRolesToGrantedAuthorities( + getRolesFromClaims(jwt.getClaims()) + ); + } + }; + } + + @SuppressWarnings("unchecked") + private Collection getRolesFromClaims(Map claims) { + return (Collection) claims.getOrDefault( + "groups", + claims.getOrDefault( + "roles", + new ArrayList<>() + ) + ); + } + + private List mapRolesToGrantedAuthorities(Collection roles) { + return roles.stream() + .filter(role -> role.startsWith("ROLE_")) + .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); + } + @Bean JwtDecoder jwtDecoder() { NimbusJwtDecoderJwkSupport jwtDecoder = (NimbusJwtDecoderJwkSupport) From c2839950fb6c5e130fbed12dbb0a39fed0f6c6bc Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Fri, 7 Jun 2019 21:11:44 +0530 Subject: [PATCH 114/298] Reformat method code and fix comment indentation --- .../config/SecurityConfiguration.java.ejs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index df904bf89f61..9c0da75921ce 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -291,11 +291,11 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ if (applicationType !== 'microservice') { _%> /** - * Map authorities from "groups" or "roles" claim in ID Token. - * - * @return a {@link GrantedAuthoritiesMapper} that maps groups from - * the IdP to Spring Security Authorities. - */ + * Map authorities from "groups" or "roles" claim in ID Token. + * + * @return a {@link GrantedAuthoritiesMapper} that maps groups from + * the IdP to Spring Security Authorities. + */ @Bean public GrantedAuthoritiesMapper userAuthoritiesMapper() { return (authorities) -> { @@ -325,13 +325,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @SuppressWarnings("unchecked") private Collection getRolesFromClaims(Map claims) { - return (Collection) claims.getOrDefault( - "groups", - claims.getOrDefault( - "roles", - new ArrayList<>() - ) - ); + return (Collection) claims.getOrDefault("groups", + claims.getOrDefault("roles", new ArrayList<>())); } private List mapRolesToGrantedAuthorities(Collection roles) { From 48e11ee92233a21db9231b67c078f29e5f1aca35 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Fri, 7 Jun 2019 15:08:54 -0600 Subject: [PATCH 115/298] Upgrade Axios to fix vulnerability --- generators/client/templates/react/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json.ejs b/generators/client/templates/react/package.json.ejs index 641c12ef1666..5917013599c1 100644 --- a/generators/client/templates/react/package.json.ejs +++ b/generators/client/templates/react/package.json.ejs @@ -31,7 +31,7 @@ limitations under the License. "@fortawesome/free-solid-svg-icons": "5.8.1", "@fortawesome/react-fontawesome": "0.1.4", "availity-reactstrap-validation": "2.5.1", - "axios": "0.18.0", + "axios": "0.19.0", "bootstrap": "4.3.1", <%_ if (clientTheme !== 'none') { _%> "bootswatch": "4.3.1", From fa90a1b9226c821361588bf07397b5924df11b9a Mon Sep 17 00:00:00 2001 From: deepu105 Date: Sat, 8 Jun 2019 13:39:15 +0200 Subject: [PATCH 116/298] cli: remove skip-git for entities --- cli/import-jdl.js | 9 +++------ test/cli/import-jdl.spec.js | 14 +------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/cli/import-jdl.js b/cli/import-jdl.js index e04c77d2e557..d3c851f4a835 100644 --- a/cli/import-jdl.js +++ b/cli/import-jdl.js @@ -268,12 +268,6 @@ class JDLProcessor { getConfig() { if (jhiCore.FileUtils.doesFileExist('.yo-rc.json')) { logger.info('Found .yo-rc.json on path. This is an existing app'); - if (!Object.prototype.hasOwnProperty.call(this.options, 'interactive')) { - this.options.interactive = true; - } - if (!Object.prototype.hasOwnProperty.call(this.options, 'skip-git')) { - this.options['skip-git'] = true; - } const configuration = jhipsterUtils.getAllJhipsterConfig(null, true); this.applicationType = configuration.applicationType; this.baseName = configuration.baseName; @@ -411,6 +405,9 @@ class JDLProcessor { logger.info('Entity JSON files created. Entity generation skipped.'); return; } + if (_.isUndefined(this.options.interactive)) { + this.options.interactive = true; + } try { logger.info( `Generating ${this.importState.exportedEntities.length} ` + diff --git a/test/cli/import-jdl.spec.js b/test/cli/import-jdl.spec.js index 49713d510f25..dc735e7d733f 100644 --- a/test/cli/import-jdl.spec.js +++ b/test/cli/import-jdl.spec.js @@ -60,7 +60,6 @@ function testDocumentsRelationships() { interactive: true, 'from-cli': true, 'no-fluent-methods': undefined, - 'skip-git': true, 'skip-client': undefined, 'skip-install': true, 'skip-server': undefined, @@ -104,18 +103,10 @@ describe('JHipster generator import jdl', () => { '--skip-install', '--no-insight', '--interactive', - '--skip-git', '--with-entities', '--from-cli' ]); - expect(subGenCallParams.options[3]).to.eql([ - '--skip-prompts', - '--skip-install', - '--no-insight', - '--interactive', - '--skip-git', - '--from-cli' - ]); + expect(subGenCallParams.options[3]).to.eql(['--skip-prompts', '--skip-install', '--no-insight', '--interactive', '--from-cli']); }); }); describe('imports a JDL entity model with relations for mongodb', () => { @@ -208,7 +199,6 @@ describe('JHipster generator import jdl', () => { interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, - 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -267,7 +257,6 @@ describe('JHipster generator import jdl', () => { interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, - 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, @@ -299,7 +288,6 @@ describe('JHipster generator import jdl', () => { interactive: true, 'no-fluent-methods': undefined, 'skip-client': undefined, - 'skip-git': true, 'skip-install': true, 'skip-server': undefined, 'skip-ui-grouping': undefined, From efd3cce67d56cd5d2ab6197e5ecaf4d33de588a9 Mon Sep 17 00:00:00 2001 From: deepu105 Date: Sat, 8 Jun 2019 14:04:06 +0200 Subject: [PATCH 117/298] cli: fix force on entity only generation --- cli/import-jdl.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/import-jdl.js b/cli/import-jdl.js index d3c851f4a835..4cf045d5ac16 100644 --- a/cli/import-jdl.js +++ b/cli/import-jdl.js @@ -225,7 +225,7 @@ const generateEntityFiles = (generator, entity, inFolder, env, shouldTriggerInst command, { ...options, - force: !options.interactive, + force: options.force || !options.interactive, 'skip-install': !shouldTriggerInstall }, done @@ -269,6 +269,10 @@ class JDLProcessor { if (jhiCore.FileUtils.doesFileExist('.yo-rc.json')) { logger.info('Found .yo-rc.json on path. This is an existing app'); const configuration = jhipsterUtils.getAllJhipsterConfig(null, true); + if (_.isUndefined(this.options.interactive)) { + logger.debug('Setting interactive true for existing apps'); + this.options.interactive = true; + } this.applicationType = configuration.applicationType; this.baseName = configuration.baseName; this.databaseType = configuration.databaseType || jhipsterUtils.getDBTypeFromDBValue(this.options.db); @@ -405,9 +409,6 @@ class JDLProcessor { logger.info('Entity JSON files created. Entity generation skipped.'); return; } - if (_.isUndefined(this.options.interactive)) { - this.options.interactive = true; - } try { logger.info( `Generating ${this.importState.exportedEntities.length} ` + From 3b1aae16588d931280ee72e266fffcf9a1592072 Mon Sep 17 00:00:00 2001 From: deepu105 Date: Sat, 8 Jun 2019 14:37:31 +0200 Subject: [PATCH 118/298] cli: cleanup tests --- test/cli/import-jdl.spec.js | 60 ++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/test/cli/import-jdl.spec.js b/test/cli/import-jdl.spec.js index dc735e7d733f..76f28ce322e4 100644 --- a/test/cli/import-jdl.spec.js +++ b/test/cli/import-jdl.spec.js @@ -109,30 +109,6 @@ describe('JHipster generator import jdl', () => { expect(subGenCallParams.options[3]).to.eql(['--skip-prompts', '--skip-install', '--no-insight', '--interactive', '--from-cli']); }); }); - describe('imports a JDL entity model with relations for mongodb', () => { - beforeEach(done => { - testInTempDir(dir => { - fse.copySync(path.join(__dirname, '../templates/documents-with-relations'), dir); - fse.copySync(path.join(__dirname, '../templates/mongodb-with-relations'), dir); - importJdl(['orders-model.jdl'], {}, env); - done(); - }); - }); - - testDocumentsRelationships(); - }); - describe('imports a JDL entity model with relations for couchbase', () => { - beforeEach(done => { - testInTempDir(dir => { - fse.copySync(path.join(__dirname, '../templates/documents-with-relations'), dir); - fse.copySync(path.join(__dirname, '../templates/couchbase-with-relations'), dir); - importJdl(['orders-model.jdl'], {}, env); - done(); - }); - }); - - testDocumentsRelationships(); - }); describe('imports a JDL entity model from single file with --json-only flag', () => { beforeEach(done => { @@ -159,6 +135,7 @@ describe('JHipster generator import jdl', () => { expect(subGenCallParams.count).to.equal(0); }); }); + describe('imports a JDL entity model from single file', () => { beforeEach(done => { testInTempDir(dir => { @@ -206,6 +183,7 @@ describe('JHipster generator import jdl', () => { }); }); }); + describe('imports a JDL entity model from multiple files', () => { beforeEach(done => { testInTempDir(dir => { @@ -264,6 +242,7 @@ describe('JHipster generator import jdl', () => { }); }); }); + describe('imports a JDL entity model which excludes Elasticsearch for a class', () => { beforeEach(done => { testInTempDir(dir => { @@ -295,6 +274,7 @@ describe('JHipster generator import jdl', () => { }); }); }); + describe('imports single app and entities', () => { beforeEach(done => { testInTempDir(dir => { @@ -328,6 +308,7 @@ describe('JHipster generator import jdl', () => { ]); }); }); + describe('imports single app only', () => { beforeEach(done => { testInTempDir(dir => { @@ -357,6 +338,7 @@ describe('JHipster generator import jdl', () => { ]); }); }); + describe('imports multiple JDL apps and entities', () => { beforeEach(done => { testInTempDir(dir => { @@ -401,6 +383,7 @@ describe('JHipster generator import jdl', () => { ]); }); }); + describe('skips JDL apps with --ignore-application', () => { beforeEach(done => { testInTempDir(dir => { @@ -452,6 +435,7 @@ describe('JHipster generator import jdl', () => { ]); }); }); + describe('imports JDL deployments only', () => { beforeEach(done => { testInTempDir(dir => { @@ -481,6 +465,7 @@ describe('JHipster generator import jdl', () => { ]); }); }); + describe('imports multiple JDL apps, deployments and entities', () => { describe('calls generators', () => { beforeEach(done => { @@ -553,6 +538,7 @@ describe('JHipster generator import jdl', () => { }); }); }); + describe('skips JDL deployments with --skip-deployments flag', () => { beforeEach(done => { testInTempDir(dir => { @@ -580,4 +566,30 @@ describe('JHipster generator import jdl', () => { ]); }); }); + + describe('imports a JDL entity model with relations for mongodb', () => { + beforeEach(done => { + testInTempDir(dir => { + fse.copySync(path.join(__dirname, '../templates/documents-with-relations'), dir); + fse.copySync(path.join(__dirname, '../templates/mongodb-with-relations'), dir); + importJdl(['orders-model.jdl'], {}, env); + done(); + }); + }); + + testDocumentsRelationships(); + }); + + describe('imports a JDL entity model with relations for couchbase', () => { + beforeEach(done => { + testInTempDir(dir => { + fse.copySync(path.join(__dirname, '../templates/documents-with-relations'), dir); + fse.copySync(path.join(__dirname, '../templates/couchbase-with-relations'), dir); + importJdl(['orders-model.jdl'], {}, env); + done(); + }); + }); + + testDocumentsRelationships(); + }); }); From 0b5a909e41a12ac8502318496ef7341e63827f79 Mon Sep 17 00:00:00 2001 From: deepu105 Date: Sat, 8 Jun 2019 15:18:12 +0200 Subject: [PATCH 119/298] cli: better test setup --- test/cli/import-jdl.spec.js | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/cli/import-jdl.spec.js b/test/cli/import-jdl.spec.js index 76f28ce322e4..f8f1416a68b8 100644 --- a/test/cli/import-jdl.spec.js +++ b/test/cli/import-jdl.spec.js @@ -2,6 +2,7 @@ const path = require('path'); const fse = require('fs-extra'); const assert = require('yeoman-assert'); const expect = require('chai').expect; +const shelljs = require('shelljs'); const importJdl = require('../../cli/import-jdl'); const { testInTempDir } = require('../utils/utils'); @@ -82,6 +83,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['apps-and-entities-and-deployments.jdl'], { skipInstall: true, noInsight: true, interactive: true }, @@ -279,6 +281,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['single-app-and-entities.jdl'], { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, @@ -309,10 +312,41 @@ describe('JHipster generator import jdl', () => { }); }); + // describe('imports single app and entities in non interactive mode when application exists', () => { + // beforeEach(done => { + // testInTempDir(dir => { + // fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + // importJdl( + // ['single-app-and-entities.jdl'], + // { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + // env, + // mockFork(done, 1) + // ); + // }); + // }); + + // it('calls application generator', () => { + // assert.file([path.join('.jhipster', 'A.json'), path.join('.jhipster', 'B.json')]); + // assert.file(['.yo-rc.json']); + // expect(subGenCallParams.count).to.equal(1); + // expect(subGenCallParams.commands).to.eql(['jhipster:app']); + // expect(subGenCallParams.options[0]).to.eql([ + // '--skip-install', + // '--no-insight', + // '--no-interactive', + // '--no-skip-git', + // '--with-entities', + // '--force', + // '--from-cli' + // ]); + // }); + // }); + describe('imports single app only', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['single-app-only.jdl'], { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, @@ -343,6 +377,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['apps-and-entities.jdl'], { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, @@ -388,6 +423,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['apps-and-entities.jdl'], { skipInstall: true, 'ignore-application': true, interactive: false, 'skip-git': false }, @@ -471,6 +507,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['apps-and-entities-and-deployments.jdl'], { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, @@ -512,6 +549,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl(['apps-and-entities-and-deployments.jdl'], { skipInstall: true }, env, mockFork()); done(); }); @@ -543,6 +581,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); + shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['apps-and-entities-and-deployments.jdl'], { skipInstall: true, noInsight: true, 'skip-deployments': true, interactive: false, 'skip-git': false }, From a183a8b73e3285f91ba589e80bbb427cc9a1dd7a Mon Sep 17 00:00:00 2001 From: deepu105 Date: Sat, 8 Jun 2019 15:56:00 +0200 Subject: [PATCH 120/298] cli: fix tests --- .vscode/launch.json | 14 +++++++++++++ test/cli/import-jdl.spec.js | 41 +++++-------------------------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8d3bb2934755..3d316e1927ef 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,20 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "node", + "request": "launch", + "name": "JHipster Mocha Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "--timeout", + "999999", + "--reporter", + "spec", + "${workspaceFolder}/test" + ], + "internalConsoleOptions": "openOnSessionStart" + }, { "type": "node", "request": "launch", diff --git a/test/cli/import-jdl.spec.js b/test/cli/import-jdl.spec.js index f8f1416a68b8..94c5d293727e 100644 --- a/test/cli/import-jdl.spec.js +++ b/test/cli/import-jdl.spec.js @@ -138,7 +138,7 @@ describe('JHipster generator import jdl', () => { }); }); - describe('imports a JDL entity model from single file', () => { + describe('imports a JDL entity model from single file in interactive mode by default', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); @@ -249,7 +249,7 @@ describe('JHipster generator import jdl', () => { beforeEach(done => { testInTempDir(dir => { fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - importJdl(['search.jdl'], { skipInstall: true }, env); + importJdl(['search.jdl'], { skipInstall: true, interactive: false }, env); done(); }); }); @@ -263,10 +263,10 @@ describe('JHipster generator import jdl', () => { expect(subGenCallParams.commands).to.eql(['jhipster:entity WithSearch', 'jhipster:entity WithoutSearch']); expect(subGenCallParams.options[0]).to.eql({ regenerate: true, - force: false, + force: true, skipInstall: true, 'from-cli': true, - interactive: true, + interactive: false, 'no-fluent-methods': undefined, 'skip-client': undefined, 'skip-install': true, @@ -284,7 +284,7 @@ describe('JHipster generator import jdl', () => { shelljs.rm(`${dir}/.yo-rc.json`); importJdl( ['single-app-and-entities.jdl'], - { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, + { skipInstall: true, noInsight: true, 'skip-git': false }, env, mockFork(done, 1) ); @@ -303,7 +303,6 @@ describe('JHipster generator import jdl', () => { expect(subGenCallParams.options[0]).to.eql([ '--skip-install', '--no-insight', - '--no-interactive', '--no-skip-git', '--with-entities', '--force', @@ -312,36 +311,6 @@ describe('JHipster generator import jdl', () => { }); }); - // describe('imports single app and entities in non interactive mode when application exists', () => { - // beforeEach(done => { - // testInTempDir(dir => { - // fse.copySync(path.join(__dirname, '../templates/import-jdl'), dir); - // importJdl( - // ['single-app-and-entities.jdl'], - // { skipInstall: true, noInsight: true, interactive: false, 'skip-git': false }, - // env, - // mockFork(done, 1) - // ); - // }); - // }); - - // it('calls application generator', () => { - // assert.file([path.join('.jhipster', 'A.json'), path.join('.jhipster', 'B.json')]); - // assert.file(['.yo-rc.json']); - // expect(subGenCallParams.count).to.equal(1); - // expect(subGenCallParams.commands).to.eql(['jhipster:app']); - // expect(subGenCallParams.options[0]).to.eql([ - // '--skip-install', - // '--no-insight', - // '--no-interactive', - // '--no-skip-git', - // '--with-entities', - // '--force', - // '--from-cli' - // ]); - // }); - // }); - describe('imports single app only', () => { beforeEach(done => { testInTempDir(dir => { From 6723331764e78bee8f0a2ca67663274ea41c73c0 Mon Sep 17 00:00:00 2001 From: "david.ngo" Date: Mon, 10 Jun 2019 18:38:28 +0800 Subject: [PATCH 121/298] Fix for the default CSS not loading on index.html --- .../client/templates/react/src/main/webapp/index.html.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/src/main/webapp/index.html.ejs b/generators/client/templates/react/src/main/webapp/index.html.ejs index a9ba2daff698..9c8d417ae512 100644 --- a/generators/client/templates/react/src/main/webapp/index.html.ejs +++ b/generators/client/templates/react/src/main/webapp/index.html.ejs @@ -29,7 +29,7 @@ - + From f5716efdce52c55274cef1cabaa6cc8340d4c72b Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Mon, 10 Jun 2019 10:05:10 -0600 Subject: [PATCH 122/298] Add AuthInfoResource for Ionic and React Native (#9878) * Add AuthInfoResource for Ionic and React Native * Rename file to match template convention * Add auth-info above /api/** so it doesn't require auth --- generators/server/files.js | 4 ++++ .../main/java/package/config/SecurityConfiguration.java.ejs | 2 +- .../rest/{AuthInfoResource.java => AuthInfoResource.java.ejs} | 0 3 files changed, 5 insertions(+), 1 deletion(-) rename generators/server/templates/src/main/java/package/web/rest/{AuthInfoResource.java => AuthInfoResource.java.ejs} (100%) diff --git a/generators/server/files.js b/generators/server/files.js index 357b491022a2..7c5ff9664435 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -594,6 +594,10 @@ const serverFiles = { (generator.applicationType === 'monolith' || generator.applicationType === 'gateway'), path: SERVER_MAIN_SRC_DIR, templates: [ + { + file: 'package/web/rest/AuthInfoResource.java', + renameTo: generator => `${generator.javaDir}web/rest/AuthInfoResource.java` + }, { file: 'package/web/rest/LogoutResource.java', renameTo: generator => `${generator.javaDir}web/rest/LogoutResource.java` diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 9c0da75921ce..a27c1fd4c867 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -250,10 +250,10 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .antMatchers("/api/account/reset-password/init").permitAll() .antMatchers("/api/account/reset-password/finish").permitAll() <%_ } _%> - .antMatchers("/api/**").authenticated() <%_ if (authenticationType === 'oauth2') { _%> .antMatchers("/api/auth-info").permitAll() <%_ } _%> + .antMatchers("/api/**").authenticated() <%_ if (websocket === 'spring-websocket') { _%> .antMatchers("/websocket/tracker").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/websocket/**").permitAll() diff --git a/generators/server/templates/src/main/java/package/web/rest/AuthInfoResource.java b/generators/server/templates/src/main/java/package/web/rest/AuthInfoResource.java.ejs similarity index 100% rename from generators/server/templates/src/main/java/package/web/rest/AuthInfoResource.java rename to generators/server/templates/src/main/java/package/web/rest/AuthInfoResource.java.ejs From 96502d8019d6d121e99aeec0730a5f37aae0cff2 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Mon, 10 Jun 2019 10:55:14 -0600 Subject: [PATCH 123/298] Add Ionic 4 redirect URIs --- .../templates/realm-config/jhipster-realm.json.ejs | 3 ++- .../main/docker/config/realm-config/jhipster-realm.json.ejs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs b/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs index bedd153de023..9f4c24761ce6 100644 --- a/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +++ b/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs @@ -823,7 +823,8 @@ <%- keycloakRedirectUris %> "http://localhost:8100/*", "http://127.0.0.1:8761/*", - "http://localhost:9000/*" + "http://localhost:9000/*", + "dev.localhost.ionic:*" ], "webOrigins": [ <%- keycloakRedirectUris %> diff --git a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs index 8e2a564b291d..93abe5e533a1 100644 --- a/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +++ b/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs @@ -823,7 +823,8 @@ "http://localhost:*", "https://localhost:*", "http://127.0.0.1:*", - "https://127.0.0.1:*" + "https://127.0.0.1:*", + "dev.localhost.ionic:*" ], "webOrigins": ["*"], "notBefore": 0, From 5c8a21e0c52ae7d13d96dfa2a85cdd14862fb422 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Mon, 10 Jun 2019 20:02:15 +0200 Subject: [PATCH 124/298] React: start to use Hooks(here useState) in header.tsx --- .../app/shared/layout/header/header.tsx.ejs | 79 ++++++++----------- 1 file changed, 35 insertions(+), 44 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs index 6b1a5869a206..6ab1dafbe89b 100644 --- a/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs @@ -18,7 +18,7 @@ -%> import './header.<%= styleSheetExt %>'; -import React from 'react'; +import React, { useState } from 'react'; import { Translate<% if (enableTranslation) { %>, Storage<% } %> } from 'react-jhipster'; import { Navbar, @@ -51,14 +51,9 @@ export interface IHeaderProps { <%_ } _%> } -export interface IHeaderState { - menuOpen: boolean -} -export default class Header extends React.Component { - state: IHeaderState = { - menuOpen: false - }; +const Header = (props: IHeaderProps) => { + const [menuOpen, setMenuOpen] = useState(false); <%_ if (enableI18nRTL) { _%> componentDidMount () { document.querySelector('html').setAttribute('dir', isRTL(Storage.session.get('locale')) ? 'rtl' : 'ltr'); @@ -66,21 +61,21 @@ export default class Header extends React.Component <%_ } _%> <%_ if (enableTranslation) { _%> - handleLocaleChange = event => { + const handleLocaleChange = event => { const langKey = event.target.value; Storage.session.set('locale', langKey); - this.props.onLocaleChange(langKey); + props.onLocaleChange(langKey); <%_ if (enableI18nRTL) { _%> document.querySelector('html').setAttribute('dir', isRTL(langKey) ? 'rtl' : 'ltr'); <%_ } _%> } <%_ } _%> - renderDevRibbon = () => this.props.isInProduction === false ? ( + const renderDevRibbon = () => props.isInProduction === false ? ( ) : null; - toggleMenu = () => { - this.setState({ menuOpen: !this.state.menuOpen }); - } + const toggleMenu = () => setMenuOpen(!menuOpen); + + /* jhipster-needle-add-element-to-menu - JHipster will add new menu items here */ + + return ( +
+ {renderDevRibbon()} + + dark<% } else { %>light<% } %> expand="sm" fixed="top" className="<%_ if (clientTheme === 'none') { _%>jh-navbar<%_ } else { _%>bg-<%= clientThemeVariant %><%_ } _%>"> + + + + + + +
+ ); +}; - render() { - const {<%_ if (enableTranslation) { _%>currentLocale,<%_ } _%> isAuthenticated, isAdmin, isSwaggerEnabled, isInProduction } = this.props; - - /* jhipster-needle-add-element-to-menu - JHipster will add new menu items here */ - - return ( -
- {this.renderDevRibbon()} - - dark<% } else { %>light<% } %> expand="sm" fixed="top" className="<%_ if (clientTheme === 'none') { _%>jh-navbar<%_ } else { _%>bg-<%= clientThemeVariant %><%_ } _%>"> - - - - - - -
- ); - } -} +export default Header; From 44fc219ce328ad7c1185d191a7994d6b2525b4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Tue, 19 Mar 2019 21:13:01 +0100 Subject: [PATCH 125/298] Support for UUID field type for SQL database in entity-server --- .../templates/src/main/java/package/domain/Entity.java.ejs | 4 ++-- .../src/main/java/package/service/dto/EntityDTO.java.ejs | 2 +- .../resources/config/liquibase/changelog/added_entity.xml.ejs | 2 ++ .../src/main/resources/config/liquibase/data/table.csv.ejs | 2 ++ .../src/test/java/package/web/rest/EntityResourceIT.java.ejs | 2 +- generators/entity/index.js | 4 ++++ test/templates/export-jdl/.jhipster/Employee.json | 4 ++++ test/templates/import-jdl/jdl.jdl | 1 + 8 files changed, 17 insertions(+), 4 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs index 395ead62d966..39bddb152407 100644 --- a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs @@ -32,7 +32,7 @@ const uniqueEnums = {}; %><%- include imports -%> break; } isUsingMapsId = false; - } + } for (idx in fields) { if ((prodDatabaseType === 'postgresql' || devDatabaseType === 'postgresql') && fields[idx].fieldTypeBlobContent === 'text') { hasTextBlob = true; @@ -106,7 +106,7 @@ import java.util.Objects; <%_ if (databaseType === 'couchbase' && hasRelationship) { _%> import java.util.stream.Collectors; <%_ } _%> -<%_ if (databaseType === 'cassandra') { _%> +<%_ if (databaseType === 'cassandra' || fieldsContainUUID === true) { _%> import java.util.UUID; <%_ } Object.keys(uniqueEnums).forEach(function(element) { _%> diff --git a/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs b/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs index 1ab8ce615b35..8107a8804b99 100644 --- a/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs @@ -55,7 +55,7 @@ import java.util.HashSet; import java.util.Set; <%_ } _%> import java.util.Objects; -<%_ if (databaseType === 'cassandra') { _%> +<%_ if (databaseType === 'cassandra' || fieldsContainUUID === true) { _%> import java.util.UUID; <%_ } _%> <%_ if (fieldsContainBlob && databaseType === 'sql') { _%> diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index ecf15cd1c806..4f74d29a141d 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -84,6 +84,8 @@ columnType="datetime"; } else if (fieldType === 'Duration') { columnType="bigint"; + } else if (fieldType === 'UUID') { + columnType="uuid"; } else if (fieldType === 'byte[]' && fieldTypeBlobContent !== 'text') { if (prodDatabaseType === 'mysql' || prodDatabaseType === 'postgresql' || prodDatabaseType === 'mariadb') { columnType="longblob"; diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs index d5d222f96736..c0813ef9ab10 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs @@ -82,6 +82,8 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) { max: fields[idx].fieldValidateRulesMax ? parseFloat(fields[idx].fieldValidateRulesMax) : undefined, min: fields[idx].fieldValidateRulesMin ? parseFloat(fields[idx].fieldValidateRulesMin) : undefined }); + } else if (columnType === 'uuid') { + data = this.faker.random.uuid(); } else if (columnType === 'boolean') { data = this.faker.random.boolean(); } else if (columnType === 'date' || columnType === 'datetime') { diff --git a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs index b03e1a95e753..0671bbe96061 100644 --- a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +++ b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs @@ -129,7 +129,7 @@ import java.util.ArrayList; import java.util.Collections; <%_ } _%> import java.util.List; -<%_ if (databaseType === 'cassandra') { _%> +<%_ if (databaseType === 'cassandra' || fieldsContainUUID === true) { _%> import java.util.UUID; <%_ } _%> <%_ if (databaseType === 'couchbase') { _%> diff --git a/generators/entity/index.js b/generators/entity/index.js index 6ee1deaf71d5..e840a8406f11 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -685,6 +685,7 @@ class EntityGenerator extends BaseBlueprintGenerator { context.fieldsContainDate = false; context.fieldsContainInstant = false; + context.fieldsContainUUID = false; context.fieldsContainZonedDateTime = false; context.fieldsContainDuration = false; context.fieldsContainLocalDate = false; @@ -731,6 +732,7 @@ class EntityGenerator extends BaseBlueprintGenerator { 'Instant', 'ZonedDateTime', 'Duration', + 'UUID', 'Boolean', 'byte[]', 'ByteBuffer' @@ -816,6 +818,8 @@ class EntityGenerator extends BaseBlueprintGenerator { context.fieldsContainDate = true; } else if (fieldType === 'BigDecimal') { context.fieldsContainBigDecimal = true; + } else if (fieldType === 'UUID') { + context.fieldsContainUUID = true; } else if (fieldType === 'byte[]' || fieldType === 'ByteBuffer') { context.blobFields.push(field); context.fieldsContainBlob = true; diff --git a/test/templates/export-jdl/.jhipster/Employee.json b/test/templates/export-jdl/.jhipster/Employee.json index 25582d4aa38f..9a064a710d21 100644 --- a/test/templates/export-jdl/.jhipster/Employee.json +++ b/test/templates/export-jdl/.jhipster/Employee.json @@ -24,6 +24,10 @@ "fieldName": "employeeId", "fieldType": "Long" }, + { + "fieldName": "employeeUuid", + "fieldType": "UUID" + }, { "fieldName": "firstName", "javadoc": "The firstname attribute.", diff --git a/test/templates/import-jdl/jdl.jdl b/test/templates/import-jdl/jdl.jdl index ebedec62b9c6..a13fcdacf018 100644 --- a/test/templates/import-jdl/jdl.jdl +++ b/test/templates/import-jdl/jdl.jdl @@ -1,5 +1,6 @@ entity Region { regionName String + guid UUID } entity Country { From 66ea9fc9cf31b09b76319de69e6105de53214c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Tue, 19 Mar 2019 22:57:55 +0100 Subject: [PATCH 126/298] Allow UUID in CLI --- generators/entity/prompts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generators/entity/prompts.js b/generators/entity/prompts.js index 4ceb3a8b5064..4196fcfbf7bb 100644 --- a/generators/entity/prompts.js +++ b/generators/entity/prompts.js @@ -533,6 +533,10 @@ function askForField(done) { value: 'enum', name: 'Enumeration (Java enum type)' }, + { + value: 'UUID', + name: 'UUID' + }, { value: 'byte[]', name: '[BETA] Blob' From e99fedc62037334ae0cd3805a39d5d1616cf0a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Tue, 19 Mar 2019 23:06:39 +0100 Subject: [PATCH 127/298] Add UUID fields in integration tests --- .../samples/.jhipster/FieldTestEntity.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test-integration/samples/.jhipster/FieldTestEntity.json b/test-integration/samples/.jhipster/FieldTestEntity.json index 0635b1013295..59d3ef4d33d3 100644 --- a/test-integration/samples/.jhipster/FieldTestEntity.json +++ b/test-integration/samples/.jhipster/FieldTestEntity.json @@ -233,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidTom", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredTom", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageTom", "fieldType": "byte[]", From 513d025c8fb0d5954962d7b4b263a0d34aac0513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sat, 25 May 2019 11:54:07 +0200 Subject: [PATCH 128/298] Handle loading UUID data from liquibase for fake data --- .../config/liquibase/changelog/added_entity.xml.ejs | 9 ++++++--- .../main/resources/config/liquibase/data/table.csv.ejs | 3 +++ .../src/main/resources/config/liquibase/master.xml.ejs | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index 4f74d29a141d..c6c3c58e947d 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -85,7 +85,7 @@ } else if (fieldType === 'Duration') { columnType="bigint"; } else if (fieldType === 'UUID') { - columnType="uuid"; + columnType="${uuidType}"; } else if (fieldType === 'byte[]' && fieldTypeBlobContent !== 'text') { if (prodDatabaseType === 'mysql' || prodDatabaseType === 'postgresql' || prodDatabaseType === 'mariadb') { columnType="longblob"; @@ -161,10 +161,11 @@ Spring Boot configuration key. --> - <%_ for (idx in fields) { @@ -182,6 +183,8 @@ loadColumnType = 'blob'; } else if (columnType === '${clobType}') { loadColumnType = 'clob'; + } else if (columnType === '${uuidType}' && ['mysql', 'mariadb'].includes(devDatabaseType)) { + loadColumnType = 'computed'; } _%> @@ -199,7 +202,7 @@ <%_ } _%> <%_ } _%> - + diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs index c0813ef9ab10..0339235a73ca 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs @@ -84,6 +84,9 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) { }); } else if (columnType === 'uuid') { data = this.faker.random.uuid(); + if (devDatabaseType === 'mysql' || devDatabaseType === 'mariadb') { + data = `UUID_TO_BIN('${data}')`; + } } else if (columnType === 'boolean') { data = this.faker.random.boolean(); } else if (columnType === 'date' || columnType === 'datetime') { diff --git a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs index 6b1cb2f1df1e..6820935ec5c9 100644 --- a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +++ b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs @@ -20,13 +20,18 @@ - <%_ if (prodDatabaseType === 'postgresql' || devDatabaseType === 'postgresql') { _%> + <%_ if (prodDatabaseType === 'postgresql') { _%> <%_ } else { _%> <%_ } _%> - + + <%_ if (prodDatabaseType === 'mysql' || prodDatabaseType === 'mariadb') { _%> + + <%_ } else { _%> + + <%_ } _%> From 79245a57fb3d540d7fd3a64952826d7475c3f277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sat, 25 May 2019 12:37:16 +0200 Subject: [PATCH 129/298] Fix incorrect attribute that was initially added for no reason --- .../resources/config/liquibase/changelog/added_entity.xml.ejs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index c6c3c58e947d..643db0ee615d 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -165,8 +165,7 @@ file="config/liquibase/data/<%= entityTableName %>.csv" separator=";" tableName="<%= entityTableName %>" - primaryKey="id" - context="dev"> + primaryKey="id"> <%_ for (idx in fields) { let loadColumnType = 'string'; From 6c6e1d0dec68ee3fedc290f237d2bc8a26a0f671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 26 May 2019 11:56:42 +0200 Subject: [PATCH 130/298] Add missing field types in FieldTest(.*)Entity in integration tests --- .../FieldTestInfiniteScrollEntity.json | 22 +++++++++++++++++++ .../.jhipster/FieldTestMapstructEntity.json | 22 +++++++++++++++++++ .../.jhipster/FieldTestPagerEntity.json | 22 +++++++++++++++++++ .../.jhipster/FieldTestPaginationEntity.json | 22 +++++++++++++++++++ .../FieldTestServiceClassEntity.json | 22 +++++++++++++++++++ .../.jhipster/FieldTestServiceImplEntity.json | 22 +++++++++++++++++++ 6 files changed, 132 insertions(+) diff --git a/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json b/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json index 01c015e5e811..519575cf64ca 100644 --- a/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json +++ b/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationHugo", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredHugo", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanHugo", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidHugo", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredHugo", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageHugo", "fieldType": "byte[]", diff --git a/test-integration/samples/.jhipster/FieldTestMapstructEntity.json b/test-integration/samples/.jhipster/FieldTestMapstructEntity.json index 6fd3a8e18970..22ca0661414e 100644 --- a/test-integration/samples/.jhipster/FieldTestMapstructEntity.json +++ b/test-integration/samples/.jhipster/FieldTestMapstructEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationEva", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredEva", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanEva", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidEva", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredEva", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageEva", "fieldType": "byte[]", diff --git a/test-integration/samples/.jhipster/FieldTestPagerEntity.json b/test-integration/samples/.jhipster/FieldTestPagerEntity.json index d73cb22f85ed..ae8b6367e8c0 100644 --- a/test-integration/samples/.jhipster/FieldTestPagerEntity.json +++ b/test-integration/samples/.jhipster/FieldTestPagerEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationJade", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredJade", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanJade", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidJade", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredJade", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageJade", "fieldType": "byte[]", diff --git a/test-integration/samples/.jhipster/FieldTestPaginationEntity.json b/test-integration/samples/.jhipster/FieldTestPaginationEntity.json index db9bb53efa3a..4fdeda9f0c95 100644 --- a/test-integration/samples/.jhipster/FieldTestPaginationEntity.json +++ b/test-integration/samples/.jhipster/FieldTestPaginationEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationAlice", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredAlice", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanAlice", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidAlice", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredAlice", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageAlice", "fieldType": "byte[]", diff --git a/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json b/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json index cb3e761f6583..5666a7feb11a 100644 --- a/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json +++ b/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationBob", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredBob", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanBob", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidBob", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredBob", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageBob", "fieldType": "byte[]", diff --git a/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json b/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json index 2c09197c412a..bdcb03bd5766 100644 --- a/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json +++ b/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json @@ -198,6 +198,17 @@ "required" ] }, + { + "fieldName": "durationMika", + "fieldType": "Duration" + }, + { + "fieldName": "durationRequiredMika", + "fieldType": "Duration", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "booleanMika", "fieldType": "Boolean" @@ -222,6 +233,17 @@ "required" ] }, + { + "fieldName": "uuidMika", + "fieldType": "UUID" + }, + { + "fieldName": "uuidRequiredMika", + "fieldType": "UUID", + "fieldValidateRules": [ + "required" + ] + }, { "fieldName": "byteImageMika", "fieldType": "byte[]", From e2e79c91f875e15d3ec38806228102e5d75e971e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 26 May 2019 23:03:40 +0200 Subject: [PATCH 131/298] Fixes UUID criteria --- .../main/java/package/service/dto/EntityCriteria.java.ejs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs b/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs index 987d082d65fb..ea4e038aea16 100644 --- a/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs @@ -28,6 +28,9 @@ import io.github.jhipster.service.filter.LocalDateFilter; <%_ if (fieldsContainDuration === true) { _%> import io.github.jhipster.service.filter.RangeFilter; <%_ } _%> +<%_ if (fieldsContainUUID === true) { _%> +import io.github.jhipster.service.filter.UUIDFilter; +<%_ } _%> <%_ if (fieldsContainZonedDateTime === true) { _%> import io.github.jhipster.service.filter.ZonedDateTimeFilter; <%_ } _%> @@ -42,8 +45,8 @@ import io.github.jhipster.service.filter.ZonedDateTimeFilter; var filterType; if (field.fieldIsEnum == true) { filterType = fieldType + 'Filter'; - extraFilters[fieldType] = {type : filterType, superType: 'Filter<' + fieldType + '>', fieldType:fieldType}; - } else if (['Duration', 'LocalDate', 'ZonedDateTime', 'Instant', 'String', 'Long', 'Integer', 'Float', 'Double', 'BigDecimal', 'Boolean'].includes(fieldType)) { + extraFilters[fieldType] = {type: filterType, superType: 'Filter<' + fieldType + '>', fieldType: fieldType}; + } else if (['Duration', 'UUID', 'LocalDate', 'ZonedDateTime', 'Instant', 'String', 'Long', 'Integer', 'Float', 'Double', 'BigDecimal', 'Boolean'].includes(fieldType)) { filterType = fieldType + 'Filter'; } else { filterType = 'Filter<' + fieldType + '>'; From 85e8aceaf3f47b79da24d327d2283fe7a7a13af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 26 May 2019 23:04:44 +0200 Subject: [PATCH 132/298] Use DurationFilter from jhipster framework --- .../java/package/service/dto/EntityCriteria.java.ejs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs b/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs index ea4e038aea16..e5f3040f4428 100644 --- a/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/service/dto/EntityCriteria.java.ejs @@ -1,9 +1,6 @@ package <%= packageName %>.service.dto; import java.io.Serializable; -<%_ if (fieldsContainDuration === true) { _%> -import java.time.Duration; -<%_ } _%> import java.util.Objects; import io.github.jhipster.service.Criteria; <%_ for (idx in fields) { if (fields[idx].fieldIsEnum === true) { _%> @@ -19,15 +16,15 @@ import io.github.jhipster.service.filter.StringFilter; <%_ if (fieldsContainBigDecimal === true) { _%> import io.github.jhipster.service.filter.BigDecimalFilter; <%_ } _%> +<%_ if (fieldsContainDuration === true) { _%> +import io.github.jhipster.service.filter.DurationFilter; +<%_ } _%> <%_ if (fieldsContainInstant === true) { _%> import io.github.jhipster.service.filter.InstantFilter; <%_ } _%> <%_ if (fieldsContainLocalDate === true) { _%> import io.github.jhipster.service.filter.LocalDateFilter; <%_ } _%> -<%_ if (fieldsContainDuration === true) { _%> -import io.github.jhipster.service.filter.RangeFilter; -<%_ } _%> <%_ if (fieldsContainUUID === true) { _%> import io.github.jhipster.service.filter.UUIDFilter; <%_ } _%> @@ -57,9 +54,6 @@ import io.github.jhipster.service.filter.ZonedDateTimeFilter; fieldInJavaBeanMethod: field.fieldInJavaBeanMethod }); } }); - if (fieldsContainDuration === true) { - extraFilters['java.time.Duration'] = {type : 'DurationFilter', superType: 'RangeFilter', fieldType: 'Duration'}; - } relationships.forEach((relationship) => { const relationshipType = relationship.relationshipType; // user has a String PK when using OAuth, so change relationships accordingly From 4f0fb0d0988a1df9f7083b04b0adba7017f97636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Mon, 27 May 2019 22:06:43 +0200 Subject: [PATCH 133/298] Fix handling of datetime with liquibase loadUpdateData --- .../resources/config/liquibase/changelog/added_entity.xml.ejs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index 643db0ee615d..081409464aaa 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -172,8 +172,10 @@ let columnType = fields[idx].columnType; if (columnType === 'integer' || columnType === 'bigint' || columnType === 'double' || columnType === 'decimal(21,2)' || columnType === '${floatType}') { loadColumnType = 'numeric'; - } else if (columnType === 'date' || columnType === 'datetime') { + } else if (columnType === 'date') { loadColumnType = 'date'; + } else if (columnType === 'datetime') { + loadColumnType = 'datetime'; } else if (columnType === 'boolean') { loadColumnType = 'boolean'; } else if (fields[idx].fieldIsEnum) { From 6c88837ba08faabab9878285551a2f0f1784ad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Mon, 27 May 2019 23:52:14 +0200 Subject: [PATCH 134/298] Yet another fake data fix --- .../src/main/resources/config/liquibase/data/table.csv.ejs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs index 0339235a73ca..0c5aa076a4b3 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs @@ -89,7 +89,9 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) { } } else if (columnType === 'boolean') { data = this.faker.random.boolean(); - } else if (columnType === 'date' || columnType === 'datetime') { + } else if (columnType === 'date') { + data = this.faker.date.recent().toISOString().split('T')[0]; + } else if (columnType === 'datetime') { // Write the date without milliseconds so Java can parse it // See https://stackoverflow.com/a/34053802/150868 data = this.faker.date.recent().toISOString().split('.')[0]; From cab6906b67780317bce28f6b4318ada3e58fc0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 2 Jun 2019 21:29:55 +0200 Subject: [PATCH 135/298] Change strategy due to liquibase limitations: use uuid-char for mysql --- .../src/main/java/package/domain/Entity.java.ejs | 5 ++++- .../config/liquibase/changelog/added_entity.xml.ejs | 9 +++------ .../main/resources/config/liquibase/data/table.csv.ejs | 5 +---- .../src/main/resources/config/liquibase/master.xml.ejs | 5 ++--- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs index 39bddb152407..e268418334ba 100644 --- a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs @@ -56,7 +56,7 @@ import io.swagger.annotations.ApiModelProperty; <%_ } if (enableHibernateCache) { _%> import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; -<%_ } if (hasTextBlob === true) { _%> +<%_ } if (hasTextBlob === true || (fieldsContainUUID === true && ['mysql', 'mariadb'].includes(prodDatabaseType))) { _%> import org.hibernate.annotations.Type; <%_ } if (databaseType === 'mongodb') { _%> import org.springframework.data.annotation.Id; @@ -216,6 +216,9 @@ public class <%= asEntity(entityClass) %> implements Serializable { @Column(name = "<%-fieldNameAsDatabaseColumn %>"<% if (required) { %>, nullable = false<% } %><% if (unique) { %>, unique = true<% } %>) <%_ } else if (fieldType === 'BigDecimal') { _%> @Column(name = "<%-fieldNameAsDatabaseColumn %>", precision = 21, scale = 2<% if (required) { %>, nullable = false<% } %><% if (unique) { %>, unique = true<% } %>) + <%_ } else if (fieldType === 'UUID' && ['mysql', 'mariadb'].includes(prodDatabaseType)) { _%> + @Type(type = "uuid-char") + @Column(name = "<%-fieldNameAsDatabaseColumn %>", length = 36<% if (required) { %>, nullable = false<% } %><% if (unique) { %>, unique = true<% } %>) <%_ } else { _%> @Column(name = "<%-fieldNameAsDatabaseColumn %>"<% if (fieldValidate === true) { %><% if (fieldValidateRules.includes('maxlength')) { %>, length = <%= fieldValidateRulesMaxlength %><% } %><% if (required) { %>, nullable = false<% } %><% if (unique) { %>, unique = true<% } %><% } %>) <%_ } diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index 081409464aaa..631dd6028009 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -161,11 +161,10 @@ Spring Boot configuration key. --> - + tableName="<%= entityTableName %>"> <%_ for (idx in fields) { let loadColumnType = 'string'; @@ -184,8 +183,6 @@ loadColumnType = 'blob'; } else if (columnType === '${clobType}') { loadColumnType = 'clob'; - } else if (columnType === '${uuidType}' && ['mysql', 'mariadb'].includes(devDatabaseType)) { - loadColumnType = 'computed'; } _%> @@ -203,7 +200,7 @@ <%_ } _%> <%_ } _%> - + diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs index 0c5aa076a4b3..d5866c3d9914 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs @@ -82,11 +82,8 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) { max: fields[idx].fieldValidateRulesMax ? parseFloat(fields[idx].fieldValidateRulesMax) : undefined, min: fields[idx].fieldValidateRulesMin ? parseFloat(fields[idx].fieldValidateRulesMin) : undefined }); - } else if (columnType === 'uuid') { + } else if (columnType === '${uuidType}') { data = this.faker.random.uuid(); - if (devDatabaseType === 'mysql' || devDatabaseType === 'mariadb') { - data = `UUID_TO_BIN('${data}')`; - } } else if (columnType === 'boolean') { data = this.faker.random.boolean(); } else if (columnType === 'date') { diff --git a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs index 6820935ec5c9..0e301055fc6d 100644 --- a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +++ b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs @@ -26,11 +26,10 @@ <%_ } _%> - <%_ if (prodDatabaseType === 'mysql' || prodDatabaseType === 'mariadb') { _%> - + <%_ } else { _%> - + <%_ } _%> From 93d0d8931abd2dc775e9c3d79ecb2a191a72ae02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 2 Jun 2019 21:33:20 +0200 Subject: [PATCH 136/298] Add an UUID field in one of the main entity of integration tests --- test-integration/samples/.jhipster/BankAccount.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test-integration/samples/.jhipster/BankAccount.json b/test-integration/samples/.jhipster/BankAccount.json index bf556dbd1f93..b9133f7b36e0 100644 --- a/test-integration/samples/.jhipster/BankAccount.json +++ b/test-integration/samples/.jhipster/BankAccount.json @@ -22,6 +22,10 @@ "required" ] }, + { + "fieldName": "guid", + "fieldType": "UUID" + }, { "fieldName": "bankNumber", "fieldType": "Integer" From 8d6416090b341df58b58be71ad5809ab4e9ea551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Tue, 4 Jun 2019 00:12:53 +0200 Subject: [PATCH 137/298] UUID converters for Couchbase --- .../config/DatabaseConfiguration.java.ejs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs index 2f67bc75d1b4..4377e9e76eb5 100644 --- a/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs @@ -116,6 +116,7 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; <%_ } _%> @Configuration @@ -244,6 +245,8 @@ public class DatabaseConfiguration { converters.add(BigDecimalToStringConverter.INSTANCE); converters.add(StringToBigDecimalConverter.INSTANCE); converters.add(StringToByteConverter.INSTANCE); + converters.add(UUIDToStringConverter.INSTANCE); + converters.add(StringToUUIDConverter.INSTANCE); return new CouchbaseCustomConversions(converters); } @@ -344,5 +347,34 @@ public class DatabaseConfiguration { return Base64.decodeBase64(source); } } + + /** + * Simple singleton to convert {@link UUID}s to their {@link String} representation. + */ + @WritingConverter + public enum UUIDToStringConverter implements Converter { + + INSTANCE; + + @Override + public String convert(UUID source) { + return source == null ? null : source.toString(); + } + } + + /** + * Simple singleton to convert from {@link String} {@link UUID} representation. + */ + @ReadingConverter + public enum StringToUUIDConverter implements Converter { + + INSTANCE; + + @Override + public UUID convert(String source) { + return source == null ? null : UUID.fromString(source); + } + + } <%_ } _%> } From 1c7db91861237b7e6c7840683229a414996fcf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Mon, 10 Jun 2019 20:18:16 +0200 Subject: [PATCH 138/298] Update jhipster-core to get support for UUID as field type --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 55a47040e43a..9d859d53895a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -568,9 +568,9 @@ "dev": true }, "chevrotain": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-4.3.3.tgz", - "integrity": "sha512-DsmAmF5urXboHHXqEr26Ot//S+l3yrOr7UwwgWQ+aNNlYpmnYK1flxplwJ5cIUgP9toKFsJ0VeLT1sq350A9Hg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-4.4.0.tgz", + "integrity": "sha512-CS0auzIhlLxo9RCVarVZJIsKj339jJrLIdCbX3rwk/kTu7+VkYdiXiAD8aJOXJEcRc1GGcbOQ587e/85+xLxaA==", "requires": { "regexp-to-ast": "0.4.0" } @@ -2689,11 +2689,11 @@ } }, "jhipster-core": { - "version": "3.6.14", - "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-3.6.14.tgz", - "integrity": "sha512-X8rQ1hPXMaj9ri4QvbGyUmbMOAsLn2dbJQH14dE/A/4HBT+ODBu83ptQCLXtSmysumyqgHrOiHiLVYa3Qq74rg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-4.0.0.tgz", + "integrity": "sha512-lxcdMzqgbsdvHnEDnluiXShG5vooMts+jlmY/Op6s3BmkAeu5IhgTNCt1yZRA66O2RuFRv8kmJ8ySlWw2+bwfQ==", "requires": { - "chevrotain": "4.3.3", + "chevrotain": "4.4.0", "fs-extra": "8.0.1", "lodash": "4.17.11", "winston": "3.2.1" @@ -5331,9 +5331,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", diff --git a/package.json b/package.json index f971d1c25004..160d496b933a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "glob": "7.1.3", "gulp-filter": "5.1.0", "insight": "0.10.1", - "jhipster-core": "3.6.14", + "jhipster-core": "4.0.0", "js-object-pretty-print": "0.3.0", "js-yaml": "3.13.1", "lodash": "4.17.11", From 53c2e63acbc42a415756e6e5816fc83d63fe9329 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Mon, 10 Jun 2019 20:45:52 +0200 Subject: [PATCH 139/298] Replace componentDidMount by useEffect --- .../src/main/webapp/app/shared/layout/header/header.tsx.ejs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs index 6ab1dafbe89b..0d19c35ffc0c 100644 --- a/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs @@ -18,7 +18,7 @@ -%> import './header.<%= styleSheetExt %>'; -import React, { useState } from 'react'; +import React, { useState<% if (enableI18nRTL) { %>, useEffect<% } %> } from 'react'; import { Translate<% if (enableTranslation) { %>, Storage<% } %> } from 'react-jhipster'; import { Navbar, @@ -55,9 +55,7 @@ export interface IHeaderProps { const Header = (props: IHeaderProps) => { const [menuOpen, setMenuOpen] = useState(false); <%_ if (enableI18nRTL) { _%> - componentDidMount () { - document.querySelector('html').setAttribute('dir', isRTL(Storage.session.get('locale')) ? 'rtl' : 'ltr'); - }; + useEffect(() => document.querySelector('html').setAttribute('dir', isRTL(Storage.session.get('locale')) ? 'rtl' : 'ltr')); <%_ } _%> <%_ if (enableTranslation) { _%> From 2d80e13c234bd4039d02d85ec88c5b24ff735ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Tamisier?= Date: Mon, 10 Jun 2019 21:02:18 +0200 Subject: [PATCH 140/298] use 'a user' instead of 'an user' --- .../templates/src/main/webapp/i18n/da/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/en/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/es/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/gl/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/hu/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/ja/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/ko/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/pt-pt/user-management.json | 4 ++-- .../templates/src/main/webapp/i18n/tr/user-management.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/generators/languages/templates/src/main/webapp/i18n/da/user-management.json b/generators/languages/templates/src/main/webapp/i18n/da/user-management.json index 30c125b6d00b..f5c5e48a224b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/da/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/da/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Create or edit a user" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Are you sure you want to delete user {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/en/user-management.json b/generators/languages/templates/src/main/webapp/i18n/en/user-management.json index 30c125b6d00b..f5c5e48a224b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/en/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/en/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Create or edit a user" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Are you sure you want to delete user {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/es/user-management.json b/generators/languages/templates/src/main/webapp/i18n/es/user-management.json index 66db478dd1c8..cdb57bb7ac9f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/es/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/es/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Crear o editar un usuario" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "¿Seguro que quieres eliminar el usuario {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/gl/user-management.json b/generators/languages/templates/src/main/webapp/i18n/gl/user-management.json index bc76796b6389..2e8502e479e9 100644 --- a/generators/languages/templates/src/main/webapp/i18n/gl/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/gl/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Crear ou editar un usuario" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Seguro que quere eliminar o usuario {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/hu/user-management.json b/generators/languages/templates/src/main/webapp/i18n/hu/user-management.json index 013c5c07b89c..7024d7a47379 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hu/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/hu/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Felhasználó létrehozás vagy módosítás" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Biztos benne, hogy törölni szeretné az {{ login }} azonosítóval rendelkező felhasználót?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/ja/user-management.json b/generators/languages/templates/src/main/webapp/i18n/ja/user-management.json index 30c125b6d00b..f5c5e48a224b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ja/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/ja/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Create or edit a user" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Are you sure you want to delete user {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/ko/user-management.json b/generators/languages/templates/src/main/webapp/i18n/ko/user-management.json index e7b9e1464267..6cf5401d00fa 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ko/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/ko/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "사용자 생성 또는 수정" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "정말로 {{ login }} 사용자를 삭제하시겠습니까?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-pt/user-management.json b/generators/languages/templates/src/main/webapp/i18n/pt-pt/user-management.json index dad0d35148eb..0b4ddaba8241 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-pt/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/pt-pt/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Criar ou editar utilizador" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "Tem a certeza que deseja eliminar o utilizador {{ login }}?" }, diff --git a/generators/languages/templates/src/main/webapp/i18n/tr/user-management.json b/generators/languages/templates/src/main/webapp/i18n/tr/user-management.json index 859f7587fff8..b8bd7c9c305d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/tr/user-management.json +++ b/generators/languages/templates/src/main/webapp/i18n/tr/user-management.json @@ -6,8 +6,8 @@ "createOrEditLabel": "Kullanıcı oluştur veya düzenle" }, "created": "A new user is created with identifier {{ param }}", - "updated": "An user is updated with identifier {{ param }}", - "deleted": "An user is deleted with identifier {{ param }}", + "updated": "A user is updated with identifier {{ param }}", + "deleted": "A user is deleted with identifier {{ param }}", "delete": { "question": "{{ login }} kullanıcısını silmek istediğinize emin misiniz?" }, From c51faa6b35ab37edab1e303e386b49230c5127b8 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Mon, 10 Jun 2019 23:39:31 +0200 Subject: [PATCH 141/298] CICD: set NG_CLI_ANALYTICS to false (#9885) --- generators/ci-cd/templates/.gitlab-ci.yml.ejs | 2 ++ generators/ci-cd/templates/azure-pipelines.yml.ejs | 1 + generators/ci-cd/templates/travis.yml.ejs | 1 + 3 files changed, 4 insertions(+) diff --git a/generators/ci-cd/templates/.gitlab-ci.yml.ejs b/generators/ci-cd/templates/.gitlab-ci.yml.ejs index 2028d617a6ce..240b0eee4242 100644 --- a/generators/ci-cd/templates/.gitlab-ci.yml.ejs +++ b/generators/ci-cd/templates/.gitlab-ci.yml.ejs @@ -42,6 +42,7 @@ stages: <%_ if (buildTool === 'gradle') { _%> before_script: + - export NG_CLI_ANALYTICS="false" - export GRADLE_USER_HOME=`pwd`/.gradle <%_ if (!skipClient) { _%> - ./gradlew <%= clientPackageManager %>_install -PnodeInstall --no-daemon @@ -143,6 +144,7 @@ deploy-to-production: <%_ if (buildTool === 'maven') { _%> before_script: + - export NG_CLI_ANALYTICS="false" - export MAVEN_USER_HOME=`pwd`/.maven <%_ if (!skipClient) { _%> <%_ if (clientPackageManager === 'yarn') { _%> diff --git a/generators/ci-cd/templates/azure-pipelines.yml.ejs b/generators/ci-cd/templates/azure-pipelines.yml.ejs index dd7be02f5b42..1e97ed26c956 100644 --- a/generators/ci-cd/templates/azure-pipelines.yml.ejs +++ b/generators/ci-cd/templates/azure-pipelines.yml.ejs @@ -25,6 +25,7 @@ jobs: SPRING_OUTPUT_ANSI_ENABLED: NEVER SPRING_JPA_SHOW_SQL: false JHI_DISABLE_WEBPACK_LOGS: true + NG_CLI_ANALYTICS: "false" steps: #---------------------------------------------------------------------- diff --git a/generators/ci-cd/templates/travis.yml.ejs b/generators/ci-cd/templates/travis.yml.ejs index 0a1276030bec..e03feaf901e5 100644 --- a/generators/ci-cd/templates/travis.yml.ejs +++ b/generators/ci-cd/templates/travis.yml.ejs @@ -44,6 +44,7 @@ env: - SPRING_OUTPUT_ANSI_ENABLED=ALWAYS - SPRING_JPA_SHOW_SQL=false - JHI_DISABLE_WEBPACK_LOGS=true + - NG_CLI_ANALYTICS="false" before_install: - jdk_switcher use oraclejdk8 - java -version From 4dccfb928a68e131ee6afb886c55b384d0272e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Mon, 27 May 2019 20:47:37 +0200 Subject: [PATCH 142/298] Handling of table and column names when jhiPrefix is empty Fixes #9430 --- generators/entity/index.js | 33 +++++++++++++++++++++++++-------- generators/generator-base.js | 2 +- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/generators/entity/index.js b/generators/entity/index.js index 6ee1deaf71d5..0ec31939b8af 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -310,12 +310,20 @@ class EntityGenerator extends BaseBlueprintGenerator { } else if (entityTableName === '') { this.error('The table name cannot be empty'); } else if (jhiCore.isReservedTableName(entityTableName, prodDatabaseType)) { - this.warning( - chalk.red( - `The table name cannot contain the '${entityTableName.toUpperCase()}' reserved keyword, so it will be prefixed with '${jhiTablePrefix}_'.\n${instructions}` - ) - ); - context.entityTableName = `${jhiTablePrefix}_${entityTableName}`; + if (jhiTablePrefix) { + this.warning( + chalk.red( + `The table name cannot contain the '${entityTableName.toUpperCase()}' reserved keyword, so it will be prefixed with '${jhiTablePrefix}_'.\n${instructions}` + ) + ); + context.entityTableName = `${jhiTablePrefix}_${entityTableName}`; + } else { + this.warning( + chalk.red( + `The table name contain the '${entityTableName.toUpperCase()}' reserved keyword but you have defined an empty jhiPrefix so it won't be prefixed and thus the generated application might not work'.\n${instructions}` + ) + ); + } } else if (prodDatabaseType === 'oracle' && entityTableName.length > 26 && !skipCheckLengthOfIdentifier) { this.error(`The table name is too long for Oracle, try a shorter name.\n${instructions}`); } else if (prodDatabaseType === 'oracle' && entityTableName.length > 14 && !skipCheckLengthOfIdentifier) { @@ -757,7 +765,16 @@ class EntityGenerator extends BaseBlueprintGenerator { const fieldNameUnderscored = _.snakeCase(field.fieldName); const jhiFieldNamePrefix = this.getColumnName(context.jhiPrefix); if (jhiCore.isReservedTableName(fieldNameUnderscored, context.databaseType)) { - field.fieldNameAsDatabaseColumn = `${jhiFieldNamePrefix}_${fieldNameUnderscored}`; + if (!jhiFieldNamePrefix) { + this.warning( + chalk.red( + `The field name '${fieldNameUnderscored}' is regarded as a reserved keyword, but you have defined an empty jhiPrefix. This might lead to a non-working application.` + ) + ); + field.fieldNameAsDatabaseColumn = fieldNameUnderscored; + } else { + field.fieldNameAsDatabaseColumn = `${jhiFieldNamePrefix}_${fieldNameUnderscored}`; + } } else { field.fieldNameAsDatabaseColumn = fieldNameUnderscored; } @@ -908,7 +925,7 @@ class EntityGenerator extends BaseBlueprintGenerator { if (!relationship.otherEntityTableName) { relationship.otherEntityTableName = this.getTableName(otherEntityName); } - if (jhiCore.isReservedTableName(relationship.otherEntityTableName, context.prodDatabaseType)) { + if (jhiCore.isReservedTableName(relationship.otherEntityTableName, context.prodDatabaseType) && jhiTablePrefix) { const otherEntityTableName = relationship.otherEntityTableName; relationship.otherEntityTableName = `${jhiTablePrefix}_${otherEntityTableName}`; } diff --git a/generators/generator-base.js b/generators/generator-base.js index 72ac9b69fcfa..d31b122dc401 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -1137,7 +1137,7 @@ module.exports = class extends PrivateBase { this.warning(`entityTableName is missing in .jhipster/${context.name}.json, using entity name as fallback`); context.entityTableName = this.getTableName(context.name); } - if (jhiCore.isReservedTableName(context.entityTableName, context.prodDatabaseType)) { + if (jhiCore.isReservedTableName(context.entityTableName, context.prodDatabaseType) && context.jhiPrefix) { context.entityTableName = `${context.jhiTablePrefix}_${context.entityTableName}`; } context.fields.forEach(field => { From 2015d993aff08527e7a6cd27e5061bfde885a58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Tue, 11 Jun 2019 00:16:22 +0200 Subject: [PATCH 143/298] Entity: fix reserved word for field check The check was using databaseType rather than prodDatabaseType, and thus was returning false positive. Eg: 'label' is only a reserved word for Oracle, but was considered as a reserved word for MySQL or PostgreSQL --- generators/entity/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/entity/index.js b/generators/entity/index.js index 95aeb9f4e351..385747e2591e 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -766,7 +766,7 @@ class EntityGenerator extends BaseBlueprintGenerator { if (_.isUndefined(field.fieldNameAsDatabaseColumn)) { const fieldNameUnderscored = _.snakeCase(field.fieldName); const jhiFieldNamePrefix = this.getColumnName(context.jhiPrefix); - if (jhiCore.isReservedTableName(fieldNameUnderscored, context.databaseType)) { + if (jhiCore.isReservedTableName(fieldNameUnderscored, context.prodDatabaseType)) { if (!jhiFieldNamePrefix) { this.warning( chalk.red( From 9f26c352fd91aea87006009f475896516c96d30d Mon Sep 17 00:00:00 2001 From: Arnaud Freismuth Date: Fri, 7 Jun 2019 10:45:47 +0200 Subject: [PATCH 144/298] remove unused imports for entities --- .../templates/src/main/java/package/domain/Entity.java.ejs | 4 +--- .../templates/src/main/java/package/domain/imports.ejs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs index e268418334ba..390fdc04bd89 100644 --- a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs @@ -101,9 +101,7 @@ import java.time.Duration; <%_ } if (importSet === true) { _%> import java.util.HashSet; import java.util.Set; -<%_ } _%> -import java.util.Objects; -<%_ if (databaseType === 'couchbase' && hasRelationship) { _%> +<%_ } if (databaseType === 'couchbase' && hasRelationship) { _%> import java.util.stream.Collectors; <%_ } _%> <%_ if (databaseType === 'cassandra' || fieldsContainUUID === true) { _%> diff --git a/generators/entity-server/templates/src/main/java/package/domain/imports.ejs b/generators/entity-server/templates/src/main/java/package/domain/imports.ejs index 186eaeb553bc..0ceb035f86c8 100644 --- a/generators/entity-server/templates/src/main/java/package/domain/imports.ejs +++ b/generators/entity-server/templates/src/main/java/package/domain/imports.ejs @@ -35,9 +35,7 @@ if (!importApiModelProperty) { } for (idx in relationships) { - if (relationships[idx].relationshipType === 'one-to-many' - || relationships[idx].relationshipType === 'one-to-one' && relationships[idx].ownerSide === false - || relationships[idx].relationshipType === 'many-to-many' && relationships[idx].ownerSide === false) { + if (relationships[idx].ownerSide === false && ['one-to-many', 'one-to-one', 'many-to-many'].includes(relationships[idx].relationshipType)) { importJsonIgnore = true; } else if (relationships[idx].relationshipType === 'many-to-one') { importJsonIgnoreProperties = true; From 8aff228daa3d2f29d18ca4d3c2d743ddd86e34fd Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 11 Jun 2019 11:59:48 +0200 Subject: [PATCH 145/298] Upgrade to jhipster-registry v5.0.2 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 70f714523914..e1a5bd139332 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -18,7 +18,7 @@ */ // version of docker images -const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.1'; +const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.2'; const DOCKER_JAVA_JRE = 'adoptopenjdk/openjdk11:alpine-jre'; const DOCKER_MYSQL = 'mysql:8.0.16'; const DOCKER_MARIADB = 'mariadb:10.4.5'; From b29fed28ca5f31d47889ea4f45692a6c658bc3e4 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 11 Jun 2019 14:21:46 +0200 Subject: [PATCH 146/298] Upgrade to jhipster lib v3.0.2 --- generators/server/templates/build.gradle.ejs | 2 -- generators/server/templates/gradle.properties.ejs | 2 +- generators/server/templates/pom.xml.ejs | 13 +------------ 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 240d777a742e..22733053ed36 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -255,8 +255,6 @@ repositories { } } <%_ } _%> - // TODO To remove after final JHipster release - maven { url "http://oss.sonatype.org/content/repositories/snapshots" } //jhipster-needle-gradle-repositories - JHipster will add additional repositories } diff --git a/generators/server/templates/gradle.properties.ejs b/generators/server/templates/gradle.properties.ejs index fa3dcca6b659..6afd2ff23aad 100644 --- a/generators/server/templates/gradle.properties.ejs +++ b/generators/server/templates/gradle.properties.ejs @@ -25,7 +25,7 @@ npm_version=<%= NPM_VERSION %> yarn_version=<%= YARN_VERSION %> # Dependency versions -jhipster_dependencies_version=3.0.2-SNAPSHOT +jhipster_dependencies_version=3.0.2 # 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.1.5.RELEASE diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index aab5373f6754..b2e2724e90bd 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -41,17 +41,6 @@ <%_ } _%> - - - oss.sonatype.org-snapshot - http://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - @@ -91,7 +80,7 @@ - 3.0.2-SNAPSHOT + 3.0.2 2.1.5.RELEASE From 6b9347e47de0763faca93e1e33753db5347032bc Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 11 Jun 2019 13:42:00 +0100 Subject: [PATCH 147/298] Update mongo docker image to 4.0.10 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 70f714523914..4d5c942be1d0 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -23,7 +23,7 @@ const DOCKER_JAVA_JRE = 'adoptopenjdk/openjdk11:alpine-jre'; const DOCKER_MYSQL = 'mysql:8.0.16'; const DOCKER_MARIADB = 'mariadb:10.4.5'; const DOCKER_POSTGRESQL = 'postgres:11.3'; -const DOCKER_MONGODB = 'mongo:4.0.9'; +const DOCKER_MONGODB = 'mongo:4.0.10'; const DOCKER_COUCHBASE = 'couchbase:6.0.1'; const DOCKER_CASSANDRA = 'cassandra:3.11.4'; const DOCKER_MSSQL = 'microsoft/mssql-server-linux:latest'; From 8f8c86fad7e8837f5efd5454847ddd63445c5ee7 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 11 Jun 2019 13:42:37 +0100 Subject: [PATCH 148/298] Update memcached docker image to 1.5.16-alpine --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 4d5c942be1d0..201dfb1f9207 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -28,7 +28,7 @@ const DOCKER_COUCHBASE = 'couchbase:6.0.1'; const DOCKER_CASSANDRA = 'cassandra:3.11.4'; const DOCKER_MSSQL = 'microsoft/mssql-server-linux:latest'; const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12'; -const DOCKER_MEMCACHED = 'memcached:1.5.15-alpine'; +const DOCKER_MEMCACHED = 'memcached:1.5.16-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.1'; From a0c230ccf5e3d84072bf167dbd3d1b03b4a76a37 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 11 Jun 2019 13:44:06 +0100 Subject: [PATCH 149/298] Update grafana/grafana docker image to 6.2.2 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 201dfb1f9207..e8f02cba3ad1 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -45,7 +45,7 @@ const DOCKER_CONSUL = 'consul:1.5.1'; const DOCKER_CONSUL_CONFIG_LOADER = 'jhipster/consul-config-loader:v0.3.0'; const DOCKER_PROMETHEUS = 'prom/prometheus:v2.10.0'; const DOCKER_PROMETHEUS_ALERTMANAGER = 'prom/alertmanager:v0.17.0'; -const DOCKER_GRAFANA = 'grafana/grafana:6.2.0'; +const DOCKER_GRAFANA = 'grafana/grafana:6.2.2'; const DOCKER_JENKINS = 'jenkins:latest'; const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest'; const DOCKER_COMPOSE_FORMAT_VERSION = '2'; From dc10c5cb3dd64efe993a3c05be327c3259a205be Mon Sep 17 00:00:00 2001 From: lc-laptop Date: Tue, 11 Jun 2019 14:37:43 +0200 Subject: [PATCH 150/298] fix: yarn e2e test with protractor --- generators/client/templates/angular/package.json.ejs | 2 +- generators/client/templates/react/package.json.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index ef0e70ac3fd6..dbcab2fa77f5 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -175,7 +175,7 @@ "clean-www": "rimraf <%= DIST_DIR %>app/{src,<%= BUILD_DIR %>}", <%_ if (protractorTests) { _%> "e2e": "protractor <%= TEST_SRC_DIR %>protractor.conf.js", - "postinstall": "node node_modules/webdriver-manager/bin/webdriver-manager update --gecko false", + "postinstall": "node node_modules/protractor/bin/webdriver-manager update --gecko false", <%_ } _%> "start": "<%= clientPackageManager %> run webpack:dev", "start-tls": "<%= clientPackageManager %> run webpack:dev <%= optionsForwarder %>--env.tls", diff --git a/generators/client/templates/react/package.json.ejs b/generators/client/templates/react/package.json.ejs index 5917013599c1..8bea0ed600a8 100644 --- a/generators/client/templates/react/package.json.ejs +++ b/generators/client/templates/react/package.json.ejs @@ -199,7 +199,7 @@ limitations under the License. "cleanup": "rimraf <%= DIST_DIR %>", <%_ if (protractorTests) { _%> "e2e": "protractor <%= TEST_SRC_DIR %>protractor.conf.js", - "postinstall": "node node_modules/webdriver-manager/bin/webdriver-manager update --gecko false", + "postinstall": "node node_modules/protractor/bin/webdriver-manager update --gecko false", <%_ } _%> "start": "<%= clientPackageManager %> run webpack:dev", "start-tls": "<%= clientPackageManager %> run webpack:dev <%= optionsForwarder %>--env.tls", From bda36122b1a8377b024bf24843dff44a989fc491 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 11 Jun 2019 13:44:21 +0100 Subject: [PATCH 151/298] Update quay.io/coreos/prometheus-operator docker image to v0.30.1 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index e8f02cba3ad1..948ca26bd676 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -49,7 +49,7 @@ const DOCKER_GRAFANA = 'grafana/grafana:6.2.2'; const DOCKER_JENKINS = 'jenkins:latest'; const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest'; const DOCKER_COMPOSE_FORMAT_VERSION = '2'; -const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.30.0'; +const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.30.1'; const DOCKER_GRAFANA_WATCHER = 'quay.io/coreos/grafana-watcher:v0.0.8'; // Kubernetes versions From dfec4bffb8965bebbef7540127a3b0812f7f5fb6 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 11 Jun 2019 13:44:36 +0100 Subject: [PATCH 152/298] Update JIB to 1.3.0 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 948ca26bd676..1e8d7eac4ee9 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -70,7 +70,7 @@ const YARN_VERSION = '1.16.0'; const NPM_VERSION = '6.9.0'; // Libraries version -const JIB_VERSION = '1.2.0'; +const JIB_VERSION = '1.3.0'; // all constants used throughout all generators From 77f3500d1db175f5c7ef8bd471ff234274475657 Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Tue, 11 Jun 2019 15:30:36 +0200 Subject: [PATCH 153/298] use official adoptopenjdk docker image now that it is available from docker hub --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 2dd957173936..fa2763c75b1a 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -19,7 +19,7 @@ // version of docker images const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.2'; -const DOCKER_JAVA_JRE = 'adoptopenjdk/openjdk11:alpine-jre'; +const DOCKER_JAVA_JRE = 'adoptopenjdk:11-jre-hotspot'; const DOCKER_MYSQL = 'mysql:8.0.16'; const DOCKER_MARIADB = 'mariadb:10.4.5'; const DOCKER_POSTGRESQL = 'postgres:11.3'; From ae3a2e4fbe2abcc6b4790ae0f83e82e670e19270 Mon Sep 17 00:00:00 2001 From: Anthony Viard Date: Tue, 11 Jun 2019 14:36:45 +0200 Subject: [PATCH 154/298] Use content as folder name instead of static #9880 --- generators/client/files-react.js | 44 +++++++++--------- .../webapp/app/modules/home/home.scss.ejs | 2 +- .../{static => content}/css/loading.css.ejs | 0 .../images/jhipster_family_member_0.svg | 0 .../jhipster_family_member_0_head-192.png | Bin .../jhipster_family_member_0_head-256.png | Bin .../jhipster_family_member_0_head-384.png | Bin .../jhipster_family_member_0_head-512.png | Bin .../images/jhipster_family_member_1.svg | 0 .../jhipster_family_member_1_head-192.png | Bin .../jhipster_family_member_1_head-256.png | Bin .../jhipster_family_member_1_head-384.png | Bin .../jhipster_family_member_1_head-512.png | Bin .../images/jhipster_family_member_2.svg | 0 .../jhipster_family_member_2_head-192.png | Bin .../jhipster_family_member_2_head-256.png | Bin .../jhipster_family_member_2_head-384.png | Bin .../jhipster_family_member_2_head-512.png | Bin .../images/jhipster_family_member_3.svg | 0 .../jhipster_family_member_3_head-192.png | Bin .../jhipster_family_member_3_head-256.png | Bin .../jhipster_family_member_3_head-384.png | Bin .../jhipster_family_member_3_head-512.png | Bin .../images/logo-jhipster.png | Bin .../react/webpack/webpack.common.js.ejs | 2 +- .../e2e/entities/entity.spec.ts.ejs | 2 +- 26 files changed, 25 insertions(+), 25 deletions(-) rename generators/client/templates/react/src/main/webapp/{static => content}/css/loading.css.ejs (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_0.svg (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_0_head-192.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_0_head-256.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_0_head-384.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_0_head-512.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_1.svg (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_1_head-192.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_1_head-256.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_1_head-384.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_1_head-512.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_2.svg (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_2_head-192.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_2_head-256.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_2_head-384.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_2_head-512.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_3.svg (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_3_head-192.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_3_head-256.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_3_head-384.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/jhipster_family_member_3_head-512.png (100%) rename generators/client/templates/react/src/main/webapp/{static => content}/images/logo-jhipster.png (100%) diff --git a/generators/client/files-react.js b/generators/client/files-react.js index ab08c8ef0276..6ad9308a9cb0 100644 --- a/generators/client/files-react.js +++ b/generators/client/files-react.js @@ -67,27 +67,27 @@ const files = { { path: MAIN_SRC_DIR, templates: [ - { file: 'static/images/jhipster_family_member_0.svg', method: 'copy' }, - { file: 'static/images/jhipster_family_member_1.svg', method: 'copy' }, - { file: 'static/images/jhipster_family_member_2.svg', method: 'copy' }, - { file: 'static/images/jhipster_family_member_3.svg', method: 'copy' }, - { file: 'static/images/jhipster_family_member_0_head-192.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_1_head-192.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_2_head-192.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_3_head-192.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_0_head-256.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_1_head-256.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_2_head-256.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_3_head-256.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_0_head-384.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_1_head-384.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_2_head-384.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_3_head-384.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_0_head-512.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_1_head-512.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_2_head-512.png', method: 'copy' }, - { file: 'static/images/jhipster_family_member_3_head-512.png', method: 'copy' }, - { file: 'static/images/logo-jhipster.png', method: 'copy' } + { file: 'content/images/jhipster_family_member_0.svg', method: 'copy' }, + { file: 'content/images/jhipster_family_member_1.svg', method: 'copy' }, + { file: 'content/images/jhipster_family_member_2.svg', method: 'copy' }, + { file: 'content/images/jhipster_family_member_3.svg', method: 'copy' }, + { file: 'content/images/jhipster_family_member_0_head-192.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_1_head-192.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_2_head-192.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_3_head-192.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_0_head-256.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_1_head-256.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_2_head-256.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_3_head-256.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_0_head-384.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_1_head-384.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_2_head-384.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_3_head-384.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_0_head-512.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_1_head-512.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_2_head-512.png', method: 'copy' }, + { file: 'content/images/jhipster_family_member_3_head-512.png', method: 'copy' }, + { file: 'content/images/logo-jhipster.png', method: 'copy' } ] } ], @@ -107,7 +107,7 @@ const files = { '404.html', 'index.html', 'manifest.webapp', - 'static/css/loading.css' + 'content/css/loading.css' ] } ], diff --git a/generators/client/templates/react/src/main/webapp/app/modules/home/home.scss.ejs b/generators/client/templates/react/src/main/webapp/app/modules/home/home.scss.ejs index 11112f39ac3d..2b1847c8a2dc 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/home/home.scss.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/home/home.scss.ejs @@ -23,6 +23,6 @@ Main page styles display: inline-block; width: 100%; height: 497px; - background: url("../../../static/images/<%=hipster%>.svg") no-repeat center top; + background: url("../../../content/images/<%=hipster%>.svg") no-repeat center top; background-size: contain; } diff --git a/generators/client/templates/react/src/main/webapp/static/css/loading.css.ejs b/generators/client/templates/react/src/main/webapp/content/css/loading.css.ejs similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/css/loading.css.ejs rename to generators/client/templates/react/src/main/webapp/content/css/loading.css.ejs diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0.svg b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0.svg similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0.svg rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0.svg diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-192.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-192.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-192.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-192.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-256.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-256.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-256.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-256.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-384.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-384.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-384.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-384.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-512.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-512.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_0_head-512.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_0_head-512.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1.svg b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1.svg similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1.svg rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1.svg diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-192.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-192.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-192.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-192.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-256.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-256.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-256.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-256.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-384.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-384.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-384.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-384.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-512.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-512.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_1_head-512.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_1_head-512.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2.svg b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2.svg similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2.svg rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2.svg diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-192.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-192.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-192.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-192.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-256.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-256.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-256.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-256.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-384.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-384.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-384.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-384.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-512.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-512.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_2_head-512.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_2_head-512.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3.svg b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3.svg similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3.svg rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3.svg diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-192.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-192.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-192.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-192.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-256.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-256.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-256.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-256.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-384.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-384.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-384.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-384.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-512.png b/generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-512.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/jhipster_family_member_3_head-512.png rename to generators/client/templates/react/src/main/webapp/content/images/jhipster_family_member_3_head-512.png diff --git a/generators/client/templates/react/src/main/webapp/static/images/logo-jhipster.png b/generators/client/templates/react/src/main/webapp/content/images/logo-jhipster.png similarity index 100% rename from generators/client/templates/react/src/main/webapp/static/images/logo-jhipster.png rename to generators/client/templates/react/src/main/webapp/content/images/logo-jhipster.png diff --git a/generators/client/templates/react/webpack/webpack.common.js.ejs b/generators/client/templates/react/webpack/webpack.common.js.ejs index a3cd68a19232..7f12976c6131 100644 --- a/generators/client/templates/react/webpack/webpack.common.js.ejs +++ b/generators/client/templates/react/webpack/webpack.common.js.ejs @@ -138,7 +138,7 @@ module.exports = options => ({ { from: './node_modules/swagger-ui/dist/lib', to: 'swagger-ui/dist/lib' }, { from: './node_modules/swagger-ui/dist/swagger-ui.min.js', to: 'swagger-ui/dist/swagger-ui.min.js' }, { from: './<%= MAIN_SRC_DIR %>/swagger-ui/', to: 'swagger-ui' }, - { from: './<%= MAIN_SRC_DIR %>static/', to: 'content' }, + { from: './<%= MAIN_SRC_DIR %>content/', to: 'content' }, { from: './<%= MAIN_SRC_DIR %>favicon.ico', to: 'favicon.ico' }, { from: './<%= MAIN_SRC_DIR %>manifest.webapp', to: 'manifest.webapp' }, // jhipster-needle-add-assets-to-webpack - JHipster will add/remove third-party resources in this array diff --git a/generators/entity-client/templates/react/src/test/javascript/e2e/entities/entity.spec.ts.ejs b/generators/entity-client/templates/react/src/test/javascript/e2e/entities/entity.spec.ts.ejs index d74ae10380d8..ef470973acf1 100644 --- a/generators/entity-client/templates/react/src/test/javascript/e2e/entities/entity.spec.ts.ejs +++ b/generators/entity-client/templates/react/src/test/javascript/e2e/entities/entity.spec.ts.ejs @@ -52,7 +52,7 @@ describe('<%= entityClass %> e2e test', () => { let <%= entityInstance %>ComponentsPage: <%= entityClass %>ComponentsPage; <%= openBlockComment %>let <%= entityInstance %>DeleteDialog: <%= entityClass %>DeleteDialog;<%= closeBlockComment %> <%_ if (fieldsContainBlobOrImage) { _%> - const fileToUpload = '../../../../../../<%= entityParentPathAddition %><%= CLIENT_MAIN_SRC_DIR %>static/images/logo-jhipster.png'; + const fileToUpload = '../../../../../../<%= entityParentPathAddition %><%= CLIENT_MAIN_SRC_DIR %>content/images/logo-jhipster.png'; const absolutePath = path.resolve(__dirname, fileToUpload); <%_ } _%> From 758c1d089eb0b6b00760c30af31d6209b88103a4 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Tue, 11 Jun 2019 16:05:58 +0200 Subject: [PATCH 155/298] Hooks on password component --- .../modules/account/password/password.tsx.ejs | 126 +++++++++--------- 1 file changed, 61 insertions(+), 65 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs index 7585a3176355..ff0f873ee9f5 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { Translate, translate } from 'react-jhipster'; import { connect } from 'react-redux'; import { AvForm, AvField } from 'availity-reactstrap-validation'; @@ -29,93 +29,86 @@ import { savePassword, reset } from './password.reducer'; export interface IUserPasswordProps extends StateProps, DispatchProps {} -export interface IUserPasswordState { - password: string; -} +export const PasswordPage = (props: IUserPasswordProps) => { + const [password, setPassword] = useState(''); -export class PasswordPage extends React.Component { - state: IUserPasswordState = { - password: '' - }; - - componentDidMount() { - this.props.reset(); - this.props.getSession(); - } - - componentWillUnmount() { - this.props.reset(); - } + useEffect(() => { + props.reset(); + props.getSession(); + return () => props.reset(); + }, []); - handleValidSubmit = (event, values) => { - this.props.savePassword(values.currentPassword, values.newPassword); + const handleValidSubmit = (event, values) => { + props.savePassword(values.currentPassword, values.newPassword); }; - updatePassword = event => { - this.setState({ password: event.target.value }); - }; - - render() { - const { account } = this.props; - - return ( -
- - -

Password for {account.login}

- + const updatePassword = event => setPassword(event.target.value); + + return ( +
+ + +

+ + Password for {props.account.login} + +

+ - + - - -
-
- ); - } -} +
+ +
+
+ ); +}; const mapStateToProps = ({ authentication }: IRootState) => ({ account: authentication.account, @@ -127,4 +120,7 @@ const mapDispatchToProps = { getSession, savePassword, reset }; type StateProps = ReturnType; type DispatchProps = typeof mapDispatchToProps; -export default connect(mapStateToProps, mapDispatchToProps)(PasswordPage); +export default connect( + mapStateToProps, + mapDispatchToProps +)(PasswordPage); From ebfaf96deba132cfba25d5c87689187c4503dad3 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 11 Jun 2019 17:48:07 +0200 Subject: [PATCH 156/298] Release v6.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 160d496b933a..63bb17131416 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.0.1", + "version": "6.1.0", "description": "Spring Boot + Angular/React in one handy generator", "files": [ "cli", From 4c591b3c23c4dcf9337169d3c387aaa3c3199155 Mon Sep 17 00:00:00 2001 From: chrisdns Date: Tue, 11 Jun 2019 14:46:24 +0200 Subject: [PATCH 157/298] remove useless second api call to /api/account --- .../src/main/webapp/app/modules/home/home.tsx.ejs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs index ecf5f8e38dbf..0592d6ea7824 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs @@ -25,18 +25,13 @@ import { connect } from 'react-redux'; import { Row, Col, Alert } from 'reactstrap'; import { IRootState } from 'app/shared/reducers'; -import { getSession } from 'app/shared/reducers/authentication'; <%_ if (authenticationType === 'oauth2') { _%> import { getLoginUrl } from 'app/shared/util/url-utils'; <%_ } _%> -export interface IHomeProp extends StateProps, DispatchProps {} +export type IHomeProp = StateProps; export class Home extends React.Component { - componentDidMount() { - this.props.getSession(); - } - render() { const { account } = this.props; return ( @@ -128,9 +123,6 @@ const mapStateToProps = storeState => ({ isAuthenticated: storeState.authentication.isAuthenticated }); -const mapDispatchToProps = { getSession }; - type StateProps = ReturnType; -type DispatchProps = typeof mapDispatchToProps; -export default connect(mapStateToProps, mapDispatchToProps)(Home); +export default connect(mapStateToProps)(Home); From 29d2bff4941e696396553b908012ccc4511e7e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Wed, 12 Jun 2019 14:30:42 +0200 Subject: [PATCH 158/298] Added a noopcachemanager verification for user resources tests --- .../test/java/package/web/rest/UserResourceIT.java.ejs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs index c37b44d9bc38..432d7becbff5 100644 --- a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs @@ -54,6 +54,9 @@ import org.springframework.boot.test.context.SpringBootTest; <%_ if (cacheManagerIsAvailable === true) { _%> import org.springframework.cache.CacheManager; <%_ } _%> +<%_ if (cacheProvider === 'memcached' ) { _%> +import org.springframework.cache.support.NoOpCacheManager; +<%_ } _%> <%_ if (!reactive) { _%> import org.springframework.data.web.PageableHandlerMethodArgumentResolver; <%_ } _%> @@ -519,7 +522,7 @@ public class UserResourceIT <% if (databaseType === 'cassandra') { %>extends Abs <%_ if (searchEngine === 'elasticsearch') { _%> mockUserSearchRepository.save(user); <%_ } _%> - <%_ if (cacheManagerIsAvailable === true) { _%> + <%_ if (cacheManagerIsAvailable === true) { _%> assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); <%_ } _%> @@ -552,8 +555,11 @@ public class UserResourceIT <% if (databaseType === 'cassandra') { %>extends Abs <%_ } _%> .jsonPath("$.langKey").isEqualTo(DEFAULT_LANGKEY); <%_ } _%> - <%_ if (cacheManagerIsAvailable === true) { _%> + <%_ if (cacheProvider === 'memcached') { _%> + if(!(cacheManager instanceof NoOpCacheManager)) + assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); + <%_ } else if (cacheManagerIsAvailable === true) { _%> assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); <%_ } _%> } From aea87ebcc5883e12afc54d8fe1c85ce707bfe920 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Wed, 12 Jun 2019 15:49:02 +0200 Subject: [PATCH 159/298] add @octoconsulting as gold sponsor --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f0aaddccd1f7..dce9059f82c8 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Support this project by becoming a sponsor! [Become a sponsor](https://opencolle **Gold sponsors** [![Okta][okta-image]][okta-url] +[![Octo Consulting Group][octoconsulting-image]][octoconsulting-url] **Bronze sponsors** @@ -103,6 +104,8 @@ Additional builds at [hipster-labs/jhipster-daily-builds](https://github.com/hip [backers-url]: https://opencollective.com/generator-jhipster [okta-image]: https://www.jhipster.tech/images/open-collective/okta.png [okta-url]: https://developer.okta.com/signup?utm_source=JHipster&utm_medium=logo&utm_campaign=Gold-Sponsor +[octoconsulting-image]: https://www.jhipster.tech/images/open-collective/octoconsulting.png +[octoconsulting-url]: http://www.octoconsulting.com/ [forsyslab-image]: https://www.jhipster.tech/images/open-collective/forsyslab.jpg [forsyslab-url]: https://forsyslab.com/ [cubaplatform-image]: https://www.jhipster.tech/images/open-collective/cubaplatform.png From 4d626e1577b7baeed96d83a81cc6f746a8f4b067 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Wed, 12 Jun 2019 15:54:25 +0200 Subject: [PATCH 160/298] try to improve gold sponsors formatting --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index dce9059f82c8..e0263bb74a81 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,10 @@ Support this project by becoming a sponsor! [Become a sponsor](https://opencolle **Gold sponsors** [![Okta][okta-image]][okta-url] +[Okta][okta-url] + [![Octo Consulting Group][octoconsulting-image]][octoconsulting-url] +[Octo Consulting Group][octoconsulting-url] **Bronze sponsors** From 3f3e745cb52dee0752c5b57cca565db7f8a472a4 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Wed, 12 Jun 2019 22:38:13 +0530 Subject: [PATCH 161/298] Bump ng-bootstrap dependency --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index dbcab2fa77f5..9edc359e8f06 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -37,7 +37,7 @@ "@fortawesome/angular-fontawesome": "0.4.0", "@fortawesome/fontawesome-svg-core": "1.2.18", "@fortawesome/free-solid-svg-icons": "5.8.2", - "@ng-bootstrap/ng-bootstrap": "4.1.3", + "@ng-bootstrap/ng-bootstrap": "4.2.1", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "bootstrap": "4.3.1", From 79a678cd98f0bcda26e698dc3636d2e5c9f1ae33 Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Wed, 12 Jun 2019 16:23:31 -0400 Subject: [PATCH 162/298] Switch eclipse to use new generated sources directory (#9882) --- generators/server/templates/build.gradle.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 22733053ed36..470acdf767e6 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -95,7 +95,7 @@ eclipse { sourceSets { main { java { - srcDirs += ["build/generated/source/apt/main"] + srcDirs += ["build/generated/sources/annotationProcessor/java/main"] } } } From b79330792ded07fe6324d80e2a5ab892ce64fd06 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Wed, 12 Jun 2019 22:26:21 -0600 Subject: [PATCH 163/298] Add support for AuthToken with OAuth 2.0 Resource Server (#9905) --- .../oauth2/AuthorizationHeaderUtil.java.ejs | 26 +++++++++++-------- .../java/package/service/UserService.java.ejs | 18 ++++++++++--- .../package/web/rest/AccountResource.java.ejs | 6 ++--- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index 7474340ffc2f..cebd7ee5b9e9 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -18,14 +18,13 @@ -%> package <%=packageName%>.security.oauth2; -import java.util.Optional; - +import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; -import org.springframework.security.oauth2.core.OAuth2AccessToken; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; import org.springframework.stereotype.Component; import java.util.Optional; @@ -41,18 +40,23 @@ public class AuthorizationHeaderUtil { public Optional getAuthorizationHeader() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - OAuth2AuthenticationToken oauthToken = (OAuth2AuthenticationToken) authentication; - OAuth2AuthorizedClient client = clientService.loadAuthorizedClient( - oauthToken.getAuthorizedClientRegistrationId(), - oauthToken.getName()); - - OAuth2AccessToken accessToken = client.getAccessToken(); + String accessToken = null; + AbstractAuthenticationToken authToken = (AbstractAuthenticationToken) authentication; + if (authToken instanceof OAuth2AuthenticationToken) { + OAuth2AuthenticationToken oauthToken = (OAuth2AuthenticationToken) authToken; + OAuth2AuthorizedClient client = clientService.loadAuthorizedClient( + oauthToken.getAuthorizedClientRegistrationId(), + oauthToken.getName()); + accessToken = client.getAccessToken().getTokenValue(); + } else if (authToken instanceof JwtAuthenticationToken) { + accessToken = ((JwtAuthenticationToken) authToken).getToken().getTokenValue(); + } if (accessToken == null) { return Optional.empty(); } else { - String tokenType = accessToken.getTokenType().getValue(); - String authorizationHeaderValue = String.format("%s %s", tokenType, accessToken.getTokenValue()); + String tokenType = "Bearer"; + String authorizationHeaderValue = String.format("%s %s", tokenType, accessToken); return Optional.of(authorizationHeaderValue); } } diff --git a/generators/server/templates/src/main/java/package/service/UserService.java.ejs b/generators/server/templates/src/main/java/package/service/UserService.java.ejs index adcac8b49064..103a981b4035 100644 --- a/generators/server/templates/src/main/java/package/service/UserService.java.ejs +++ b/generators/server/templates/src/main/java/package/service/UserService.java.ejs @@ -62,8 +62,10 @@ import org.springframework.scheduling.annotation.Scheduled; <%_ } _%> <%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> +import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; <%_ } _%> <%_ if (authenticationType !== 'oauth2') { _%> import org.springframework.security.crypto.password.PasswordEncoder; @@ -774,19 +776,27 @@ public class UserService { return user; } <%_ } _%> + <%_ } // databaseType !== 'no' _%> <%_ if (authenticationType === 'oauth2') { _%> /** - * Returns the user from an OAuth 2.0 login. + * Returns the user from an OAuth 2.0 login or resource server with JWT. <%_ if (databaseType !== 'no') { _%> * Synchronizes the user in the local repository. <%_ } _%> * - * @param authToken OAuth2 authentication. + * @param authToken the authentication token. * @return the user from the authentication. */ - public UserDTO getUserFromAuthentication(OAuth2AuthenticationToken authToken) { - Map attributes = authToken.getPrincipal().getAttributes(); + public UserDTO getUserFromAuthentication(AbstractAuthenticationToken authToken) { + Map attributes; + if (authToken instanceof OAuth2AuthenticationToken) { + attributes = ((OAuth2AuthenticationToken) authToken).getPrincipal().getAttributes(); + } else if (authToken instanceof JwtAuthenticationToken) { + attributes = ((JwtAuthenticationToken) authToken).getTokenAttributes(); + } else { + throw new IllegalArgumentException("AuthenticationToken is not OAuth2 or JWT!"); + } <%= databaseType === 'no' ? asDto('User') : asEntity('User') %> user = getUser(attributes); user.setAuthorities(authToken.getAuthorities().stream() .map(GrantedAuthority::getAuthority) diff --git a/generators/server/templates/src/main/java/package/web/rest/AccountResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AccountResource.java.ejs index e4968337d763..f64df7215ad5 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AccountResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AccountResource.java.ejs @@ -24,7 +24,7 @@ import <%=packageName%>.service.dto.<%= asDto('User') %>; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; +import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -75,8 +75,8 @@ public class AccountResource { @GetMapping("/account") @SuppressWarnings("unchecked") public <%= asDto('User') %> getAccount(Principal principal) { - if (principal instanceof OAuth2AuthenticationToken) { - return userService.getUserFromAuthentication((OAuth2AuthenticationToken) principal); + if (principal instanceof AbstractAuthenticationToken) { + return userService.getUserFromAuthentication((AbstractAuthenticationToken) principal); } else { throw new AccountResourceException("User could not be found"); } From 45eab128e0c7fb0b0e3d71a99945e6dc278572fd Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 13 Jun 2019 20:00:19 +0530 Subject: [PATCH 164/298] Bump angular dependencies --- .../client/templates/angular/package.json.ejs | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 9edc359e8f06..70925c3a4fed 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -35,8 +35,8 @@ "@angular/platform-browser-dynamic": "8.0.0", "@angular/router": "8.0.0", "@fortawesome/angular-fontawesome": "0.4.0", - "@fortawesome/fontawesome-svg-core": "1.2.18", - "@fortawesome/free-solid-svg-icons": "5.8.2", + "@fortawesome/fontawesome-svg-core": "1.2.19", + "@fortawesome/free-solid-svg-icons": "5.9.0", "@ng-bootstrap/ng-bootstrap": "4.2.1", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", @@ -48,7 +48,7 @@ "moment": "2.24.0", "ng-jhipster": "0.10.1", "ngx-cookie": "4.0.2", - "ngx-infinite-scroll": "7.1.0", + "ngx-infinite-scroll": "7.2.0", "ngx-webstorage": "4.0.1", "rxjs": "6.5.2", "swagger-ui": "2.2.10", @@ -56,20 +56,20 @@ "sockjs-client": "1.3.0", "webstomp-client": "1.2.6", <%_ } _%> - "tslib": "1.9.3", + "tslib": "1.10.0", "zone.js": "0.9.1" }, "devDependencies": { - "@angular/cli": "8.0.0", + "@angular/cli": "8.0.2", "@angular/compiler-cli": "8.0.0", - "@ngtools/webpack": "8.0.0", + "@ngtools/webpack": "8.0.2", <%_ if (protractorTests) { _%> "@types/chai": "4.1.7", "@types/chai-string": "1.4.1", <%_ } _%> - "@types/jest": "24.0.13", + "@types/jest": "24.0.14", <%_ if (protractorTests) { _%> - "@types/mocha": "5.2.6", + "@types/mocha": "5.2.7", <%_ } _%> "@types/node": "10.12.27", <%_ if (protractorTests) { _%> @@ -77,34 +77,34 @@ <%_ } _%> "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", - "autoprefixer": "9.5.1", + "autoprefixer": "9.6.0", "base-href-webpack-plugin": "2.0.0", - "browser-sync": "2.26.5", + "browser-sync": "2.26.7", "browser-sync-webpack-plugin": "2.2.2", - "cache-loader": "3.0.1", + "cache-loader": "4.0.0", <%_ if (protractorTests) { _%> "chai": "4.2.0", "chai-as-promised": "7.1.1", "chai-string": "1.5.0", <%_ } _%> - "codelyzer": "5.0.1", + "codelyzer": "5.1.0", "copy-webpack-plugin": "5.0.3", - "css-loader": "2.1.1", - "file-loader": "3.0.1", - "fork-ts-checker-webpack-plugin": "1.3.4", + "css-loader": "3.0.0", + "file-loader": "4.0.0", + "fork-ts-checker-webpack-plugin": "1.3.6", "friendly-errors-webpack-plugin": "1.7.0", "generator-jhipster": "<%= packagejs.version %>", "html-loader": "0.5.5", "html-webpack-plugin": "3.2.0", <%_ if (!skipCommitHook) { _%> - "husky": "2.3.0", + "husky": "2.4.1", <%_ } _%> "jest": "24.8.0", "jest-junit": "6.4.0", "jest-preset-angular": "7.1.1", "jest-sonar-reporter": "2.0.0", <%_ if (!skipCommitHook) { _%> - "lint-staged": "8.1.7", + "lint-staged": "8.2.0", <%_ } _%> <%_ if (enableTranslation) { _%> "merge-jsons-webpack-plugin": "1.0.19", @@ -116,24 +116,24 @@ "moment-locales-webpack-plugin": "1.0.7", "optimize-css-assets-webpack-plugin": "5.0.1", "postcss-loader": "3.0.0", - "prettier": "1.17.1", + "prettier": "1.18.2", <%_ if (protractorTests) { _%> "protractor": "5.4.2", <%_ } _%> "reflect-metadata": "0.1.13", "rimraf": "2.6.3", - "sass": "1.20.1", + "sass": "1.21.0", "sass-loader": "7.1.0", "simple-progress-webpack-plugin": "1.1.2", "style-loader": "0.23.1", "terser-webpack-plugin": "1.3.0", "thread-loader": "2.1.2", "to-string-loader": "1.1.5", - "ts-loader": "6.0.1", + "ts-loader": "6.0.2", <%_ if (protractorTests) { _%> "ts-node": "8.2.0", <%_ } _%> - "tslint": "5.16.0", + "tslint": "5.17.0", "tslint-config-prettier": "1.18.0", "tslint-loader": "3.5.4", "typescript": "3.4.5", @@ -141,11 +141,11 @@ "<%= module.name %>": "<%= module.version %>", <%_ }); _%> <%_ if (protractorTests) { _%> - "webdriver-manager": "12.1.4", + "webdriver-manager": "12.1.5", <%_ } _%> - "webpack": "4.32.2", - "webpack-cli": "3.3.2", - "webpack-dev-server": "3.4.1", + "webpack": "4.34.0", + "webpack-cli": "3.3.4", + "webpack-dev-server": "3.7.1", "webpack-merge": "4.2.1", "webpack-notifier": "1.7.0", "webpack-visualizer-plugin": "0.1.11", @@ -156,7 +156,7 @@ }, "engines": { "node": ">=8.9.0"<% if (clientPackageManager === 'yarn') { %>, - "yarn": ">=1.3.2"<% } %> + "yarn": ">=1.16.0"<% } %> }, <%_ if (!skipCommitHook) { _%> "lint-staged": { From 7a70d97f98988cf0fe3f8c512ae37586d61387fd Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 13 Jun 2019 20:01:40 +0530 Subject: [PATCH 165/298] Sync angular cli json with latest schema --- .../client/templates/angular/angular.json.ejs | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/generators/client/templates/angular/angular.json.ejs b/generators/client/templates/angular/angular.json.ejs index ccda191421c6..1e47480e88fb 100644 --- a/generators/client/templates/angular/angular.json.ejs +++ b/generators/client/templates/angular/angular.json.ejs @@ -25,33 +25,29 @@ "root": "", "sourceRoot": "<%= MAIN_SRC_DIR.replace(/\/$/, "") %>", "projectType": "application", - "architect": {} - } + "schematics": { + "@schematics/angular:component": { + "skipTests": true, + "style": "scss" + }, + "@schematics/angular:directive": { + "skipTests": true + }, + "@schematics/angular:guard": { + "skipTests": true + }, + "@schematics/angular:pipe": { + "skipTests": true + }, + "@schematics/angular:service": { + "skipTests": true + } + }, + "prefix": "<%= jhiPrefixDashed %>", + "architect": {} }, "defaultProject": "<%= dasherizedBaseName %>", "cli": { "packageManager": "<%= clientPackageManager %>" - }, - "schematics": { - "@schematics/angular:component": { - "inlineStyle": true, - "inlineTemplate": false, - "spec": false, - "prefix": "<%= jhiPrefixDashed %>", - "styleExt": "scss" - }, - "@schematics/angular:directive": { - "spec": false, - "prefix": "<%= jhiPrefixDashed %>" - }, - "@schematics/angular:guard": { - "spec": false - }, - "@schematics/angular:pipe": { - "spec": false - }, - "@schematics/angular:service": { - "spec": false - } } } From 66dcf0483ebbd394ee2a856161dc0f799a5829a0 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Thu, 13 Jun 2019 20:21:15 +0530 Subject: [PATCH 166/298] Fix angular json --- .../client/templates/angular/angular.json.ejs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/generators/client/templates/angular/angular.json.ejs b/generators/client/templates/angular/angular.json.ejs index 1e47480e88fb..b9c1d4cdc196 100644 --- a/generators/client/templates/angular/angular.json.ejs +++ b/generators/client/templates/angular/angular.json.ejs @@ -42,12 +42,13 @@ "@schematics/angular:service": { "skipTests": true } + }, + "prefix": "<%= jhiPrefixDashed %>", + "architect": {} }, - "prefix": "<%= jhiPrefixDashed %>", - "architect": {} - }, - "defaultProject": "<%= dasherizedBaseName %>", - "cli": { - "packageManager": "<%= clientPackageManager %>" + "defaultProject": "<%= dasherizedBaseName %>", + "cli": { + "packageManager": "<%= clientPackageManager %>" + } } } From 300beeb21bfaf6e1d2bf37f9e971c7370b538fd5 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sat, 8 Jun 2019 08:30:36 +0200 Subject: [PATCH 167/298] refresh oauth2 token when use feign and extract authorization --- generators/server/files.js | 8 + .../config/SecurityConfiguration.java.ejs | 172 +++++++++--------- .../package/security/SecurityUtils.java.ejs | 73 ++++++-- .../oauth2/AuthorizationHeaderUtil.java.ejs | 141 ++++++++++++-- .../oauth2/JwtAuthorityExtractor.java.ejs | 39 ++++ .../oauth2/OAuthIdpTokenResponseDTO.java.ejs | 159 ++++++++++++++++ .../java/package/service/UserService.java.ejs | 3 - test/utils/expected-files.js | 3 + 8 files changed, 475 insertions(+), 123 deletions(-) create mode 100644 generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs create mode 100644 generators/server/templates/src/main/java/package/security/oauth2/OAuthIdpTokenResponseDTO.java.ejs diff --git a/generators/server/files.js b/generators/server/files.js index 7c5ff9664435..38c5dcb3cacb 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -444,6 +444,14 @@ const serverFiles = { { file: 'package/security/oauth2/AudienceValidator.java', renameTo: generator => `${generator.javaDir}security/oauth2/AudienceValidator.java` + }, + { + file: 'package/security/oauth2/JwtAuthorityExtractor.java', + renameTo: generator => `${generator.javaDir}security/oauth2/JwtAuthorityExtractor.java` + }, + { + file: 'package/security/oauth2/OAuthIdpTokenResponseDTO.java', + renameTo: generator => `${generator.javaDir}security/oauth2/OAuthIdpTokenResponseDTO.java` } ] }, diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index a27c1fd4c867..66d0db0836a2 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -20,52 +20,52 @@ package <%= packageName %>.config; <%_ if (authenticationType === 'session' || authenticationType === 'jwt' || authenticationType === 'oauth2') { _%> import <%= packageName %>.security.*; -<%_ if (authenticationType === 'jwt') { _%> + <%_ if (authenticationType === 'jwt') { _%> import <%= packageName %>.security.jwt.*; -<%_ } _%> -<%_ if (authenticationType === 'session') { _%> + <%_ } _%> + <%_ if (authenticationType === 'session') { _%> - <%_ if (!skipUserManagement) { _%> + <%_ if (!skipUserManagement) { _%> import io.github.jhipster.config.JHipsterProperties; - <%_ } _%> + <%_ } _%> import io.github.jhipster.security.*; -<%_ } _%> + <%_ } _%> -<%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> + <%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.InitializingBean; -<%_ } _%> + <%_ } _%> import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; -<%_ if (authenticationType !== 'uaa' && !(applicationType === 'microservice' && authenticationType === 'oauth2')) { _%> + <%_ if (authenticationType !== 'uaa' && !(applicationType === 'microservice' && authenticationType === 'oauth2')) { _%> import org.springframework.http.HttpMethod; -<%_ } _%> + <%_ } _%> import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -<%_ if (authenticationType !== 'uaa' && !(applicationType === 'microservice' && authenticationType === 'oauth2')) { _%> + <%_ if (authenticationType !== 'uaa' && !(applicationType === 'microservice' && authenticationType === 'oauth2')) { _%> import org.springframework.security.config.annotation.web.builders.WebSecurity; -<%_ } _%> + <%_ } _%> import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -<%_ if (authenticationType === 'jwt' || (authenticationType === 'oauth2' && applicationType === 'microservice')) { _%> + <%_ if (authenticationType === 'jwt' || (authenticationType === 'oauth2' && applicationType === 'microservice')) { _%> import org.springframework.security.config.http.SessionCreationPolicy; -<%_ } _%> -<%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> + <%_ } _%> + <%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; -<%_ } _%> -<%_ if (authenticationType === 'oauth2') { _%> + <%_ } _%> + <%_ if (authenticationType === 'oauth2') { _%> import org.springframework.core.convert.converter.Converter; import org.springframework.security.authentication.AbstractAuthenticationToken; import <%= packageName %>.security.oauth2.AudienceValidator; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jwt.*; + <%_ if (applicationType === 'gateway') { _%> import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; - <%_ if (applicationType === 'gateway') { _%> import <%=packageName%>.security.oauth2.AuthorizationHeaderFilter; import <%=packageName%>.security.oauth2.AuthorizationHeaderUtil; - <%_ } _%> + <%_ } _%> import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; @@ -75,25 +75,26 @@ import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; <%_ } _%> import java.util.*; import java.util.stream.Collectors; -<%_ } _%> -<%_ if (authenticationType === 'session') { _%> - <%_ if (!skipUserManagement) { _%> -import org.springframework.security.web.authentication.RememberMeServices; <%_ } _%> + <%_ if (authenticationType === 'session') { _%> + <%_ if (!skipUserManagement) { _%> +import org.springframework.security.web.authentication.RememberMeServices; + <%_ } _%> import org.springframework.security.web.csrf.CookieCsrfTokenRepository; import org.springframework.security.web.csrf.CsrfFilter; -<%_ } _%> -<%_ if (authenticationType === 'oauth2' && applicationType !== 'microservice') { _%> + <%_ } _%> + <%_ if (authenticationType === 'oauth2' && applicationType !== 'microservice') { _%> import org.springframework.security.web.csrf.CookieCsrfTokenRepository; import org.springframework.security.web.csrf.CsrfFilter; -<%_ } _%> -<%_ if (authenticationType === 'jwt' && applicationType !== 'microservice') { _%> +import <%=packageName%>.security.oauth2.JwtAuthorityExtractor; + <%_ } _%> + <%_ if (authenticationType === 'jwt' && applicationType !== 'microservice') { _%> import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -<%_ } _%> + <%_ } _%> + <%_ if (applicationType !== 'microservice') { _%> import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter; -<%_ if (applicationType !== 'microservice') { _%> import org.springframework.web.filter.CorsFilter; -<%_ } _%> + <%_ } _%> import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport; @EnableWebSecurity @@ -121,17 +122,17 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> private final SecurityProblemSupport problemSupport; - public SecurityConfiguration(<% if (authenticationType === 'session' && !skipUserManagement) { %>JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices, <% } if (authenticationType === 'jwt') { %>TokenProvider tokenProvider, <% } %><% if (applicationType !== 'microservice') { %>CorsFilter corsFilter, <% } %>SecurityProblemSupport problemSupport) { - <%_ if (authenticationType === 'session' && !skipUserManagement) { _%> + public SecurityConfiguration(<% if (authenticationType === 'session' && !skipUserManagement) { %>JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices, <% } if (authenticationType === 'jwt') { %>TokenProvider tokenProvider, <% } %><% if (applicationType !== 'microservice') { %>CorsFilter corsFilter, <% } %><% if (authenticationType === 'oauth2') { %>JwtAuthorityExtractor jwtAuthorityExtractor<% } %>SecurityProblemSupport problemSupport) { + <%_ if (authenticationType === 'session' && !skipUserManagement) { _%> this.jHipsterProperties = jHipsterProperties; this.rememberMeServices = rememberMeServices; - <%_ } _%> - <%_ if (authenticationType === 'jwt') { _%> + <%_ } _%> + <%_ if (authenticationType === 'jwt') { _%> this.tokenProvider = tokenProvider; - <%_ } _%> - <%_ if (applicationType !== 'microservice') { _%> + <%_ } _%> + <%_ if (applicationType !== 'microservice') { _%> this.corsFilter = corsFilter; - <%_ } _%> + <%_ } _%> this.problemSupport = problemSupport; } <%_ if (authenticationType === 'session') { _%> @@ -145,8 +146,6 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { public AjaxAuthenticationFailureHandler ajaxAuthenticationFailureHandler() { return new AjaxAuthenticationFailureHandler(); } - <%_ } _%> - <%_ if (authenticationType === 'session') { _%> @Bean public AjaxLogoutSuccessHandler ajaxLogoutSuccessHandler() { @@ -160,20 +159,20 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { return new BCryptPasswordEncoder(); } <%_ } _%> - <%_ if (authenticationType !== 'uaa' && !(applicationType === 'microservice' && authenticationType === 'oauth2')) { _%> + <%_ if (authenticationType !== 'uaa' && applicationType !== 'microservice') { _%> @Override public void configure(WebSecurity web) throws Exception { web.ignoring() .antMatchers(HttpMethod.OPTIONS, "/**") - <%_ if (!skipClient) { _%> + <%_ if (!skipClient) { _%> .antMatchers("/app/**/*.{js,html}") .antMatchers("/i18n/**") .antMatchers("/content/**") - <%_ } _%> - <%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%> + <%_ } _%> + <%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%> .antMatchers("/h2-console/**") - <%_ } _%> + <%_ } _%> .antMatchers("/swagger-ui/index.html") .antMatchers("/test/**"); } @@ -184,46 +183,46 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { // @formatter:off http .csrf() - <%_ if (['session','oauth2'].includes(authenticationType) && applicationType !== 'microservice') { _%> + <%_ if (['session','oauth2'].includes(authenticationType) && applicationType !== 'microservice') { _%> .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) .and() - <%_ } else{ _%> + <%_ } else{ _%> .disable() - <%_ } _%> - <%_ if (applicationType !== 'microservice') { _%> - <%_ if (authenticationType === 'jwt') { _%> + <%_ } _%> + <%_ if (applicationType !== 'microservice') { _%> + <%_ if (authenticationType === 'jwt') { _%> .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) - <%_ } else if (authenticationType === 'session' || authenticationType === 'oauth2') { _%> + <%_ } else if (authenticationType === 'session' || authenticationType === 'oauth2') { _%> .addFilterBefore(corsFilter, CsrfFilter.class) - <%_ } _%> - <%_ } _%> + <%_ } _%> + <%_ } _%> .exceptionHandling() - <%_ if (authenticationType !== 'oauth2') { _%> + <%_ if (authenticationType !== 'oauth2') { _%> .authenticationEntryPoint(problemSupport) - <%_ } _%> + <%_ } _%> .accessDeniedHandler(problemSupport) - <%_ if (authenticationType === 'session') { _%> - <%_ if (!skipUserManagement) { _%> + <%_ if (authenticationType === 'session') { _%> + <%_ if (!skipUserManagement) { _%> .and() .rememberMe() .rememberMeServices(rememberMeServices) .rememberMeParameter("remember-me") .key(jHipsterProperties.getSecurity().getRememberMe().getKey()) - <%_ } _%> + <%_ } _%> .and() .formLogin() .loginProcessingUrl("/api/authentication") .successHandler(ajaxAuthenticationSuccessHandler()) .failureHandler(ajaxAuthenticationFailureHandler()) .permitAll() - <%_ } _%> - <%_ if (authenticationType === 'session') { _%> + <%_ } _%> + <%_ if (authenticationType === 'session') { _%> .and() .logout() .logoutUrl("/api/logout") .logoutSuccessHandler(ajaxLogoutSuccessHandler()) .permitAll() - <%_ } _%> + <%_ } _%> .and() .headers() .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'") @@ -235,50 +234,53 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .frameOptions() .deny() .and() - <%_ if (authenticationType === 'jwt' || (authenticationType === 'oauth2' && applicationType === 'microservice')) { _%> + <%_ if (authenticationType === 'jwt' || (authenticationType === 'oauth2' && applicationType === 'microservice')) { _%> .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() - <%_ } _%> + <%_ } _%> .authorizeRequests() - <%_ if (authenticationType !== 'oauth2') { _%> + <%_ if (authenticationType !== 'oauth2') { _%> .antMatchers("/api/authenticate").permitAll() - <%_ } _%> - <%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> + <%_ } _%> + <%_ if (authenticationType !== 'oauth2' && !skipUserManagement) { _%> .antMatchers("/api/register").permitAll() .antMatchers("/api/activate").permitAll() .antMatchers("/api/account/reset-password/init").permitAll() .antMatchers("/api/account/reset-password/finish").permitAll() - <%_ } _%> - <%_ if (authenticationType === 'oauth2') { _%> + <%_ } _%> + <%_ if (authenticationType === 'oauth2') { _%> .antMatchers("/api/auth-info").permitAll() - <%_ } _%> + <%_ } _%> .antMatchers("/api/**").authenticated() - <%_ if (websocket === 'spring-websocket') { _%> + <%_ if (websocket === 'spring-websocket') { _%> .antMatchers("/websocket/tracker").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/websocket/**").permitAll() - <%_ } _%> + <%_ } _%> .antMatchers("/management/health").permitAll() .antMatchers("/management/info").permitAll() .antMatchers("/management/prometheus").permitAll() .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)<%_ if (authenticationType === 'session') { %>;<% } %> - <%_ if (authenticationType === 'jwt') { _%> - <%_ if (applicationType === 'monolith') { _%> + <%_ if (authenticationType === 'jwt') { _%> + <%_ if (applicationType === 'monolith') { _%> .and() .httpBasic() - <%_ } _%> + <%_ } _%> .and() .apply(securityConfigurerAdapter()); - <%_ } else if (authenticationType === 'oauth2') { _%> - <%_ if (['monolith', 'gateway'].includes(applicationType)) { _%> + <%_ } else if (authenticationType === 'oauth2') { _%> + <%_ if (['monolith', 'gateway'].includes(applicationType)) { _%> .and() .oauth2Login() - <%_ } _%> + <%_ } _%> .and() .oauth2ResourceServer() .jwt() - .jwtAuthenticationConverter(mapGroupOrRolesClaimToGrantedAuthorities()); - <%_ } _%> + .jwtAuthenticationConverter(jwtAuthorityExtractor) + .and() + .and() + .oauth2Client(); + <%_ } _%> // @formatter:on } <%_ if (authenticationType === 'jwt') { _%> @@ -377,10 +379,10 @@ import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; import org.springframework.security.web.csrf.CookieCsrfTokenRepository; -<%_ if (applicationType === 'gateway') { _%> + <%_ if (applicationType === 'gateway') { _%> import org.springframework.security.web.csrf.CsrfFilter; import org.springframework.web.filter.CorsFilter; -<%_ } _%> + <%_ } _%> import org.springframework.web.client.RestTemplate; @Configuration @@ -395,23 +397,23 @@ public class SecurityConfiguration extends ResourceServerConfigurerAdapter { <%_ } _%> public SecurityConfiguration(OAuth2Properties oAuth2Properties<% if (applicationType === 'gateway') { %>, CorsFilter corsFilter<% } %>) { this.oAuth2Properties = oAuth2Properties; - <%_ if (applicationType === 'gateway') { _%> + <%_ if (applicationType === 'gateway') { _%> this.corsFilter = corsFilter; - <%_ } _%> + <%_ } _%> } @Override public void configure(HttpSecurity http) throws Exception { http .csrf() - <%_ if (applicationType === 'gateway') { _%> + <%_ if (applicationType === 'gateway') { _%> .ignoringAntMatchers("/h2-console/**") .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) .and() .addFilterBefore(corsFilter, CsrfFilter.class) - <%_ } else { _%> + <%_ } else { _%> .disable() - <%_ } _%> + <%_ } _%> .headers() .frameOptions() .disable() diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index fc3c6ab9ed0b..922b310a5326 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -18,6 +18,11 @@ -%> package <%=packageName%>.security; +<%_ if (authenticationType === 'oauth2') { _%> +import net.minidev.json.JSONArray; +import net.minidev.json.JSONObject; +import org.springframework.security.core.GrantedAuthority; +<%_ } _%> <%_ if (reactive) { _%> import org.springframework.security.core.context.ReactiveSecurityContextHolder; <%_ } _%> @@ -28,6 +33,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; <%_ if (authenticationType === 'oauth2') { _%> import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; <%_ } _%> <%_ if (reactive) { _%> import reactor.core.publisher.Mono; @@ -35,8 +41,10 @@ import reactor.core.publisher.Mono; <%_ if (!reactive) { _%> <%_ if (authenticationType === 'oauth2') { _%> +import java.util.ArrayList; +import java.util.List; import java.util.Map; -<%_ } _%> + <%_ } _%> import java.util.Optional; <%_ } _%> @@ -54,31 +62,33 @@ public final class SecurityUtils { * @return the login of the current user. */ public static <% if (!reactive) { %>Optional<% } else { %>Mono<% } %> getCurrentUserLogin() { - <%_ if (!reactive) { _%> +<%_ if (!reactive) { _%> SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) - <%_ } else { _%> +<%_ } else { _%> return ReactiveSecurityContextHolder.getContext() .map(SecurityContext::getAuthentication) - <%_ } _%> +<%_ } _%> .map(authentication -> { if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); - <%_ if (authenticationType === 'oauth2') { _%> +<%_ if (authenticationType === 'oauth2') { _%> + } else if (authentication instanceof JwtAuthenticationToken) { + return (String) ((JwtAuthenticationToken)authentication).getToken().getClaims().get("preferred_username"); } else if (authentication.getPrincipal() instanceof DefaultOidcUser) { Map attributes = ((DefaultOidcUser) authentication.getPrincipal()).getAttributes(); if (attributes.containsKey("preferred_username")) { return (String) attributes.get("preferred_username"); } - <%_ } _%> +<%_ } _%> } else if (authentication.getPrincipal() instanceof String) { return (String) authentication.getPrincipal(); } return null; }); } - <%_ if (authenticationType === 'jwt') { _%> +<%_ if (authenticationType === 'jwt') { _%> /** * Get the JWT of the current user. @@ -96,7 +106,7 @@ public final class SecurityUtils { .filter(authentication -> authentication.getCredentials() instanceof String) .map(authentication -> (String) authentication.getCredentials()); } - <%_ } _%> +<%_ } _%> /** * Check if a user is authenticated. @@ -104,15 +114,25 @@ public final class SecurityUtils { * @return true if the user is authenticated, false otherwise. */ public static <% if (!reactive) { %>boolean<% } else { %>Mono<% } %> isAuthenticated() { - <%_ if (!reactive) { _%> +<%_ if (!reactive) { _%> SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) - <%_ } else { _%> +<%_ } else { _%> return ReactiveSecurityContextHolder.getContext() .map(SecurityContext::getAuthentication) - <%_ } _%> - .map(authentication -> authentication.getAuthorities().stream() - .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)))<% if (!reactive) { %> +<%_ } _%> + .map(authentication -> { + List authorities = new ArrayList<>(); + if (authentication instanceof JwtAuthenticationToken) { + authorities.addAll( + extractAuthorityFromClaims(((JwtAuthenticationToken) authentication).getToken() + .getClaims())); + } else { + authorities.addAll(authentication.getAuthorities()); + } + return authorities.stream() + .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)); + })<% if (!reactive) { %> .orElse(false)<% } %>; } @@ -125,15 +145,32 @@ public final class SecurityUtils { * @return true if the current user has the authority, false otherwise. */ public static <% if (!reactive) { %>boolean<% } else { %>Mono<% } %> isCurrentUserInRole(String authority) { - <%_ if (!reactive) { _%> +<%_ if (!reactive) { _%> SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) - <%_ } else { _%> +<%_ } else { _%> return ReactiveSecurityContextHolder.getContext() .map(SecurityContext::getAuthentication) - <%_ } _%> - .map(authentication -> authentication.getAuthorities().stream() - .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority)))<% if (!reactive) { %> +<%_ } _%> + .map(authentication -> { + List authorities = new ArrayList<>(); + if (authentication instanceof JwtAuthenticationToken) { + authorities.addAll( + extractAuthorityFromClaims(((JwtAuthenticationToken) authentication).getToken() + .getClaims())); + } else { + authorities.addAll(authentication.getAuthorities()); + } + return authorities.stream() + .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority)); + })<% if (!reactive) { %> .orElse(false)<% } %>; } + + public static List extractAuthorityFromClaims(Map claims) { + return ((JSONArray)((JSONObject)claims.get("realm_access")).get("roles")).stream() + .map(group -> ((String) group)) + .filter(group -> group.startsWith("ROLE_")) + .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); + } } diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index cebd7ee5b9e9..dc65cbdb0328 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -19,45 +19,152 @@ package <%=packageName%>.security.oauth2; import org.springframework.security.authentication.AbstractAuthenticationToken; +import java.net.URI; +import java.time.Duration; +import java.time.Instant; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.http.MediaType; +import org.springframework.http.RequestEntity; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.FormHttpMessageConverter; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; +import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler; +import org.springframework.security.oauth2.core.*; +import org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse; +import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; +import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; import org.springframework.stereotype.Component; - -import java.util.Optional; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; @Component public class AuthorizationHeaderUtil { private final OAuth2AuthorizedClientService clientService; + private final Logger log = LoggerFactory.getLogger(AuthorizationHeaderUtil.class); + public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService) { this.clientService = clientService; } public Optional getAuthorizationHeader() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - String accessToken = null; - AbstractAuthenticationToken authToken = (AbstractAuthenticationToken) authentication; - if (authToken instanceof OAuth2AuthenticationToken) { - OAuth2AuthenticationToken oauthToken = (OAuth2AuthenticationToken) authToken; + if (authentication instanceof OAuth2AuthenticationToken) { + OAuth2AuthenticationToken oauthToken = (OAuth2AuthenticationToken) authentication; + String name = oauthToken.getName(); + String registrationId = oauthToken.getAuthorizedClientRegistrationId(); OAuth2AuthorizedClient client = clientService.loadAuthorizedClient( - oauthToken.getAuthorizedClientRegistrationId(), - oauthToken.getName()); - accessToken = client.getAccessToken().getTokenValue(); - } else if (authToken instanceof JwtAuthenticationToken) { - accessToken = ((JwtAuthenticationToken) authToken).getToken().getTokenValue(); - } + registrationId, + name); - if (accessToken == null) { - return Optional.empty(); - } else { - String tokenType = "Bearer"; - String authorizationHeaderValue = String.format("%s %s", tokenType, accessToken); + if (null == client) { + throw new OAuth2AuthorizationException(new OAuth2Error("access_denied", "The token is expired", null)); + // resolves some refresh cases, but not all + } + OAuth2AccessToken accessToken = client.getAccessToken(); + + if (accessToken != null) { + String tokenType = accessToken.getTokenType().getValue(); + String accessTokenValue = accessToken.getTokenValue(); + if (isExpired(accessToken)) { + log.info("AccessToken expired, refreshing automatically"); + accessTokenValue = refreshToken(client, oauthToken); + if (null == accessTokenValue) { + SecurityContextHolder.getContext().setAuthentication(null); + throw new OAuth2AuthorizationException(new OAuth2Error("access_denied", "The token is expired", null)); + } + } + String authorizationHeaderValue = String.format("%s %s", tokenType, accessTokenValue); + return Optional.of(authorizationHeaderValue); + } + } else if (authentication instanceof JwtAuthenticationToken) { // Service to service + JwtAuthenticationToken accessToken = (JwtAuthenticationToken) authentication; + String tokenType = (String) accessToken.getToken().getClaims().get("typ"); + String tokenValue = accessToken.getToken().getTokenValue(); + String authorizationHeaderValue = String.format("%s %s", tokenType, tokenValue); return Optional.of(authorizationHeaderValue); } + return Optional.empty(); + } + + private String refreshToken(OAuth2AuthorizedClient client, OAuth2AuthenticationToken oauthToken) { + OAuth2AccessTokenResponse atr = refreshTokenClient(client); + if (atr == null || atr.getAccessToken() == null) { + log.info("Failed to refresh token for ${currentUser.name}"); + return null; + } + + OAuth2RefreshToken refreshToken = atr.getRefreshToken() != null? atr.getRefreshToken(): client.getRefreshToken(); + OAuth2AuthorizedClient updatedClient = new OAuth2AuthorizedClient( + client.getClientRegistration(), + client.getPrincipalName(), + atr.getAccessToken(), + refreshToken + ); + + clientService.saveAuthorizedClient(updatedClient, oauthToken); + return atr.getAccessToken().getTokenValue(); + } + + private OAuth2AccessTokenResponse refreshTokenClient(OAuth2AuthorizedClient currentClient ) { + + MultiValueMap formParameters = new LinkedMultiValueMap<>(); + formParameters.add(OAuth2ParameterNames.GRANT_TYPE, AuthorizationGrantType.REFRESH_TOKEN.getValue()); + formParameters.add(OAuth2ParameterNames.REFRESH_TOKEN, currentClient.getRefreshToken().getTokenValue()); + formParameters.add(OAuth2ParameterNames.CLIENT_ID, currentClient.getClientRegistration().getClientId()); + RequestEntity requestEntity = RequestEntity + .post(URI.create(currentClient.getClientRegistration().getProviderDetails().getTokenUri())) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .body(formParameters); + try { + RestTemplate r = restTemplate(currentClient.getClientRegistration().getClientId(), currentClient.getClientRegistration().getClientSecret()); + ResponseEntity responseEntity = r.exchange(requestEntity, OAuthIdpTokenResponseDTO.class); + return toOAuth2AccessTokenResponse(responseEntity.getBody()); + } catch (OAuth2AuthorizationException e) { + log.error("Unable to refresh token ${e.error.errorCode}"); + throw new OAuth2AuthenticationException(e.getError(), e); + } + } + + private OAuth2AccessTokenResponse toOAuth2AccessTokenResponse(OAuthIdpTokenResponseDTO oAuthIdpResponse) { + Map additionalParameters = new HashMap<>(); + additionalParameters.put("id_token", oAuthIdpResponse.getIdToken()); + additionalParameters.put("not-before-policy", oAuthIdpResponse.getNotBefore()); + additionalParameters.put("refresh_expires_in", oAuthIdpResponse.getRefreshExpiresIn()); + additionalParameters.put("session_state", oAuthIdpResponse.getSessionState()); + return OAuth2AccessTokenResponse.withToken(oAuthIdpResponse.getAccessToken()) + .expiresIn(oAuthIdpResponse.getExpiresIn()) + .refreshToken(oAuthIdpResponse.getRefreshToken()) + .scopes(Pattern.compile("\\s").splitAsStream(oAuthIdpResponse.getScope()).collect(Collectors.toSet())) + .tokenType(OAuth2AccessToken.TokenType.BEARER) + .additionalParameters(additionalParameters) + .build(); + } + + private RestTemplate restTemplate(String clientId, String clientSecret) { + return restTemplateBuilder + .additionalMessageConverters( + new FormHttpMessageConverter(), + new OAuth2AccessTokenResponseHttpMessageConverter()) + .errorHandler(new OAuth2ErrorResponseErrorHandler()) + .basicAuthentication(clientId, clientSecret) + .build(); + } + + private boolean isExpired(OAuth2AccessToken accessToken) { + Instant now = Instant.now(); + Instant expiresAt = accessToken.getExpiresAt(); + return now.isAfter(expiresAt.minus(Duration.ofMinutes(1L))); } } diff --git a/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs new file mode 100644 index 000000000000..e3dcf364939f --- /dev/null +++ b/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs @@ -0,0 +1,39 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://jhipster.github.io/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.security.oauth2; + +import <%=packageName%>.security.SecurityUtils; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.oauth2.jwt.Jwt; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; + +import java.util.Collection; + +@Component +public class JwtAuthorityExtractor extends JwtAuthenticationConverter { + + public JwtAuthorityExtractor() { + } + + @Override + protected Collection extractAuthorities(Jwt jwt) { + return SecurityUtils.extractAuthorityFromClaims(jwt.getClaims()); + } +} diff --git a/generators/server/templates/src/main/java/package/security/oauth2/OAuthIdpTokenResponseDTO.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/OAuthIdpTokenResponseDTO.java.ejs new file mode 100644 index 000000000000..5d8b96004689 --- /dev/null +++ b/generators/server/templates/src/main/java/package/security/oauth2/OAuthIdpTokenResponseDTO.java.ejs @@ -0,0 +1,159 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://jhipster.github.io/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.security.oauth2; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.io.Serializable; +import java.util.UUID; + +public class OAuthIdpTokenResponseDTO implements Serializable { + + @JsonProperty("token_type") + private String tokenType; + + private String scope; + + @JsonProperty("expires_in") + private Long expiresIn; + + @JsonProperty("ext_expires_in") + private Long extExpiresIn; + + @JsonProperty("expires_on") + private Long expiresOn; + + @JsonProperty("not-before-policy") + private Long notBefore; + + private UUID resource; + + @JsonProperty("access_token") + private String accessToken; + + @JsonProperty("refresh_token") + private String refreshToken; + + @JsonProperty("id_token") + private String idToken; + + @JsonProperty("session_state") + private String sessionState; + + @JsonProperty("refresh_expires_in") + private String refreshExpiresIn; + + public OAuthIdpTokenResponseDTO() {} + + public String getRefreshExpiresIn() { + return refreshExpiresIn; + } + + public void setRefreshExpiresIn(String refreshExpiresIn) { + this.refreshExpiresIn = refreshExpiresIn; + } + + public String getSessionState() { + return sessionState; + } + + public void setSessionState(String sessionState) { + this.sessionState = sessionState; + } + + public String getTokenType() { + return tokenType; + } + + public void setTokenType(String tokenType) { + this.tokenType = tokenType; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public Long getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(Long expiresIn) { + this.expiresIn = expiresIn; + } + + public Long getExtExpiresIn() { + return extExpiresIn; + } + + public void setExtExpiresIn(Long extExpiresIn) { + this.extExpiresIn = extExpiresIn; + } + + public Long getExpiresOn() { + return expiresOn; + } + + public void setExpiresOn(Long expiresOn) { + this.expiresOn = expiresOn; + } + + public Long getNotBefore() { + return notBefore; + } + + public void setNotBefore(Long notBefore) { + this.notBefore = notBefore; + } + + public UUID getResource() { + return resource; + } + + public void setResource(UUID resource) { + this.resource = resource; + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public String getIdToken() { + return idToken; + } + + public void setIdToken(String idToken) { + this.idToken = idToken; + } +} diff --git a/generators/server/templates/src/main/java/package/service/UserService.java.ejs b/generators/server/templates/src/main/java/package/service/UserService.java.ejs index 103a981b4035..cd2f2cf42c1a 100644 --- a/generators/server/templates/src/main/java/package/service/UserService.java.ejs +++ b/generators/server/templates/src/main/java/package/service/UserService.java.ejs @@ -92,9 +92,6 @@ import java.util.*; <%_ if (!reactive) { _%> import java.util.stream.Collectors; <%_ } _%> -<%_ if (authenticationType === 'oauth2' && databaseType !== 'no') { _%> -import java.util.stream.Stream; -<%_ } _%> /** * Service class for managing users. diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index 20f8ee1021b1..67cbf1a0447d 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -569,6 +569,9 @@ const expectedFiles = { oauth2: [ `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/SecurityConfiguration.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/security/oauth2/JwtAuthorityExtractor.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/security/oauth2/AudienceValidator.java`, + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/security/oauth2/OAuthIdpTokenResponseDTO.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/domain/User.java`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/AccountResource.java`, `${DOCKER_DIR}keycloak.yml` From 5d66f6af1cf02cc11dfae4d87e097c864f112fbc Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sat, 8 Jun 2019 18:49:06 +0200 Subject: [PATCH 168/298] missing bracket --- .../config/SecurityConfiguration.java.ejs | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 66d0db0836a2..23017fbc0680 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -69,10 +69,10 @@ import <%=packageName%>.security.oauth2.AuthorizationHeaderUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; -<%_ if (applicationType !== 'microservice') { _%> + <%_ if (applicationType !== 'microservice') { _%> import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; -<%_ } _%> + <%_ } _%> import java.util.*; import java.util.stream.Collectors; <%_ } _%> @@ -122,7 +122,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> private final SecurityProblemSupport problemSupport; - public SecurityConfiguration(<% if (authenticationType === 'session' && !skipUserManagement) { %>JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices, <% } if (authenticationType === 'jwt') { %>TokenProvider tokenProvider, <% } %><% if (applicationType !== 'microservice') { %>CorsFilter corsFilter, <% } %><% if (authenticationType === 'oauth2') { %>JwtAuthorityExtractor jwtAuthorityExtractor<% } %>SecurityProblemSupport problemSupport) { + public SecurityConfiguration(<% if (authenticationType === 'session' && !skipUserManagement) { %>JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices, <% } if (authenticationType === 'jwt') { %>TokenProvider tokenProvider, <% } %><% if (applicationType !== 'microservice') { %>CorsFilter corsFilter, <% } %><% if (authenticationType === 'oauth2') { %>JwtAuthorityExtractor jwtAuthorityExtractor, <% } %>SecurityProblemSupport problemSupport) { <%_ if (authenticationType === 'session' && !skipUserManagement) { _%> this.jHipsterProperties = jHipsterProperties; this.rememberMeServices = rememberMeServices; @@ -186,7 +186,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ if (['session','oauth2'].includes(authenticationType) && applicationType !== 'microservice') { _%> .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) .and() - <%_ } else{ _%> + <%_ } else { _%> .disable() <%_ } _%> <%_ if (applicationType !== 'microservice') { _%> @@ -215,8 +215,6 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .successHandler(ajaxAuthenticationSuccessHandler()) .failureHandler(ajaxAuthenticationFailureHandler()) .permitAll() - <%_ } _%> - <%_ if (authenticationType === 'session') { _%> .and() .logout() .logoutUrl("/api/logout") @@ -278,8 +276,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .jwt() .jwtAuthenticationConverter(jwtAuthorityExtractor) .and() - .and() - .oauth2Client(); + .and() + .oauth2Client(); <%_ } _%> // @formatter:on } @@ -291,7 +289,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> - <%_ if (applicationType !== 'microservice') { _%> + <%_ if (applicationType !== 'microservice') { _%> /** * Map authorities from "groups" or "roles" claim in ID Token. * @@ -312,19 +310,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { return mappedAuthorities; }; } - - <%_ } _%> - private Converter mapGroupOrRolesClaimToGrantedAuthorities() { - return new JwtAuthenticationConverter() { - @Override - protected Collection extractAuthorities(Jwt jwt) { - return mapRolesToGrantedAuthorities( - getRolesFromClaims(jwt.getClaims()) - ); - } - }; - } - + <%_ } _%> @SuppressWarnings("unchecked") private Collection getRolesFromClaims(Map claims) { return (Collection) claims.getOrDefault("groups", From 24ea5906c155df36da4fe559f8e023abcb1279b6 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 9 Jun 2019 00:55:42 +0200 Subject: [PATCH 169/298] import map and list in securityutils when reactive --- .../src/main/java/package/security/SecurityUtils.java.ejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 922b310a5326..49ae153e0801 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -19,6 +19,7 @@ package <%=packageName%>.security; <%_ if (authenticationType === 'oauth2') { _%> + import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import org.springframework.security.core.GrantedAuthority; @@ -38,13 +39,13 @@ import org.springframework.security.oauth2.server.resource.authentication.JwtAut <%_ if (reactive) { _%> import reactor.core.publisher.Mono; <%_ } _%> -<%_ if (!reactive) { _%> <%_ if (authenticationType === 'oauth2') { _%> import java.util.ArrayList; import java.util.List; import java.util.Map; - <%_ } _%> +<%_ } _%> +<%_ if (!reactive) { _%> import java.util.Optional; <%_ } _%> From f271e0397f1bf4b40d2f9c8e8adb052821448e7e Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 9 Jun 2019 01:28:31 +0200 Subject: [PATCH 170/298] clean securityUtils when non-oauth2 --- .../main/java/package/security/SecurityUtils.java.ejs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 49ae153e0801..782b41dc0a67 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -124,13 +124,17 @@ public final class SecurityUtils { <%_ } _%> .map(authentication -> { List authorities = new ArrayList<>(); +<%_ if (authenticationType === 'oauth2') { _%> if (authentication instanceof JwtAuthenticationToken) { authorities.addAll( extractAuthorityFromClaims(((JwtAuthenticationToken) authentication).getToken() .getClaims())); } else { +<%_ } _%> authorities.addAll(authentication.getAuthorities()); +<%_ if (authenticationType === 'oauth2') { _%> } +<%_ } _%> return authorities.stream() .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)); })<% if (!reactive) { %> @@ -155,23 +159,28 @@ public final class SecurityUtils { <%_ } _%> .map(authentication -> { List authorities = new ArrayList<>(); +<%_ if (authenticationType === 'oauth2') { _%> if (authentication instanceof JwtAuthenticationToken) { authorities.addAll( extractAuthorityFromClaims(((JwtAuthenticationToken) authentication).getToken() .getClaims())); } else { +<%_ } _%> authorities.addAll(authentication.getAuthorities()); +<%_ if (authenticationType === 'oauth2') { _%> } +<%_ } _%> return authorities.stream() .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority)); })<% if (!reactive) { %> .orElse(false)<% } %>; } - +<%_ if (authenticationType === 'oauth2') { _%> public static List extractAuthorityFromClaims(Map claims) { return ((JSONArray)((JSONObject)claims.get("realm_access")).get("roles")).stream() .map(group -> ((String) group)) .filter(group -> group.startsWith("ROLE_")) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); } +<%_ } _%> } From 6dae9f2dbb2960e4b826ce0b9af5738aa7b47e26 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 9 Jun 2019 01:55:56 +0200 Subject: [PATCH 171/298] AuthorityExtractor as component --- .../config/SecurityConfiguration.java.ejs | 12 +++++++++- .../package/security/SecurityUtils.java.ejs | 8 ++++++- .../oauth2/AuthorizationHeaderUtil.java.ejs | 23 +++++++++++++------ .../oauth2/JwtAuthorityExtractor.java.ejs | 2 +- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 23017fbc0680..d08b21411adb 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -306,11 +306,21 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { mappedAuthorities.addAll(mapRolesToGrantedAuthorities( getRolesFromClaims(oidcUserAuthority.getUserInfo().getClaims()))); }); - return mappedAuthorities; }; } <%_ } _%> + private Converter mapGroupOrRolesClaimToGrantedAuthorities() { + return new JwtAuthenticationConverter() { + @Override + protected Collection extractAuthorities(Jwt jwt) { + return mapRolesToGrantedAuthorities( + getRolesFromClaims(jwt.getClaims()) + ); + } + }; + } + @SuppressWarnings("unchecked") private Collection getRolesFromClaims(Map claims) { return (Collection) claims.getOrDefault("groups", diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 782b41dc0a67..8d8ca821635e 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -22,7 +22,10 @@ package <%=packageName%>.security; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; +<%_ } _%> import org.springframework.security.core.GrantedAuthority; +<%_ if (authenticationType === 'oauth2') { _%> +import org.springframework.security.core.authority.SimpleGrantedAuthority; <%_ } _%> <%_ if (reactive) { _%> import org.springframework.security.core.context.ReactiveSecurityContextHolder; @@ -40,9 +43,12 @@ import org.springframework.security.oauth2.server.resource.authentication.JwtAut import reactor.core.publisher.Mono; <%_ } _%> -<%_ if (authenticationType === 'oauth2') { _%> import java.util.ArrayList; +<%_ if (authenticationType === 'oauth2') { _%> +import java.util.stream.Collectors; +<%_ } _%> import java.util.List; +<%_ if (authenticationType === 'oauth2') { _%> import java.util.Map; <%_ } _%> <%_ if (!reactive) { _%> diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index dc65cbdb0328..2717ba041416 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -18,12 +18,14 @@ -%> package <%=packageName%>.security.oauth2; -import org.springframework.security.authentication.AbstractAuthenticationToken; import java.net.URI; import java.time.Duration; import java.time.Instant; +import java.util.HashMap; +import java.util.Map; import java.util.Optional; +import <%=packageName%>.security.oauth2.OAuthIdpTokenResponseDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.web.client.RestTemplateBuilder; @@ -41,21 +43,28 @@ import org.springframework.security.oauth2.core.*; import org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse; import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; +import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + @Component public class AuthorizationHeaderUtil { private final OAuth2AuthorizedClientService clientService; - + private final RestTemplateBuilder restTemplateBuilder; + private final JwtDecoder jwtDecoder; private final Logger log = LoggerFactory.getLogger(AuthorizationHeaderUtil.class); - public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService) { + public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService, RestTemplateBuilder restTemplateBuilder, JwtDecoder jwtDecoder) { this.clientService = clientService; + this.restTemplateBuilder = restTemplateBuilder; + this.jwtDecoder = jwtDecoder; } public Optional getAuthorizationHeader() { @@ -65,12 +74,11 @@ public class AuthorizationHeaderUtil { String name = oauthToken.getName(); String registrationId = oauthToken.getAuthorizedClientRegistrationId(); OAuth2AuthorizedClient client = clientService.loadAuthorizedClient( - registrationId, - name); + registrationId, + name); if (null == client) { throw new OAuth2AuthorizationException(new OAuth2Error("access_denied", "The token is expired", null)); - // resolves some refresh cases, but not all } OAuth2AccessToken accessToken = client.getAccessToken(); @@ -88,7 +96,8 @@ public class AuthorizationHeaderUtil { String authorizationHeaderValue = String.format("%s %s", tokenType, accessTokenValue); return Optional.of(authorizationHeaderValue); } - } else if (authentication instanceof JwtAuthenticationToken) { // Service to service + + } else if (authentication instanceof JwtAuthenticationToken) { JwtAuthenticationToken accessToken = (JwtAuthenticationToken) authentication; String tokenType = (String) accessToken.getToken().getClaims().get("typ"); String tokenValue = accessToken.getToken().getTokenValue(); diff --git a/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs index e3dcf364939f..75c1483ac671 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/JwtAuthorityExtractor.java.ejs @@ -19,10 +19,10 @@ package <%=packageName%>.security.oauth2; import <%=packageName%>.security.SecurityUtils; -import org.springframework.context.annotation.Configuration; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; +import org.springframework.stereotype.Component; import java.util.Collection; From 8b83187bb435530afc8fec49474b4151e2703574 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Tue, 11 Jun 2019 10:30:30 +0200 Subject: [PATCH 172/298] indent javadoc --- .../java/package/security/SecurityUtils.java.ejs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 8d8ca821635e..169163fa4cc8 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -148,13 +148,13 @@ public final class SecurityUtils { } /** - * If the current user has a specific authority (security role). - *

- * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. - * - * @param authority the authority to check. - * @return true if the current user has the authority, false otherwise. - */ + * If the current user has a specific authority (security role). + *

+ * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. + * + * @param authority the authority to check. + * @return true if the current user has the authority, false otherwise. + */ public static <% if (!reactive) { %>boolean<% } else { %>Mono<% } %> isCurrentUserInRole(String authority) { <%_ if (!reactive) { _%> SecurityContext securityContext = SecurityContextHolder.getContext(); From 7779bfc08cc9d170203a39d2515a2deecd332d71 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Tue, 11 Jun 2019 11:13:35 +0200 Subject: [PATCH 173/298] reference jwtTokenAuthorityExtractor --- .../main/java/package/config/SecurityConfiguration.java.ejs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index d08b21411adb..14c2fc4c79fc 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -119,6 +119,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Value("${spring.security.oauth2.client.provider.oidc.issuer-uri}") private String issuerUri; + + private final JwtAuthorityExtractor jwtAuthorityExtractor; <%_ } _%> private final SecurityProblemSupport problemSupport; @@ -134,6 +136,9 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { this.corsFilter = corsFilter; <%_ } _%> this.problemSupport = problemSupport; + <%_ if (authenticationType === 'oauth2') { _%> + this.jwtAuthorityExtractor = jwtAuthorityExtractor; + <%_ } _%> } <%_ if (authenticationType === 'session') { _%> From c77d5cfe78b6d09763ef2283297b0e3b378ed188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dziedzic?= Date: Fri, 14 Jun 2019 14:47:15 +0200 Subject: [PATCH 174/298] improve performance No reason for options to be determined in each iteration. --- cli/cli.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/cli.js b/cli/cli.js index 40d112398dd1..cfe737d65ade 100644 --- a/cli/cli.js +++ b/cli/cli.js @@ -54,6 +54,8 @@ program .usage('[command] [options]') .allowUnknownOption(); +const options = getCommandOptions(packageJson, process.argv.slice(2)); + /* create commands */ Object.keys(SUB_GENERATORS).forEach(key => { const opts = SUB_GENERATORS[key]; @@ -65,7 +67,6 @@ Object.keys(SUB_GENERATORS).forEach(key => { .allowUnknownOption() .description(opts.desc) .action(args => { - const options = getCommandOptions(packageJson, process.argv.slice(2)); if (opts.cliOnly) { logger.debug('Executing CLI only script'); /* eslint-disable global-require, import/no-dynamic-require */ From 37ee1817565b0f011dd7398e5187f683973d9c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Fri, 14 Jun 2019 23:33:06 +0200 Subject: [PATCH 175/298] Add new needle API to add a new annotation processor for Maven --- generators/generator-base.js | 11 +++++++++++ .../server/needle-api/needle-server-maven.js | 16 ++++++++++++++++ generators/server/templates/pom.xml.ejs | 1 + test/needle-api/needle-server-maven.spec.js | 16 ++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/generators/generator-base.js b/generators/generator-base.js index d31b122dc401..c1bc760b3c75 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -684,6 +684,17 @@ module.exports = class extends PrivateBase { this.needleApi.serverMaven.addPlugin(groupId, artifactId, version, other); } + /** + * Add a new annotation processor path to Maven compiler configuration. + * + * @param {string} groupId - plugin groupId + * @param {string} artifactId - plugin artifactId + * @param {string} version - explicit plugin version number + */ + addMavenAnnotationProcessor(groupId, artifactId, version) { + this.needleApi.serverMaven.addAnnotationProcessor(groupId, artifactId, version); + } + /** * Add a new Maven profile. * diff --git a/generators/server/needle-api/needle-server-maven.js b/generators/server/needle-api/needle-server-maven.js index 320baecd3ae7..8fa54fdad60b 100644 --- a/generators/server/needle-api/needle-server-maven.js +++ b/generators/server/needle-api/needle-server-maven.js @@ -138,6 +138,22 @@ module.exports = class extends needleServer { this.addBlockContentToFile(rewriteFileModel, errorMessage); } + addAnnotationProcessor(groupId, artifactId, version) { + const errorMessage = `${chalk.yellow( + ' Reference to ' + )}maven annotation processor (groupId: ${groupId}, artifactId:${artifactId}, version:${version}) + ${chalk.yellow(' not added.\n')}`; + // prettier-ignore + const annotationProcessorPath = `${'\n' + + ' '}${groupId}\n` + + ` ${artifactId}\n` + + ` ${version}\n` + + ' '; + const rewriteFileModel = this.generateFileModel(pomPath, 'jhipster-needle-maven-add-annotation-processor', annotationProcessorPath); + + this.addBlockContentToFile(rewriteFileModel, errorMessage); + } + addProfile(profileId, other) { const errorMessage = `${chalk.yellow('Reference to maven profile ')} (id: ${profileId})${chalk.yellow(' not added.\n')}`; diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index b2e2724e90bd..95e143548920 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -782,6 +782,7 @@ ${jaxb-runtime.version} <%_ } _%> + diff --git a/test/needle-api/needle-server-maven.spec.js b/test/needle-api/needle-server-maven.spec.js index aa3e0020254a..5488ed856882 100644 --- a/test/needle-api/needle-server-maven.spec.js +++ b/test/needle-api/needle-server-maven.spec.js @@ -90,6 +90,11 @@ const mockBlueprintSubGen = class extends ServerGenerator { ' \n' + ' ' ); + this.addMavenAnnotationProcessor( + 'annotationProcessorGroupId', + 'annotationProcessorArtifactId', + 'annotationProcessorVersion' + ); this.addMavenProfile('profileId', ' other'); } }; @@ -221,6 +226,17 @@ describe('needle API server maven: JHipster server generator with blueprint', () ); }); + it('Assert pom.xml has the annotation processor added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' annotationProcessorGroupId\n' + + ' annotationProcessorArtifactId\n' + + ' annotationProcessorVersion\n' + + ' ' + ); + }); + it('Assert pom.xml has the profile added', () => { assert.fileContent( 'pom.xml', From b4a47082d7922787cd339c514308cb245d803cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sat, 15 Jun 2019 15:55:45 +0200 Subject: [PATCH 176/298] Re-enable unit tests for upgrade subgenerator The target version is now forced, it should prevent issue when beta release are done --- test/{upgrade.spec.js.disable => upgrade.spec.js} | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) rename test/{upgrade.spec.js.disable => upgrade.spec.js} (92%) diff --git a/test/upgrade.spec.js.disable b/test/upgrade.spec.js similarity index 92% rename from test/upgrade.spec.js.disable rename to test/upgrade.spec.js index 237ff6d0ae1c..e0977a5933d3 100644 --- a/test/upgrade.spec.js.disable +++ b/test/upgrade.spec.js @@ -5,6 +5,7 @@ const shelljs = require('shelljs'); const fse = require('fs-extra'); const expect = require('chai').expect; const expectedFiles = require('./utils/expected-files'); +const packageJson = require('../package.json'); describe('JHipster upgrade generator', function() { this.timeout(200000); @@ -44,7 +45,12 @@ describe('JHipster upgrade generator', function() { .on('end', () => { helpers .run(path.join(__dirname, '../generators/upgrade')) - .withOptions({ 'from-cli': true, force: true, silent: false }) + .withOptions({ + 'from-cli': true, + force: true, + silent: false, + 'target-version': packageJson.version + }) .inTmpDir(() => { /* eslint-disable-next-line no-console */ console.log('Upgrading the JHipster application'); @@ -118,7 +124,12 @@ describe('JHipster upgrade generator', function() { .on('end', () => { helpers .run(path.join(__dirname, '../generators/upgrade')) - .withOptions({ 'from-cli': true, force: true, silent: false }) + .withOptions({ + 'from-cli': true, + force: true, + silent: false, + 'target-version': packageJson.version + }) .inTmpDir(() => { /* eslint-disable-next-line no-console */ console.log('Upgrading the JHipster application'); From 8a0184ac6fa035ed571624c8bbd1a328c0913160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Fri, 14 Jun 2019 23:53:03 +0200 Subject: [PATCH 177/298] Clean needle-api unit tests - Don't run each test twice with blueprint 'generator-jhipster-myblueprint' and 'myblueprint' - Cleaned contexts (rename, regroup, delete empty ones, ...) --- test/needle-api/needle-client-angular.spec.js | 253 +++++++---------- test/needle-api/needle-client-i18n.spec.js | 102 ++++--- test/needle-api/needle-client-react.spec.js | 139 ++++----- test/needle-api/needle-client-webpack.spec.js | 58 ++-- test/needle-api/needle-client.spec.js | 56 ++-- test/needle-api/needle-server-cache.spec.js | 228 +++++++-------- test/needle-api/needle-server-gradle.spec.js | 154 +++++----- .../needle-server-liquibase.spec.js | 150 +++++----- test/needle-api/needle-server-maven.spec.js | 266 +++++++++--------- 9 files changed, 640 insertions(+), 766 deletions(-) diff --git a/test/needle-api/needle-client-angular.spec.js b/test/needle-api/needle-client-angular.spec.js index 25d464ed2590..fd87790f7dbc 100644 --- a/test/needle-api/needle-client-angular.spec.js +++ b/test/needle-api/needle-client-angular.spec.js @@ -76,154 +76,117 @@ const mockBlueprintSubGen = class extends ClientGenerator { } }; -describe('needle API SCSS: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'angularX', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'] - }) - .on('end', done); - }); - - it('vendor.scss contains the specific change (without comment) added by needle api', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, /@import style_without_comment/); - }); - - it('global.scss contains the specific change (without comment) added by needle api', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, /@import style_without_comment/); - }); - - it('vendor.scss contains the specific change added by needle api', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, /@import style/); - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, - '* ==========================================================================\n' + - 'my comment\n' + - '========================================================================== */\n' - ); - }); - - it('global.scss contains the specific change added by needle api', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, /@import style/); - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, - '* ==========================================================================\n' + - 'my comment\n' + - '========================================================================== */\n' - ); - }); - - it('menu contains the element added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, - '

' - ); - }); - - it('admin menu contains the admin element added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, - '
  • \n' + - ' \n' + - '  \n' + - ' Router Name 2\n' + - ' \n' + - '
  • ' - ); - }); - - it('entity menu contains the entity added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, - '
  • \n' + - ' \n' + - ' \n' + - ' Router Name 3\n' + - ' \n' + - '
  • ' - ); - }); - - it('entity module contains the microservice object added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/entities/entity.module.ts`, - ' {\n' + - " path: 'entityUrl',\n" + - " loadChildren: './entityFolderName/entityFileName.module#MicroServiceNameentityNameModule'\n" + - ' }' - ); - }); +describe('needle API Angular: JHipster client generator with blueprint', () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/client')) + .withOptions({ + 'from-cli': true, + build: 'maven', + auth: 'jwt', + db: 'mysql', + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'angularX', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'] + }) + .on('end', done); + }); - it('admin module contains the import and the module added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/admin/admin.module.ts`, - "import { appNameadminAngularNameModule } from './adminFolderName/adminFileName.module';" - ); - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/admin/admin.module.ts`, 'appNameadminAngularNameModule,'); - }); + it('vendor.scss contains the specific change (without comment) added by needle api', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, /@import style_without_comment/); + }); - it('app module contains the import and the module added by needle api', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/app.module.ts`, - "import { appNameangularNameModule } from './folderName/fileName.module';" - ); - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.module.ts`, 'appNameangularNameModule,'); - }); - }); + it('global.scss contains the specific change (without comment) added by needle api', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, /@import style_without_comment/); + }); + + it('vendor.scss contains the specific change added by needle api', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, /@import style/); + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}content/scss/vendor.scss`, + '* ==========================================================================\n' + + 'my comment\n' + + '========================================================================== */\n' + ); + }); + + it('global.scss contains the specific change added by needle api', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, /@import style/); + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}content/scss/global.scss`, + '* ==========================================================================\n' + + 'my comment\n' + + '========================================================================== */\n' + ); + }); + + it('menu contains the element added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, + ' ' + ); + }); + + it('admin menu contains the admin element added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, + '
  • \n' + + ' \n' + + '  \n' + + ' Router Name 2\n' + + ' \n' + + '
  • ' + ); + }); + + it('entity menu contains the entity added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`, + '
  • \n' + + ' \n' + + ' \n' + + ' Router Name 3\n' + + ' \n' + + '
  • ' + ); + }); + + it('entity module contains the microservice object added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/entities/entity.module.ts`, + ' {\n' + + " path: 'entityUrl',\n" + + " loadChildren: './entityFolderName/entityFileName.module#MicroServiceNameentityNameModule'\n" + + ' }' + ); + }); + + it('admin module contains the import and the module added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/admin/admin.module.ts`, + "import { appNameadminAngularNameModule } from './adminFolderName/adminFileName.module';" + ); + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/admin/admin.module.ts`, 'appNameadminAngularNameModule,'); }); -}); -describe('needle API CSS: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'angularX', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'] - }) - .on('end', done); - }); - }); + it('app module contains the import and the module added by needle api', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/app.module.ts`, + "import { appNameangularNameModule } from './folderName/fileName.module';" + ); + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.module.ts`, 'appNameangularNameModule,'); }); }); diff --git a/test/needle-api/needle-client-i18n.spec.js b/test/needle-api/needle-client-i18n.spec.js index 4d8e1aae7154..36109a5895f7 100644 --- a/test/needle-api/needle-client-i18n.spec.js +++ b/test/needle-api/needle-client-i18n.spec.js @@ -59,59 +59,53 @@ const mockBlueprintSubGen = class extends LanguagesGenerator { }; describe('needle API i18n: JHipster language generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/languages')) - .inTmpDir(dir => { - fse.copySync(path.join(__dirname, '../../test/templates/ngx-blueprint'), dir); - }) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:languages']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'angularX', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['en', 'fr'] - }) - .on('end', done); - }); - - it('Assert english global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_key": "My Value",'); - }); - - it('Assert french global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle": "Ma Valeur",'); - }); - - it('Assert english admin global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_admin_key": "My Admin Value",'); - }); - - it('Assert french admin global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle_admin": "Ma Valeur Admin",'); - }); - - it('Assert english entity global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_entity_key": "My Entity Value",'); - }); - - it('Assert french entity global.json contain the new key', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle_entite": "Ma Valeur Entite",'); - }); - }); + before(done => { + helpers + .run(path.join(__dirname, '../../generators/languages')) + .inTmpDir(dir => { + fse.copySync(path.join(__dirname, '../../test/templates/ngx-blueprint'), dir); + }) + .withOptions({ + 'from-cli': true, + build: 'maven', + auth: 'jwt', + db: 'mysql', + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:languages']]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'angularX', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['en', 'fr'] + }) + .on('end', done); + }); + + it('Assert english global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_key": "My Value",'); + }); + + it('Assert french global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle": "Ma Valeur",'); + }); + + it('Assert english admin global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_admin_key": "My Admin Value",'); + }); + + it('Assert french admin global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle_admin": "Ma Valeur Admin",'); + }); + + it('Assert english entity global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`, '"my_entity_key": "My Entity Value",'); + }); + + it('Assert french entity global.json contain the new key', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`, '"ma_cle_entite": "Ma Valeur Entite",'); }); }); diff --git a/test/needle-api/needle-client-react.spec.js b/test/needle-api/needle-client-react.spec.js index f2b8c776fb6d..7cb018a68544 100644 --- a/test/needle-api/needle-client-react.spec.js +++ b/test/needle-api/needle-client-react.spec.js @@ -66,99 +66,62 @@ const mockBlueprintSubGen = class extends ClientGenerator { }; describe('needle API React: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'react', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['en', 'fr'] - }) - .on('end', done); - }); - - it('Assert entity is added to menu', () => { - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/shared/layout/menus/entities.tsx`, - '\n Router Name\n ' - ); - }); + before(done => { + helpers + .run(path.join(__dirname, '../../generators/client')) + .withOptions({ + 'from-cli': true, + build: 'maven', + auth: 'jwt', + db: 'mysql', + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'react', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['en', 'fr'] + }) + .on('end', done); + }); + + it('Assert entity is added to menu', () => { + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/shared/layout/menus/entities.tsx`, + '\n Router Name\n ' + ); + }); - it('Assert entity is added to module', () => { - const indexModulePath = `${CLIENT_MAIN_SRC_DIR}app/entities/index.tsx`; - const indexReducerPath = `${CLIENT_MAIN_SRC_DIR}app/shared/reducers/index.ts`; + it('Assert entity is added to module', () => { + const indexModulePath = `${CLIENT_MAIN_SRC_DIR}app/entities/index.tsx`; + const indexReducerPath = `${CLIENT_MAIN_SRC_DIR}app/shared/reducers/index.ts`; - assert.fileContent(indexModulePath, "import entityName from './entityFolderName';"); + assert.fileContent(indexModulePath, "import entityName from './entityFolderName';"); assert.fileContent(indexModulePath, ''); // eslint-disable-line - assert.fileContent( - indexReducerPath, - '// prettier-ignore\n' + - 'import entityInstance, {\n' + - ' entityNameState\n' + - "} from 'app/entities/entityFolderName/entityFileName.reducer';" - ); - assert.fileContent(indexReducerPath, 'readonly entityInstance: entityNameState;'); - assert.fileContent(indexReducerPath, 'entityInstance,'); - }); - }); + assert.fileContent( + indexReducerPath, + '// prettier-ignore\n' + + 'import entityInstance, {\n' + + ' entityNameState\n' + + "} from 'app/entities/entityFolderName/entityFileName.reducer';" + ); + assert.fileContent(indexReducerPath, 'readonly entityInstance: entityNameState;'); + assert.fileContent(indexReducerPath, 'entityInstance,'); }); -}); -describe('needle API React: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'react', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['en', 'fr'] - }) - .on('end', done); - }); - - it('Assert app.scss is updated', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.scss`, '@import without-comment'); - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.scss`, '@import with-comment'); - assert.fileContent( - `${CLIENT_MAIN_SRC_DIR}app/app.scss`, - '* ==========================================================================\n' + - 'my comment\n' + - '========================================================================== */\n' - ); - }); - }); + it('Assert app.scss is updated', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.scss`, '@import without-comment'); + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/app.scss`, '@import with-comment'); + assert.fileContent( + `${CLIENT_MAIN_SRC_DIR}app/app.scss`, + '* ==========================================================================\n' + + 'my comment\n' + + '========================================================================== */\n' + ); }); }); diff --git a/test/needle-api/needle-client-webpack.spec.js b/test/needle-api/needle-client-webpack.spec.js index a9a4032eccfc..5cfce94113b1 100644 --- a/test/needle-api/needle-client-webpack.spec.js +++ b/test/needle-api/needle-client-webpack.spec.js @@ -52,38 +52,32 @@ const mockBlueprintSubGen = class extends ClientGenerator { }; describe('needle API Webpack: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'angularX', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['en', 'fr'] - }) - .on('end', done); - }); - it('Assert external asset is added to webpack.common.js', () => { - const from = `${CLIENT_MAIN_SRC_DIR}content/${assetFrom}/`; - const to = `content/${assetTo}/`; + before(done => { + helpers + .run(path.join(__dirname, '../../generators/client')) + .withOptions({ + 'from-cli': true, + build: 'maven', + auth: 'jwt', + db: 'mysql', + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'angularX', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['en', 'fr'] + }) + .on('end', done); + }); + it('Assert external asset is added to webpack.common.js', () => { + const from = `${CLIENT_MAIN_SRC_DIR}content/${assetFrom}/`; + const to = `content/${assetTo}/`; - assert.fileContent(`${CLIENT_WEBPACK_DIR}/webpack.common.js`, `{ from: './${from}', to: '${to}' },`); - }); - }); + assert.fileContent(`${CLIENT_WEBPACK_DIR}/webpack.common.js`, `{ from: './${from}', to: '${to}' },`); }); }); diff --git a/test/needle-api/needle-client.spec.js b/test/needle-api/needle-client.spec.js index de5b8b6ff0ad..cd159e3ffd4f 100644 --- a/test/needle-api/needle-client.spec.js +++ b/test/needle-api/needle-client.spec.js @@ -49,37 +49,31 @@ const mockBlueprintSubGen = class extends ClientGenerator { }; describe('needle API Client: JHipster client generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate client with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/client')) - .withOptions({ - 'from-cli': true, - build: 'maven', - auth: 'jwt', - db: 'mysql', - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) - .withPrompts({ - baseName: 'jhipster', - clientFramework: 'angularX', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['en', 'fr'] - }) - .on('end', done); - }); + before(done => { + helpers + .run(path.join(__dirname, '../../generators/client')) + .withOptions({ + 'from-cli': true, + build: 'maven', + auth: 'jwt', + db: 'mysql', + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'angularX', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['en', 'fr'] + }) + .on('end', done); + }); - it('Assert index.html contain the comment and the resource added', () => { - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}index.html`, ''); - assert.fileContent(`${CLIENT_MAIN_SRC_DIR}index.html`, ''); - }); - }); + it('Assert index.html contain the comment and the resource added', () => { + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}index.html`, ''); + assert.fileContent(`${CLIENT_MAIN_SRC_DIR}index.html`, ''); }); }); diff --git a/test/needle-api/needle-server-cache.spec.js b/test/needle-api/needle-server-cache.spec.js index 11acfdb9d506..c592b6e38d56 100644 --- a/test/needle-api/needle-server-cache.spec.js +++ b/test/needle-api/needle-server-cache.spec.js @@ -75,128 +75,118 @@ const mockBlueprintSubGen = class extends ServerGenerator { }; describe('needle API server cache: JHipster server generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate server with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/server')) - .withOptions({ - 'from-cli': true, - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) - .withPrompts({ - baseName: 'jhipster', - packageName: 'com.mycompany.myapp', - packageFolder: 'com/mycompany/myapp', - serviceDiscoveryType: false, - authenticationType: 'jwt', - cacheProvider: 'ehcache', - enableHibernateCache: true, - databaseType: 'sql', - devDatabaseType: 'h2Memory', - prodDatabaseType: 'mysql', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'], - buildTool: 'maven', - rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', - serverSideOptions: [] - }) - .on('end', done); - }); - - it('Assert ehCache configuration has entry added', () => { - assert.fileContent(`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, 'createCache(cm, entry);'); - }); - - it('Assert ehCache configuration has entity added', () => { - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName());' - ); - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany");' - ); - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany");' - ); - }); + describe('ehcache', () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/server')) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) + .withPrompts({ + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'ehcache', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); + + it('Assert ehCache configuration has entry added', () => { + assert.fileContent(`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, 'createCache(cm, entry);'); + }); + + it('Assert ehCache configuration has entity added', () => { + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName());' + ); + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany");' + ); + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + 'createCache(cm, com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany");' + ); }); }); -}); -describe('needle API server cache: JHipster server generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate server with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/server')) - .withOptions({ - 'from-cli': true, - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) - .withPrompts({ - baseName: 'jhipster', - packageName: 'com.mycompany.myapp', - packageFolder: 'com/mycompany/myapp', - serviceDiscoveryType: false, - authenticationType: 'jwt', - cacheProvider: 'infinispan', - enableHibernateCache: true, - databaseType: 'sql', - devDatabaseType: 'h2Memory', - prodDatabaseType: 'mysql', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'], - buildTool: 'maven', - rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', - serverSideOptions: [] - }) - .on('end', done); - }); - - it('Assert Infinispan configuration has entity added', () => { - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - ' registerPredefinedCache(entry, new JCache(\n' + - ' cacheManager.getCache(entry).getAdvancedCache(), this,\n' + - ' ConfigurationAdapter.create()));' - ); - }); - - it('Assert Infinispan configuration has entity added', () => { - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName(), new JCache(\n' + - ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName()).getAdvancedCache(), this,\n' + - ' ConfigurationAdapter.create()));' - ); - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany", new JCache(\n' + - ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany").getAdvancedCache(), this,\n' + - ' ConfigurationAdapter.create()));' - ); - assert.fileContent( - `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, - ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany", new JCache(\n' + - ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany").getAdvancedCache(), this,\n' + - ' ConfigurationAdapter.create()));' - ); - }); + describe('infinispan', () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/server')) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) + .withPrompts({ + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'infinispan', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); + + it('Assert Infinispan configuration has entity added', () => { + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + ' registerPredefinedCache(entry, new JCache(\n' + + ' cacheManager.getCache(entry).getAdvancedCache(), this,\n' + + ' ConfigurationAdapter.create()));' + ); + }); + + it('Assert Infinispan configuration has entity added', () => { + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName(), new JCache(\n' + + ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName()).getAdvancedCache(), this,\n' + + ' ConfigurationAdapter.create()));' + ); + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany", new JCache(\n' + + ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesOneToMany").getAdvancedCache(), this,\n' + + ' ConfigurationAdapter.create()));' + ); + assert.fileContent( + `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/CacheConfiguration.java`, + ' registerPredefinedCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany", new JCache(\n' + + ' cacheManager.getCache(com.mycompany.myapp.domain.entityClass.class.getName() + ".entitiesManoToMany").getAdvancedCache(), this,\n' + + ' ConfigurationAdapter.create()));' + ); }); }); }); diff --git a/test/needle-api/needle-server-gradle.spec.js b/test/needle-api/needle-server-gradle.spec.js index f9fe488b67cc..5c9949dbc1b3 100644 --- a/test/needle-api/needle-server-gradle.spec.js +++ b/test/needle-api/needle-server-gradle.spec.js @@ -54,85 +54,79 @@ const mockBlueprintSubGen = class extends ServerGenerator { }; describe('needle API server gradle: JHipster server generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate server with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/server')) - .withOptions({ - 'from-cli': true, - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) - .withPrompts({ - baseName: 'jhipster', - packageName: 'com.mycompany.myapp', - packageFolder: 'com/mycompany/myapp', - serviceDiscoveryType: false, - authenticationType: 'jwt', - cacheProvider: 'ehcache', - enableHibernateCache: true, - databaseType: 'sql', - devDatabaseType: 'h2Memory', - prodDatabaseType: 'mysql', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'], - buildTool: 'gradle', - rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', - serverSideOptions: [] - }) - .on('end', done); - }); - - it('Assert gradle.properties has the property added', () => { - assert.fileContent('gradle.properties', 'name=value'); - }); - - it('Assert gradle.properties has the plugin added', () => { - assert.fileContent('build.gradle', 'classpath "group:name:version"'); - }); - - it('Assert gradle.properties has the PluginToPluginsBlock added', () => { - assert.fileContent('build.gradle', 'id "id" version "version"'); - }); - - it('Assert gradle.properties has the Dependency with version added', () => { - assert.fileContent('build.gradle', 'scope3 "group3:name3:version3"'); - }); - - it('Assert gradle.properties has the Dependency without version added', () => { - assert.fileContent('build.gradle', 'scope4 "group4:name4"'); - }); - - it('Assert gradle.properties has the Dependency in directory with version added', () => { - assert.fileContent('build.gradle', 'scope5 "group5:name5:version5"'); - }); - - it('Assert gradle.properties has the Dependency without version added', () => { - assert.fileContent('build.gradle', 'scope6 "group6:name6"'); - }); - - it('Assert gradle.properties has the apply gradle script added', () => { - assert.fileContent('build.gradle', "apply from: 'name.gradle'"); - }); - - it('Assert gradle.properties has the maven repository added', () => { - assert.fileContent( - 'build.gradle', - ' maven {\n' + - ' url "url"\n' + - ' credentials {\n' + - ' username = "username"\n' + - ' password = "password"\n' + - ' }\n' + - ' }' - ); - }); - }); + before(done => { + helpers + .run(path.join(__dirname, '../../generators/server')) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) + .withPrompts({ + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'ehcache', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'gradle', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); + + it('Assert gradle.properties has the property added', () => { + assert.fileContent('gradle.properties', 'name=value'); + }); + + it('Assert gradle.properties has the plugin added', () => { + assert.fileContent('build.gradle', 'classpath "group:name:version"'); + }); + + it('Assert gradle.properties has the PluginToPluginsBlock added', () => { + assert.fileContent('build.gradle', 'id "id" version "version"'); + }); + + it('Assert gradle.properties has the Dependency with version added', () => { + assert.fileContent('build.gradle', 'scope3 "group3:name3:version3"'); + }); + + it('Assert gradle.properties has the Dependency without version added', () => { + assert.fileContent('build.gradle', 'scope4 "group4:name4"'); + }); + + it('Assert gradle.properties has the Dependency in directory with version added', () => { + assert.fileContent('build.gradle', 'scope5 "group5:name5:version5"'); + }); + + it('Assert gradle.properties has the Dependency without version added', () => { + assert.fileContent('build.gradle', 'scope6 "group6:name6"'); + }); + + it('Assert gradle.properties has the apply gradle script added', () => { + assert.fileContent('build.gradle', "apply from: 'name.gradle'"); + }); + + it('Assert gradle.properties has the maven repository added', () => { + assert.fileContent( + 'build.gradle', + ' maven {\n' + + ' url "url"\n' + + ' credentials {\n' + + ' username = "username"\n' + + ' password = "password"\n' + + ' }\n' + + ' }' + ); }); }); diff --git a/test/needle-api/needle-server-liquibase.spec.js b/test/needle-api/needle-server-liquibase.spec.js index a48fe2f0fc40..9550acf9ac86 100644 --- a/test/needle-api/needle-server-liquibase.spec.js +++ b/test/needle-api/needle-server-liquibase.spec.js @@ -87,89 +87,83 @@ const mockBlueprintSubGen = class extends ServerGenerator { }; describe('needle API server liquibase: JHipster server generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate server with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/server')) - .inTmpDir(dir => { - fse.copySync( - path.join(__dirname, 'templates/src/main/resources/config/liquibase/changelog/'), - `${dir}/templates/src/main/resources/config/liquibase/changelog/` - ); - }) - .withOptions({ - 'from-cli': true, - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) - .withPrompts({ - baseName: 'jhipster', - packageName: 'com.mycompany.myapp', - packageFolder: 'com/mycompany/myapp', - serviceDiscoveryType: false, - authenticationType: 'jwt', - cacheProvider: 'ehcache', - enableHibernateCache: true, - databaseType: 'sql', - devDatabaseType: 'h2Memory', - prodDatabaseType: 'mysql', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'], - buildTool: 'maven', - rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', - serverSideOptions: [] - }) - .on('end', done); - }); - - it('Assert changelog is added to master.xml', () => { - assert.fileContent( - `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, - '' + before(done => { + helpers + .run(path.join(__dirname, '../../generators/server')) + .inTmpDir(dir => { + fse.copySync( + path.join(__dirname, 'templates/src/main/resources/config/liquibase/changelog/'), + `${dir}/templates/src/main/resources/config/liquibase/changelog/` ); - }); + }) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) + .withPrompts({ + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'ehcache', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); - it('Assert constraints changelog is added to master.xml', () => { - assert.fileContent( - `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, - '' - ); - }); + it('Assert changelog is added to master.xml', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, + '' + ); + }); - it('Assert constraints with needle changelog is added to master.xml', () => { - assert.fileContent( - `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, - '' - ); - }); + it('Assert constraints changelog is added to master.xml', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, + '' + ); + }); - it('Assert that column is added to an existing changelog', () => { - assert.fileContent( - `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, - ' \n' + - ' \n' + - ' ' - ); - }); + it('Assert constraints with needle changelog is added to master.xml', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/master.xml`, + '' + ); + }); - it('Assert that changeSet is added to an existing changelog', () => { - assert.fileContent( - `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, - ' \n' + - ' \n' + + it('Assert that column is added to an existing changelog', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, + ' \n' + + ' \n' + + ' ' + ); + }); + + it('Assert that changeSet is added to an existing changelog', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, + ' \n' + + ' \n' + ' \n' + // eslint-disable-line - ' \n' + - ' \n' + - ' \n' + - ' ' - ); - }); - }); + ' \n' + + ' \n' + + ' \n' + + ' ' + ); }); }); diff --git a/test/needle-api/needle-server-maven.spec.js b/test/needle-api/needle-server-maven.spec.js index 5488ed856882..d27b78a40bd2 100644 --- a/test/needle-api/needle-server-maven.spec.js +++ b/test/needle-api/needle-server-maven.spec.js @@ -103,146 +103,134 @@ const mockBlueprintSubGen = class extends ServerGenerator { }; describe('needle API server maven: JHipster server generator with blueprint', () => { - const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; - - blueprintNames.forEach(blueprintName => { - describe(`generate server with blueprint option '${blueprintName}'`, () => { - before(done => { - helpers - .run(path.join(__dirname, '../../generators/server')) - .withOptions({ - 'from-cli': true, - skipInstall: true, - blueprint: blueprintName, - skipChecks: true - }) - .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) - .withPrompts({ - baseName: 'jhipster', - packageName: 'com.mycompany.myapp', - packageFolder: 'com/mycompany/myapp', - serviceDiscoveryType: false, - authenticationType: 'jwt', - cacheProvider: 'ehcache', - enableHibernateCache: true, - databaseType: 'sql', - devDatabaseType: 'h2Memory', - prodDatabaseType: 'mysql', - enableTranslation: true, - nativeLanguage: 'en', - languages: ['fr'], - buildTool: 'maven', - rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', - serverSideOptions: [] - }) - .on('end', done); - }); - - it('Assert pom.xml has the dependency management added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' groupId\n' + - ' artifactId\n' + - ' version\n' + - ' type\n' + - ' scope\n' + - ' \n' + - ' \n' + - ' aGroupId\n' + - ' anArtifactId\n' + - ' \n' + - ' \n' + - ' ' - ); - }); + before(done => { + helpers + .run(path.join(__dirname, '../../generators/server')) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: 'myblueprint', + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:server']]) + .withPrompts({ + baseName: 'jhipster', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'ehcache', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'], + buildTool: 'maven', + rememberMeKey: '5c37379956bd1242f5636c8cb322c2966ad81277', + serverSideOptions: [] + }) + .on('end', done); + }); - it('Assert pom.xml has the repository added', () => { - assert.fileContent( - 'pom.xml', - ' \n id\n url\n ' - ); - }); - - it('Assert pom.xml has the plugin repository added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' id\n' + - ' url\n' + - ' ' - ); - }); - - it('Assert pom.xml has the distributionManagement added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' releasesId\n' + - ' releasesUrl\n' + - ' ' - ); - }); - - it('Assert pom.xml has the property added', () => { - assert.fileContent('pom.xml', 'value'); - }); - - it('Assert pom.xml has the dependencyManagement added', () => { - assert.fileContent('pom.xml', ''); - }); - - it('Assert pom.xml has the dependency added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' groupId\n' + - ' artifactId\n' + - ' version\n' + - ' \n' + - ' \n' + - ' aGroupId\n' + - ' anArtifactId\n' + - ' \n' + - ' \n' + - ' ' - ); - }); - - it('Assert pom.xml has the dependency in directory added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' groupId2\n' + - ' artifactId2\n' + - ' version2\n' + - ' \n' + - ' \n' + - ' aGroupId\n' + - ' anArtifactId\n' + - ' \n' + - ' \n' + - ' ' - ); - }); - - it('Assert pom.xml has the annotation processor added', () => { - assert.fileContent( - 'pom.xml', - ' \n' + - ' annotationProcessorGroupId\n' + - ' annotationProcessorArtifactId\n' + - ' annotationProcessorVersion\n' + - ' ' - ); - }); + it('Assert pom.xml has the dependency management added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' groupId\n' + + ' artifactId\n' + + ' version\n' + + ' type\n' + + ' scope\n' + + ' \n' + + ' \n' + + ' aGroupId\n' + + ' anArtifactId\n' + + ' \n' + + ' \n' + + ' ' + ); + }); - it('Assert pom.xml has the profile added', () => { - assert.fileContent( - 'pom.xml', - ' \n profileId\n other\n ' - ); - }); - }); + it('Assert pom.xml has the repository added', () => { + assert.fileContent('pom.xml', ' \n id\n url\n '); + }); + + it('Assert pom.xml has the plugin repository added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + ' id\n' + ' url\n' + ' ' + ); + }); + + it('Assert pom.xml has the distributionManagement added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' releasesId\n' + + ' releasesUrl\n' + + ' ' + ); + }); + + it('Assert pom.xml has the property added', () => { + assert.fileContent('pom.xml', 'value'); + }); + + it('Assert pom.xml has the dependencyManagement added', () => { + assert.fileContent('pom.xml', ''); + }); + + it('Assert pom.xml has the dependency added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' groupId\n' + + ' artifactId\n' + + ' version\n' + + ' \n' + + ' \n' + + ' aGroupId\n' + + ' anArtifactId\n' + + ' \n' + + ' \n' + + ' ' + ); + }); + + it('Assert pom.xml has the dependency in directory added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' groupId2\n' + + ' artifactId2\n' + + ' version2\n' + + ' \n' + + ' \n' + + ' aGroupId\n' + + ' anArtifactId\n' + + ' \n' + + ' \n' + + ' ' + ); + }); + + it('Assert pom.xml has the annotation processor added', () => { + assert.fileContent( + 'pom.xml', + ' \n' + + ' annotationProcessorGroupId\n' + + ' annotationProcessorArtifactId\n' + + ' annotationProcessorVersion\n' + + ' ' + ); + }); + + it('Assert pom.xml has the profile added', () => { + assert.fileContent( + 'pom.xml', + ' \n profileId\n other\n ' + ); }); }); From b8bce5c11f49c725467ed278bc0c544cbc480338 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Sat, 15 Jun 2019 17:12:05 +0200 Subject: [PATCH 178/298] Hooks on configuration component --- .../configuration/configuration.tsx.ejs | 225 +++++++++--------- 1 file changed, 106 insertions(+), 119 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs index 867c44a57cbe..a55d27e9ec10 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Table, Input, Row, Col, Badge } from 'reactstrap'; import { Translate } from 'react-jhipster'; @@ -26,125 +26,112 @@ import { IRootState } from 'app/shared/reducers'; export interface IConfigurationPageProps extends StateProps, DispatchProps {} -export interface IConfigurationPageState { - filter: string; - reversePrefix: boolean; - reverseProperties: boolean; -} - -export class ConfigurationPage extends React.Component { - state: IConfigurationPageState = { - filter: '', - reversePrefix: false, - reverseProperties: false - }; - - componentDidMount() { - this.props.getConfigurations(); - this.props.getEnv(); - } - - setFilter = evt => { - this.setState({ - filter: evt.target.value - }); - }; - - envFilterFn = configProp => configProp.toUpperCase().includes(this.state.filter.toUpperCase()); - propsFilterFn = configProp => configProp.prefix.toUpperCase().includes(this.state.filter.toUpperCase()); - - reversePrefix = () => { - this.setState({ - reversePrefix: !this.state.reversePrefix - }); - }; - - reverseProperties = () => { - this.setState({ - reverseProperties: !this.state.reverseProperties - }); - }; - - getContextList = contexts => Object.values(contexts).map((v: any) => v.beans).reduce((acc, e) => ({ ...acc, ...e })); - - - render() { - const { configuration } = this.props; - const { filter } = this.state; - const configProps = configuration && configuration.configProps ? configuration.configProps : {}; - const env = configuration && configuration.env ? configuration.env : {}; - return ( -
    -

    - Configuration -

    - - Filter - {' '} - - - - - - - - - - - {configProps.contexts ? Object.values(this.getContextList(configProps.contexts)) - .filter(this.propsFilterFn) - .map((property, propIndex) => ( - - - {propKey} - - {JSON.stringify(property['properties'][propKey])} - - +export const ConfigurationPage = (props: IConfigurationPageProps) => { + const [filter, setFilter] = useState(''); + const [reversePrefix, setReversePrefix] = useState(false); + const [reverseProperties, setReverseProperties] = useState(false); + + useEffect(() => { + props.getConfigurations(); + props.getEnv(); + }, []); + + const changeFilter = evt => setFilter(evt.target.value); + + const envFilterFn = configProp => configProp.toUpperCase().includes(filter.toUpperCase()); + + const propsFilterFn = configProp => configProp.prefix.toUpperCase().includes(filter.toUpperCase()); + + const changeReversePrefix = () => setReversePrefix(!reversePrefix); + + const changeReverseProperties = () => setReverseProperties(!reverseProperties); + + const getContextList = contexts => + Object.values(contexts) + .map((v: any) => v.beans) + .reduce((acc, e) => ({ ...acc, ...e })); + + const { configuration } = props; + + const configProps = configuration && configuration.configProps ? configuration.configProps : {}; + + const env = configuration && configuration.env ? configuration.env : {}; + + return ( +
    +

    + Configuration +

    + + Filter + {' '} + + +
    - Prefix - - Properties -
    {property['prefix']} - {Object.keys(property['properties']).map((propKey, index) => ( - -
    + + + + + + + + {configProps.contexts + ? Object.values(getContextList(configProps.contexts)) + .filter(propsFilterFn) + .map((property, propIndex) => ( + + + {propKey} + + {JSON.stringify(property['properties'][propKey])} + + + ))} + + + )) + : null} + +
    + Prefix + + Properties +
    {property['prefix']} + {Object.keys(property['properties']).map((propKey, index) => ( + +
    + {env.propertySources + ? env.propertySources.map((envKey, envIndex) => ( +
    +

    + {envKey.name} +

    + + + + + + + + + {Object.keys(envKey.properties) + .filter(envFilterFn) + .map((propKey, propIndex) => ( + + + + ))} - - - )) : null} - -
    PropertyValue
    {propKey} + {envKey.properties[propKey].value} +
    - {env.propertySources ? env.propertySources.map((envKey, envIndex) => ( -
    -

    - {envKey.name} -

    - - - - - - - - - {Object.keys(envKey.properties) - .filter(this.envFilterFn) - .map((propKey, propIndex) => ( - - - - - ))} - -
    PropertyValue
    {propKey} - {envKey.properties[propKey].value} -
    -
    - )) : null} -
    - ); - } -} + + +
    + )) + : null} +
    + ); +}; const mapStateToProps = ({ administration }: IRootState) => ({ configuration: administration.configuration, From 19cd4ab1115a3ebf2b61e85ab7392d5f91e60597 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Sat, 15 Jun 2019 18:49:34 +0200 Subject: [PATCH 179/298] Hooks on health component --- .../administration/health/health.tsx.ejs | 140 ++++++++---------- 1 file changed, 60 insertions(+), 80 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/health/health.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/health/health.tsx.ejs index 5f83a6a7c0cf..828a78446e1b 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/health/health.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/health/health.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Translate } from 'react-jhipster'; import { Table, Badge, Col, Row, Button } from 'reactstrap'; @@ -28,100 +28,80 @@ import HealthModal from './health-modal'; export interface IHealthPageProps extends StateProps, DispatchProps {} -export interface IHealthPageState { - healthObject: any, - showModal: boolean -} +export const HealthPage = (props: IHealthPageProps) => { + const [healthObject, setHealthObject] = useState({}); + const [showModal, setShowModal] = useState(false); -export class HealthPage extends React.Component { - state: IHealthPageState = { - healthObject: {}, - showModal: false + useEffect(() => { + props.systemHealth(); + }, []); + + const getSystemHealth = () => { + if (!props.isFetching) { + props.systemHealth(); + } }; - componentDidMount() { - this.props.systemHealth(); - } + const getSystemHealthInfo = (name, healthObj) => () => { + setShowModal(true); + setHealthObject({ ...healthObj, name }); + }; - getSystemHealth = () => { - if (!this.props.isFetching) { - this.props.systemHealth(); - } - } - - getSystemHealthInfo = (name, healthObject) => () => { - this.setState({ - showModal: true, - healthObject: { - ...healthObject, - name - } - }); - } - - handleClose = () => { - this.setState({ - showModal: false - }); - } - - renderModal = () => { - const { healthObject } = this.state; - return ( - - ); - } - - render() { - const { health, isFetching } = this.props; - const data = (health || {}).details || {}; - return ( -
    -

    Health Checks

    -

    - -

    - - - - - - - - - - - + const handleClose = () => setShowModal(false); + + const renderModal = () => ; + + const { health, isFetching } = props; + const data = (health || {}).details || {}; + + return ( +
    +

    Health Checks

    +

    + +

    + +
    +
    Service NameStatusDetails
    + + + + + + + + {Object.keys(data).map((configPropKey, configPropIndex) => configPropKey !== 'status' ? ( ) : null - )} - -
    Service NameStatusDetails
    {configPropKey} - - {data[configPropKey].status} - + {data[configPropKey].status} {data[configPropKey].details ? ( - - - ) : null} + + + + ) : null}
    - -
    - {this.renderModal()} -
    - ); - } -} + )} + + + + + {renderModal()} +
    + ); +}; const mapStateToProps = (storeState: IRootState) => ({ health: storeState.administration.health, From 60e54f4ea0f4d25055397c005c79cebeb6501165 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Sat, 15 Jun 2019 18:50:24 +0200 Subject: [PATCH 180/298] Hooks on logs component --- .../modules/administration/logs/logs.tsx.ejs | 181 +++++++++++------- 1 file changed, 109 insertions(+), 72 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/logs/logs.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/logs/logs.tsx.ejs index d214bba8c5cb..5bd528fa6b96 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/logs/logs.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/logs/logs.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Translate } from 'react-jhipster'; @@ -25,81 +25,118 @@ import { IRootState } from 'app/shared/reducers'; export interface ILogsPageProps extends StateProps, DispatchProps {} -export interface ILogsPageState { - filter: string -} +export const LogsPage = (props: ILogsPageProps) => { + const [filter, setFilter] = useState(''); -export class LogsPage extends React.Component { + useEffect(() => { + props.getLoggers(); + }, []); - state: ILogsPageState = { - filter: '' + const getLogs = () => { + if (!props.isFetching) { + props.getLoggers(); + } }; - componentDidMount() { - this.props.getLoggers(); - } - - getLogs = () => { - if (!this.props.isFetching) { - this.props.getLoggers(); - } - } - - changeLevel = (loggerName, level) => () => { - this.props.changeLogLevel(loggerName, level); - } - - setFilter = evt => { - this.setState({ - filter: evt.target.value - }); - } - - getClassName = (level, check, className) => level === check ? `btn btn-sm btn-${className}` : 'btn btn-sm btn-light'; - - filterFn = l => l.name.toUpperCase().includes(this.state.filter.toUpperCase()); - - render() { - const { logs, isFetching } = this.props; - const { filter } = this.state; - const loggers = logs ? Object.entries(logs.loggers).map(e => ({ name: e[0], level: e[1].effectiveLevel })) : []; - return ( -
    -

    Logs

    -

    There are {loggers.length.toString()} loggers.

    - - Filter - - - - - - - - - - - { - loggers.filter(this.filterFn).map((logger, i) => - - - - - ) - } - -
    NameLevel
    {logger.name} - - - - - - -
    -
    - ); - } -} + const changeLevel = (loggerName, level) => () => props.changeLogLevel(loggerName, level); + + const changeFilter = evt => setFilter(evt.target.value); + + const getClassName = (level, check, className) => (level === check ? `btn btn-sm btn-${className}` : 'btn btn-sm btn-light'); + + const filterFn = l => l.name.toUpperCase().includes(filter.toUpperCase()); + + const { logs, isFetching } = props; + const loggers = logs ? Object.entries(logs.loggers).map(e => ({ name: e[0], level: e[1].effectiveLevel })) : []; + + return ( +
    +

    + Logs +

    +

    + + There are {loggers.length.toString()} loggers. + +

    + + + Filter + + + + + + + + + + + + {loggers.filter(filterFn).map((logger, i) => ( + + + + + ))} + +
    + + Name + + + + Level + +
    + {logger.name} + + + + + + + +
    +
    + ); +}; const mapStateToProps = ({ administration }: IRootState) => ({ logs: administration.logs, From f41b30cfa90dad989938bdd1c0be5a79b3f1aad5 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Fri, 14 Jun 2019 11:11:54 +0200 Subject: [PATCH 181/298] move role extraction to securityutils --- .../config/SecurityConfiguration.java.ejs | 36 +++---------------- .../package/security/SecurityUtils.java.ejs | 22 +++++++----- package-lock.json | 2 +- 3 files changed, 20 insertions(+), 40 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 14c2fc4c79fc..ae892578d6a5 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -55,26 +55,22 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; <%_ } _%> <%_ if (authenticationType === 'oauth2') { _%> -import org.springframework.core.convert.converter.Converter; -import org.springframework.security.authentication.AbstractAuthenticationToken; import <%= packageName %>.security.oauth2.AudienceValidator; +import <%=packageName%>.security.SecurityUtils; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jwt.*; <%_ if (applicationType === 'gateway') { _%> -import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter; import <%=packageName%>.security.oauth2.AuthorizationHeaderFilter; import <%=packageName%>.security.oauth2.AuthorizationHeaderUtil; <%_ } _%> import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; <%_ if (applicationType !== 'microservice') { _%> import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; <%_ } _%> import java.util.*; -import java.util.stream.Collectors; <%_ } _%> <%_ if (authenticationType === 'session') { _%> <%_ if (!skipUserManagement) { _%> @@ -91,8 +87,8 @@ import <%=packageName%>.security.oauth2.JwtAuthorityExtractor; <%_ if (authenticationType === 'jwt' && applicationType !== 'microservice') { _%> import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; <%_ } _%> - <%_ if (applicationType !== 'microservice') { _%> import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter; + <%_ if (applicationType !== 'microservice') { _%> import org.springframework.web.filter.CorsFilter; <%_ } _%> import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport; @@ -167,7 +163,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ if (authenticationType !== 'uaa' && applicationType !== 'microservice') { _%> @Override - public void configure(WebSecurity web) throws Exception { + public void configure(WebSecurity web) { web.ignoring() .antMatchers(HttpMethod.OPTIONS, "/**") <%_ if (!skipClient) { _%> @@ -308,35 +304,13 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { authorities.forEach(authority -> { OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority; - mappedAuthorities.addAll(mapRolesToGrantedAuthorities( - getRolesFromClaims(oidcUserAuthority.getUserInfo().getClaims()))); + mappedAuthorities.addAll(SecurityUtils.mapRolesToGrantedAuthorities( + SecurityUtils.getRolesFromClaims(oidcUserAuthority.getUserInfo().getClaims()))); }); return mappedAuthorities; }; } <%_ } _%> - private Converter mapGroupOrRolesClaimToGrantedAuthorities() { - return new JwtAuthenticationConverter() { - @Override - protected Collection extractAuthorities(Jwt jwt) { - return mapRolesToGrantedAuthorities( - getRolesFromClaims(jwt.getClaims()) - ); - } - }; - } - - @SuppressWarnings("unchecked") - private Collection getRolesFromClaims(Map claims) { - return (Collection) claims.getOrDefault("groups", - claims.getOrDefault("roles", new ArrayList<>())); - } - - private List mapRolesToGrantedAuthorities(Collection roles) { - return roles.stream() - .filter(role -> role.startsWith("ROLE_")) - .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); - } @Bean JwtDecoder jwtDecoder() { diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 169163fa4cc8..7b48dfd72753 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -18,11 +18,6 @@ -%> package <%=packageName%>.security; -<%_ if (authenticationType === 'oauth2') { _%> - -import net.minidev.json.JSONArray; -import net.minidev.json.JSONObject; -<%_ } _%> import org.springframework.security.core.GrantedAuthority; <%_ if (authenticationType === 'oauth2') { _%> import org.springframework.security.core.authority.SimpleGrantedAuthority; @@ -46,6 +41,7 @@ import reactor.core.publisher.Mono; import java.util.ArrayList; <%_ if (authenticationType === 'oauth2') { _%> import java.util.stream.Collectors; +import java.util.Collection; <%_ } _%> import java.util.List; <%_ if (authenticationType === 'oauth2') { _%> @@ -183,9 +179,19 @@ public final class SecurityUtils { } <%_ if (authenticationType === 'oauth2') { _%> public static List extractAuthorityFromClaims(Map claims) { - return ((JSONArray)((JSONObject)claims.get("realm_access")).get("roles")).stream() - .map(group -> ((String) group)) - .filter(group -> group.startsWith("ROLE_")) + return mapRolesToGrantedAuthorities( + getRolesFromClaims(claims)); + } + + @SuppressWarnings("unchecked") + public static Collection getRolesFromClaims(Map claims) { + return (Collection) claims.getOrDefault("groups", + claims.getOrDefault("roles", new ArrayList<>())); + } + + public static List mapRolesToGrantedAuthorities(Collection roles) { + return roles.stream() + .filter(role -> role.startsWith("ROLE_")) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); } <%_ } _%> diff --git a/package-lock.json b/package-lock.json index 9d859d53895a..6267fab535cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.0.1", + "version": "6.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { From 0cfb3d80d2f9ee9463136d4c3e1678b9e702fa2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sat, 15 Jun 2019 23:43:49 +0200 Subject: [PATCH 182/298] Fix eslint checks --- test/needle-api/needle-server-maven.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/needle-api/needle-server-maven.spec.js b/test/needle-api/needle-server-maven.spec.js index d27b78a40bd2..5f2db8fe8e0e 100644 --- a/test/needle-api/needle-server-maven.spec.js +++ b/test/needle-api/needle-server-maven.spec.js @@ -160,7 +160,7 @@ describe('needle API server maven: JHipster server generator with blueprint', () it('Assert pom.xml has the plugin repository added', () => { assert.fileContent( 'pom.xml', - ' \n' + ' id\n' + ' url\n' + ' ' + ' \n id\n url\n ' ); }); From 1399507b0c5818c67fafb45869174b36bb6fa9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Mon, 17 Jun 2019 09:34:18 +0200 Subject: [PATCH 183/298] fixed formatting and added curlies --- .../src/test/java/package/web/rest/UserResourceIT.java.ejs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs index 432d7becbff5..c16b7695c408 100644 --- a/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs @@ -522,7 +522,7 @@ public class UserResourceIT <% if (databaseType === 'cassandra') { %>extends Abs <%_ if (searchEngine === 'elasticsearch') { _%> mockUserSearchRepository.save(user); <%_ } _%> - <%_ if (cacheManagerIsAvailable === true) { _%> + <%_ if (cacheManagerIsAvailable === true) { _%> assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); <%_ } _%> @@ -556,9 +556,10 @@ public class UserResourceIT <% if (databaseType === 'cassandra') { %>extends Abs .jsonPath("$.langKey").isEqualTo(DEFAULT_LANGKEY); <%_ } _%> - <%_ if (cacheProvider === 'memcached') { _%> - if(!(cacheManager instanceof NoOpCacheManager)) + <%_ if (cacheProvider === 'memcached') { _%> + if (!(cacheManager instanceof NoOpCacheManager)) { assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); + } <%_ } else if (cacheManagerIsAvailable === true) { _%> assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); <%_ } _%> From fbc0361b9642b48bd5b6e3d07f9c24351442a4e1 Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Mon, 17 Jun 2019 08:18:15 -0400 Subject: [PATCH 184/298] Update uuidType to include mysql when mariadb. Azure reports mariadb as mysql --- .../src/main/resources/config/liquibase/master.xml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs index 0e301055fc6d..0c31b3d7dbb2 100644 --- a/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +++ b/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs @@ -27,7 +27,7 @@ <%_ } _%> <%_ if (prodDatabaseType === 'mysql' || prodDatabaseType === 'mariadb') { _%> - + <%_ } else { _%> <%_ } _%> From 9a4a666b4b5314abd2c78d5c385f324470865e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 17 Jun 2019 16:28:13 +0200 Subject: [PATCH 185/298] remove unsuported fields in test integration Those fields are not generated because not supported anymore, but are still printed in the jhipster info phase. By removing them, it is easier to reproduce the errors by copy/pasting jdl --- .../samples/.jhipster/FieldTestEntity.json | 18 ------------------ .../FieldTestInfiniteScrollEntity.json | 18 ------------------ .../.jhipster/FieldTestMapstructEntity.json | 18 ------------------ .../.jhipster/FieldTestPagerEntity.json | 18 ------------------ .../.jhipster/FieldTestPaginationEntity.json | 18 ------------------ .../.jhipster/FieldTestServiceClassEntity.json | 18 ------------------ .../.jhipster/FieldTestServiceImplEntity.json | 18 ------------------ 7 files changed, 126 deletions(-) diff --git a/test-integration/samples/.jhipster/FieldTestEntity.json b/test-integration/samples/.jhipster/FieldTestEntity.json index 59d3ef4d33d3..969c52746c6d 100644 --- a/test-integration/samples/.jhipster/FieldTestEntity.json +++ b/test-integration/samples/.jhipster/FieldTestEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesTom", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesTom", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json b/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json index 519575cf64ca..c55961ac81e1 100644 --- a/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json +++ b/test-integration/samples/.jhipster/FieldTestInfiniteScrollEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesHugo", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesHugo", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestMapstructEntity.json b/test-integration/samples/.jhipster/FieldTestMapstructEntity.json index 22ca0661414e..42b149bb98dd 100644 --- a/test-integration/samples/.jhipster/FieldTestMapstructEntity.json +++ b/test-integration/samples/.jhipster/FieldTestMapstructEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesEva", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesEva", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestPagerEntity.json b/test-integration/samples/.jhipster/FieldTestPagerEntity.json index ae8b6367e8c0..9c0e752bf77c 100644 --- a/test-integration/samples/.jhipster/FieldTestPagerEntity.json +++ b/test-integration/samples/.jhipster/FieldTestPagerEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesJade", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesJade", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestPaginationEntity.json b/test-integration/samples/.jhipster/FieldTestPaginationEntity.json index 4fdeda9f0c95..5dfadde1b8b9 100644 --- a/test-integration/samples/.jhipster/FieldTestPaginationEntity.json +++ b/test-integration/samples/.jhipster/FieldTestPaginationEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesAlice", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesAlice", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json b/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json index 5666a7feb11a..8b186e206bb1 100644 --- a/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json +++ b/test-integration/samples/.jhipster/FieldTestServiceClassEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesBob", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesBob", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", diff --git a/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json b/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json index bdcb03bd5766..34c0e02b1a8e 100644 --- a/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json +++ b/test-integration/samples/.jhipster/FieldTestServiceImplEntity.json @@ -318,24 +318,6 @@ "fieldValidateRules": [ "required" ] - }, - { - "fieldName": "byteTextMinbytesMika", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "minbytes" - ], - "fieldValidateRulesMinbytes": 0 - }, - { - "fieldName": "byteTextMaxbytesMika", - "fieldType": "byte[]", - "fieldTypeBlobContent": "text", - "fieldValidateRules": [ - "maxbytes" - ], - "fieldValidateRulesMaxbytes": 10000 } ], "changelogDate": "20160208184031", From 26c86e38eaef09653f2d1fca107ccc1a98f2ea3b Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Mon, 17 Jun 2019 19:00:59 +0200 Subject: [PATCH 186/298] Hooks on user-management-detail component --- .../user-management-detail.tsx.ejs | 129 +++++++++--------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-detail.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-detail.tsx.ejs index ff6ee788655f..922fc6303f20 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-detail.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-detail.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { Link, RouteComponentProps } from 'react-router-dom'; import { Button, Row, Badge } from 'reactstrap'; @@ -28,76 +28,75 @@ import { APP_DATE_FORMAT } from 'app/config/constants'; import { getUser } from './user-management.reducer'; import { IRootState } from 'app/shared/reducers'; -export interface IUserManagementDetailProps extends StateProps, DispatchProps, RouteComponentProps<{login: string}> {} +export interface IUserManagementDetailProps extends StateProps, DispatchProps, RouteComponentProps<{ login: string }> {} -export class UserManagementDetail extends React.Component { - componentDidMount() { - this.props.getUser(this.props.match.params.login); - } +export const UserManagementDetail = (props: IUserManagementDetailProps) => { + useEffect(() => { + props.getUser(props.match.params.login); + }, []); - render() { - const { user } = this.props; - return ( -
    -

    - User [{user.login}] -

    - -
    -
    Login
    -
    - {user.login}  + const { user } = props; + + return ( +
    +

    + User [{user.login}] +

    + +
    +
    Login
    +
    + {user.login}  + { + user.activated ? ( + Activated + ) : ( + Deactivated + ) + } +
    +
    First Name
    +
    {user.firstName}
    +
    Last Name
    +
    {user.lastName}
    +
    Email
    +
    {user.email}
    + <%_ if (enableTranslation) { _%> +
    Lang Key
    +
    {user.langKey ? languages[user.langKey].name : undefined}
    + <%_ } _%> +
    Created By
    +
    {user.createdBy}
    +
    Created Date
    +
    +
    Last Modified By
    +
    {user.lastModifiedBy}
    +
    Last Modified Date
    +
    +
    Profiles
    +
    +
      { - user.activated ? ( - Activated - ) : ( - Deactivated - ) - } -
    -
    First Name
    -
    {user.firstName}
    -
    Last Name
    -
    {user.lastName}
    -
    Email
    -
    {user.email}
    - <%_ if (enableTranslation) { _%> -
    Lang Key
    -
    {user.langKey ? languages[user.langKey].name : undefined}
    - <%_ } _%> -
    Created By
    -
    {user.createdBy}
    -
    Created Date
    -
    -
    Last Modified By
    -
    {user.lastModifiedBy}
    -
    Last Modified Date
    -
    -
    Profiles
    -
    -
      - { - user.authorities ? ( - user.authorities.map((authority, i) => ( + user.authorities ? ( + user.authorities.map((authority, i) => (
    • {authority}
    • - ))) : null - } -
    -
    -
    -
    - -
    - ); - } -} + ))) : null + } + +
    +
    +
    + +
    + ); +}; const mapStateToProps = (storeState: IRootState) => ({ user: storeState.userManagement.user From c5bf5d6f090f2f0afa0afbd111b1e6fa305669dc Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 17 Jun 2019 19:21:13 +0100 Subject: [PATCH 187/298] Use snapshot JHipster lib version 3.0.3-SNAPSHOT --- generators/server/templates/build.gradle.ejs | 2 ++ generators/server/templates/gradle.properties.ejs | 2 +- generators/server/templates/pom.xml.ejs | 13 ++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 470acdf767e6..9a3507dd3841 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -255,6 +255,8 @@ repositories { } } <%_ } _%> + // TODO To remove after final JHipster release + maven { url "http://oss.sonatype.org/content/repositories/snapshots" } //jhipster-needle-gradle-repositories - JHipster will add additional repositories } diff --git a/generators/server/templates/gradle.properties.ejs b/generators/server/templates/gradle.properties.ejs index 6afd2ff23aad..51a9e16737c4 100644 --- a/generators/server/templates/gradle.properties.ejs +++ b/generators/server/templates/gradle.properties.ejs @@ -25,7 +25,7 @@ npm_version=<%= NPM_VERSION %> yarn_version=<%= YARN_VERSION %> # Dependency versions -jhipster_dependencies_version=3.0.2 +jhipster_dependencies_version=3.0.3-SNAPSHOT # 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.1.5.RELEASE diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 95e143548920..d71ee0c8cfb6 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -41,6 +41,17 @@ <%_ } _%> + + + oss.sonatype.org-snapshot + http://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + @@ -80,7 +91,7 @@ - 3.0.2 + 3.0.3-SNAPSHOT 2.1.5.RELEASE From 54bb94a9d61febd3c5c7e25ca00765643f78758f Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 17 Jun 2019 19:29:57 +0100 Subject: [PATCH 188/298] Update spring-boot version to 2.1.6.RELEASE --- generators/server/templates/gradle.properties.ejs | 2 +- generators/server/templates/pom.xml.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/gradle.properties.ejs b/generators/server/templates/gradle.properties.ejs index 51a9e16737c4..9ed30a609c83 100644 --- a/generators/server/templates/gradle.properties.ejs +++ b/generators/server/templates/gradle.properties.ejs @@ -28,7 +28,7 @@ yarn_version=<%= YARN_VERSION %> jhipster_dependencies_version=3.0.3-SNAPSHOT # 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.1.5.RELEASE +spring_boot_version=2.1.6.RELEASE # The hibernate version should match the one managed by # https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} --> hibernate_version=5.3.10.Final diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index d71ee0c8cfb6..b20fa5c9c0b3 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -94,7 +94,7 @@ 3.0.3-SNAPSHOT - 2.1.5.RELEASE + 2.1.6.RELEASE <%_ if (databaseType === 'sql') { _%> From 64516f52e4b93bb40df5efcbb45af9f27a14f285 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 17 Jun 2019 19:37:19 +0100 Subject: [PATCH 189/298] Update maven-war-plugin version to 3.2.3 --- generators/server/templates/pom.xml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index b20fa5c9c0b3..6a941dfce5f3 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -135,7 +135,7 @@ 2.2.1 3.1.0 3.0.0-M3 - 3.2.2 + 3.2.3 <%_ if (!skipClient) { _%> 1.7.6 <%_ } _%> From 649e669d38f28669a8c217ccb21780288dda8694 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Mon, 17 Jun 2019 19:43:08 +0100 Subject: [PATCH 190/298] Update spring version to 5.1.8.RELEASE --- generators/server/templates/pom.xml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 6a941dfce5f3..9931552c2919 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -98,7 +98,7 @@ <%_ if (databaseType === 'sql') { _%> - 5.1.7.RELEASE + 5.1.8.RELEASE 5.3.10.Final From e27dc9e84d42d35835055c77b204d2be62a5c10b Mon Sep 17 00:00:00 2001 From: Michael Weis Date: Sat, 8 Jun 2019 18:00:32 +0200 Subject: [PATCH 191/298] load changeset moved to end of file; additional needle to add load columns --- .../liquibase/changelog/added_entity.xml.ejs | 48 ++++++++++--------- generators/generator-base.js | 10 ++++ .../needle-api/needle-server-liquibase.js | 7 +++ .../needle-server-liquibase.spec.js | 6 +++ 4 files changed, 48 insertions(+), 23 deletions(-) diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index 631dd6028009..34fd74f71eba 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -152,6 +152,30 @@ } _%> + + <%_ for (idx in relationships) { + const relationshipType = relationships[idx].relationshipType, + relationshipName = relationships[idx].relationshipName, + ownerSide = relationships[idx].ownerSide, + otherEntityName = relationships[idx].otherEntityName; + if (relationshipType === 'many-to-many' && ownerSide) { + const joinTableName = getJoinTableName(entityTableName, relationshipName, prodDatabaseType); + _%> + + + + + + + + + + + + <% } %><% } %> + + + - - <%_ for (idx in relationships) { - const relationshipType = relationships[idx].relationshipType, - relationshipName = relationships[idx].relationshipName, - ownerSide = relationships[idx].ownerSide, - otherEntityName = relationships[idx].otherEntityName; - if (relationshipType === 'many-to-many' && ownerSide) { - const joinTableName = getJoinTableName(entityTableName, relationshipName, prodDatabaseType); - _%> - - - - - - - - - - - - <% } %><% } %> - - diff --git a/generators/generator-base.js b/generators/generator-base.js index c1bc760b3c75..a48848c59473 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -501,6 +501,16 @@ module.exports = class extends PrivateBase { this.needleApi.serverLiquibase.addColumnToEntityChangeset(filePath, content); } + /** + * Add a new load column to a Liquibase changelog file for entity. + * + * @param {string} filePath - The full path of the changelog file. + * @param {string} content - The content to be added as column, can have multiple columns as well + */ + addLoadColumnToLiquibaseEntityChangeSet(filePath, content) { + this.needleApi.serverLiquibase.addLoadColumnToEntityChangeSet(filePath, content); + } + /** * Add a new changeset to a Liquibase changelog file for entity. * diff --git a/generators/server/needle-api/needle-server-liquibase.js b/generators/server/needle-api/needle-server-liquibase.js index 31b7d1168bdc..c124bc72f0e3 100644 --- a/generators/server/needle-api/needle-server-liquibase.js +++ b/generators/server/needle-api/needle-server-liquibase.js @@ -48,6 +48,13 @@ module.exports = class extends needleServer { this.addBlockContentToFile(rewriteFileModel, errorMessage); } + addLoadColumnToEntityChangeSet(filePath, content) { + const errorMessage = 'LoadColumn not added.'; + const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-liquibase-add-loadcolumn', content); + + this.addBlockContentToFile(rewriteFileModel, errorMessage); + } + addChangesetToEntityChangelog(filePath, content) { const errorMessage = 'Changeset not added.'; const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-liquibase-add-changeset', content); diff --git a/test/needle-api/needle-server-liquibase.spec.js b/test/needle-api/needle-server-liquibase.spec.js index 9550acf9ac86..c112d5202562 100644 --- a/test/needle-api/needle-server-liquibase.spec.js +++ b/test/needle-api/needle-server-liquibase.spec.js @@ -80,6 +80,12 @@ const mockBlueprintSubGen = class extends ServerGenerator { ' \n' + ' ' ); + }, + addLoadColumnStep() { + this.addLoadColumnToLiquibaseEntityChangeSet( + `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, + ' ' + ); } }; return { ...phaseFromJHipster, ...customPhaseSteps }; From a621d8571792cbd3b5f345816fd71587f4882a3b Mon Sep 17 00:00:00 2001 From: Michael Weis Date: Sat, 8 Jun 2019 22:40:37 +0200 Subject: [PATCH 192/298] add test; fix formatting --- generators/generator-base.js | 2 +- .../needle-api/needle-server-liquibase.js | 2 +- .../needle-server-liquibase.spec.js | 19 +++++++++++++------ .../changelog/dummy_changelog.xml.ejs | 12 ++++++++++++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/generators/generator-base.js b/generators/generator-base.js index a48848c59473..ba474403c96d 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -503,7 +503,7 @@ module.exports = class extends PrivateBase { /** * Add a new load column to a Liquibase changelog file for entity. - * + * * @param {string} filePath - The full path of the changelog file. * @param {string} content - The content to be added as column, can have multiple columns as well */ diff --git a/generators/server/needle-api/needle-server-liquibase.js b/generators/server/needle-api/needle-server-liquibase.js index c124bc72f0e3..7c04bfbfc10d 100644 --- a/generators/server/needle-api/needle-server-liquibase.js +++ b/generators/server/needle-api/needle-server-liquibase.js @@ -51,7 +51,7 @@ module.exports = class extends needleServer { addLoadColumnToEntityChangeSet(filePath, content) { const errorMessage = 'LoadColumn not added.'; const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-liquibase-add-loadcolumn', content); - + this.addBlockContentToFile(rewriteFileModel, errorMessage); } diff --git a/test/needle-api/needle-server-liquibase.spec.js b/test/needle-api/needle-server-liquibase.spec.js index c112d5202562..ddffd5ecf07c 100644 --- a/test/needle-api/needle-server-liquibase.spec.js +++ b/test/needle-api/needle-server-liquibase.spec.js @@ -84,7 +84,7 @@ const mockBlueprintSubGen = class extends ServerGenerator { addLoadColumnStep() { this.addLoadColumnToLiquibaseEntityChangeSet( `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, - ' ' + ' ' ); } }; @@ -160,16 +160,23 @@ describe('needle API server liquibase: JHipster server generator with blueprint' ); }); + it('Assert that load column is added to an existing changelog', () => { + assert.fileContent( + `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, + ' ' + ); + }); + it('Assert that changeSet is added to an existing changelog', () => { assert.fileContent( `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, ' \n' + ' \n' + - ' \n' + // eslint-disable-line - ' \n' + - ' \n' + - ' \n' + - ' ' + ' \n' + // eslint-disable-line + ' \n' + + ' \n' + + ' \n' + + ' ' ); }); }); diff --git a/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs b/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs index c6ac59f83ad4..2ba316655e8e 100644 --- a/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs +++ b/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs @@ -49,4 +49,16 @@ + + + + + + + + From 27c9596d3599b45e149803a3d7cb76e63eebfe7d Mon Sep 17 00:00:00 2001 From: Michael Weis Date: Mon, 17 Jun 2019 22:32:26 +0200 Subject: [PATCH 193/298] fix prettier issue --- test/needle-api/needle-server-liquibase.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/needle-api/needle-server-liquibase.spec.js b/test/needle-api/needle-server-liquibase.spec.js index ddffd5ecf07c..9b32e33b4f41 100644 --- a/test/needle-api/needle-server-liquibase.spec.js +++ b/test/needle-api/needle-server-liquibase.spec.js @@ -173,10 +173,10 @@ describe('needle API server liquibase: JHipster server generator with blueprint' ' \n' + ' \n' + ' \n' + // eslint-disable-line - ' \n' + - ' \n' + - ' \n' + - ' ' + ' \n' + + ' \n' + + ' \n' + + ' ' ); }); }); From a8d4c8a3bbf88b9d83a58d84f48179e1f9417d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20PHAM?= Date: Tue, 18 Jun 2019 17:12:03 +0200 Subject: [PATCH 194/298] fix for angular cli --- generators/client/templates/angular/angular.json.ejs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/client/templates/angular/angular.json.ejs b/generators/client/templates/angular/angular.json.ejs index b9c1d4cdc196..a982f7483d12 100644 --- a/generators/client/templates/angular/angular.json.ejs +++ b/generators/client/templates/angular/angular.json.ejs @@ -45,10 +45,10 @@ }, "prefix": "<%= jhiPrefixDashed %>", "architect": {} - }, - "defaultProject": "<%= dasherizedBaseName %>", - "cli": { - "packageManager": "<%= clientPackageManager %>" } - } + }, + "defaultProject": "<%= dasherizedBaseName %>", + "cli": { + "packageManager": "<%= clientPackageManager %>" + } } From 8ce7782a357ea35bdd21eabddfa60992e587d38d Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Tue, 18 Jun 2019 20:35:57 +0200 Subject: [PATCH 195/298] Hooks on user-management-delete-dialog component --- .../user-management-delete-dialog.tsx.ejs | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-delete-dialog.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-delete-dialog.tsx.ejs index 88524f2e6de7..9f8b8741c740 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-delete-dialog.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-delete-dialog.tsx.ejs @@ -16,56 +16,54 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap'; -import { Translate, ICrudGetAction, ICrudDeleteAction } from 'react-jhipster'; +import { Translate } from 'react-jhipster'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { IUser } from 'app/shared/model/user.model'; import { getUser, deleteUser } from './user-management.reducer'; import { IRootState } from 'app/shared/reducers'; -export interface IUserManagementDeleteDialogProps extends StateProps, DispatchProps, RouteComponentProps<{login: string}> {} +export interface IUserManagementDeleteDialogProps extends StateProps, DispatchProps, RouteComponentProps<{ login: string }> {} -export class UserManagementDeleteDialog extends React.Component { - componentDidMount() { - this.props.getUser(this.props.match.params.login); - } +export const UserManagementDeleteDialog = (props: IUserManagementDeleteDialogProps) => { + useEffect(() => { + props.getUser(props.match.params.login); + }, []); - confirmDelete = event => { - this.props.deleteUser(this.props.user.login); - this.handleClose(event); - } + const confirmDelete = event => { + props.deleteUser(props.user.login); + handleClose(event); + }; - handleClose = event => { + const handleClose = event => { event.stopPropagation(); - this.props.history.goBack(); - } + props.history.goBack(); + }; - render() { - const { user } = this.props; - return ( - - Confirm delete operation + const { user } = props; + + return ( + + Confirm delete operation Are you sure you want to delete this User? - - - ); - } -} + ); +}; const mapStateToProps = (storeState: IRootState) => ({ user: storeState.userManagement.user From e28402bb30ecfb2136c49d080b1e35677c25f2d7 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Tue, 18 Jun 2019 20:51:20 +0200 Subject: [PATCH 196/298] Hooks on user-management-update component --- .../user-management-update.tsx.ejs | 371 +++++++++--------- 1 file changed, 180 insertions(+), 191 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-update.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-update.tsx.ejs index 48c293e5dd36..f51244015565 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-update.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management-update.tsx.ejs @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Link, RouteComponentProps } from 'react-router-dom'; import { Button, Label, Row, Col } from 'reactstrap'; import { AvForm, AvGroup, AvInput, AvField, AvFeedback } from 'availity-reactstrap-validation'; -import { Translate, translate, ICrudGetAction, ICrudGetAllAction, ICrudPutAction } from 'react-jhipster'; +import { Translate, translate } from 'react-jhipster'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; <%_ if (enableTranslation) { _%> @@ -30,208 +30,197 @@ import { locales, languages } from 'app/config/translation'; import { getUser, getRoles, updateUser, createUser, reset } from './user-management.reducer'; import { IRootState } from 'app/shared/reducers'; -export interface IUserManagementUpdateProps extends StateProps, DispatchProps, RouteComponentProps<{login: string}> {} +export interface IUserManagementUpdateProps extends StateProps, DispatchProps, RouteComponentProps<{ login: string }> {} -export interface IUserManagementUpdateState { - isNew: boolean; -} +export const UserManagementUpdate = (props: IUserManagementUpdateProps) => { + const [isNew, setIsNew] = useState(!props.match.params || !props.match.params.login); -export class UserManagementUpdate extends React.Component { - - state: IUserManagementUpdateState = { - isNew: !this.props.match.params || !this.props.match.params.login - }; - - componentDidMount() { - if (this.state.isNew) { - this.props.reset(); + useEffect(() => { + if (isNew) { + props.reset(); } else { - this.props.getUser(this.props.match.params.login); + props.getUser(props.match.params.login); } - this.props.getRoles(); - } - - componentWillUnmount() { - this.props.reset(); - } + props.getRoles(); + return () => props.reset(); + }, []); - saveUser = (event, values) => { - if (this.state.isNew) { - this.props.createUser(values); + const saveUser = (event, values) => { + if (isNew) { + props.createUser(values); } else { - this.props.updateUser(values); + props.updateUser(values); } - this.handleClose(); - } - - handleClose = () => { - this.props.history.push('/admin/user-management'); - } - - render() { - const isInvalid = false; - const { user, loading, updating, roles } = this.props; - return ( -
    - - -

    - Create or edit a User -

    - -
    - - - { loading ?

    Loading...

    - : - {user.id ? ( - - - - - ) : null} - - - - + handleClose(); + }; + + const handleClose = () => { + props.history.push('/admin/user-management'); + }; + + const isInvalid = false; + const { user, loading, updating, roles } = props; + + return ( +
    + + +

    + Create or edit a User +

    + +
    + + + { loading ?

    Loading...

    + : + {user.id ? ( - - - - + + + + + + - This field cannot be longer than 50 characters. - - - + + + - - - - - <%_ if (enableTranslation) { _%> - - - - {locales.map(locale => - - )} - - - <%_ } _%> - - - - {roles.map(role => ( - - ))} - - - -   - - - } - -
    -
    - ); - } -} + This field cannot be longer than 50 characters. + + + + + + + + <%_ if (enableTranslation) { _%> + + + + {locales.map(locale => + + )} + + + <%_ } _%> + + + + {roles.map(role => ( + + ))} + + + +   + +
    + } + +
    +
    + ); +}; const mapStateToProps = (storeState: IRootState) => ({ user: storeState.userManagement.user, From 1639c5e712b2edb567d4387250155c2ca39e1d53 Mon Sep 17 00:00:00 2001 From: Alejandro Matos <42916953+amatosg@users.noreply.github.com> Date: Tue, 18 Jun 2019 23:49:02 -0500 Subject: [PATCH 197/298] Creating inline variable && removing unused params creating inline variable for `private createFromForm()` and removing unused parameters in `subscribeToSaveResponse` --- .../entities/entity-management-update.component.ts.ejs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.ts.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.ts.ejs index f219d80e9502..5eb2d36876a3 100644 --- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.ts.ejs +++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-update.component.ts.ejs @@ -262,7 +262,7 @@ _%> } private createFromForm(): I<%= entityAngularName %> { - const entity = { + return { ...new <%= entityAngularName %>(), id: this.editForm.get(['id']).value, <%_ for (idx in fields) { @@ -303,13 +303,12 @@ _%> <%= relationshipFieldNamePlural %>: this.editForm.get(['<%= relationshipFieldNamePlural %>']).value, <%_ } _%> <%_ } _%> - } - return entity; + }; } protected subscribeToSaveResponse(result: Observable>>) { - result.subscribe((res: HttpResponse>) => - this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError()); + result.subscribe(() => + this.onSaveSuccess(), () => this.onSaveError()); } protected onSaveSuccess() { From 0a44eac02b0d2f12e7cc942bef6bfa10fe66842d Mon Sep 17 00:00:00 2001 From: Frederik Hahne Date: Wed, 19 Jun 2019 07:16:44 +0200 Subject: [PATCH 198/298] allow data uris as image source via csp (#9923) --- .../src/main/java/package/config/SecurityConfiguration.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index a27c1fd4c867..6858cb182170 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -226,7 +226,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> .and() .headers() - .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'") + .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:") .and() .referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN) .and() From 25fc156409a9a02ea4e166713561e675c291e8bf Mon Sep 17 00:00:00 2001 From: DanielFran Date: Wed, 19 Jun 2019 10:44:27 +0100 Subject: [PATCH 199/298] Fix Javadoc --- .../main/java/package/service/EntityQueryService.java.ejs | 6 ++++-- .../main/java/package/web/rest/EntityResource.java.ejs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs b/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs index 240bb75ce82f..602d7e5e9152 100644 --- a/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs @@ -112,8 +112,10 @@ public class <%= serviceClassName %> extends QueryService<<%= asEntity(entityCla } /** - * Function to convert <%= criteria %> to a {@link Specification}. - */ + * Function to convert ConsumerCriteria to a {@link Specification} + * @param criteria The object which holds all the filters, which the entities should match. + * @return the matching {@link Specification} of the entity. + */ private Specification<<%= asEntity(entityClass) %>> createSpecification(<%= criteria %> criteria) { Specification<<%= asEntity(entityClass) %>> specification = Specification.where(null); if (criteria != null) { diff --git a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs index 79d0406e6b8d..189aaf7c8d96 100644 --- a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs @@ -183,7 +183,9 @@ public class <%= entityClass %>Resource { /** * {@code GET /<%= entityApiUrl %>} : get all the <%= entityInstancePlural %>. *<% if (pagination !== 'no') { %> - * @param pageable the pagination information.<% } if (!jpaMetamodelFiltering && fieldsContainOwnerManyToMany) { %> + * @param pageable the pagination information. + * @param queryParams a {@link MultiValueMap} query parameters. + * @param uriBuilder a {@link UriComponentsBuilder} URI builder.<% } if (!jpaMetamodelFiltering && fieldsContainOwnerManyToMany) { %> * @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).<% } if (jpaMetamodelFiltering) { %> * @param criteria the criteria which the requested entities should match.<% } else if (fieldsContainNoOwnerOneToOne) { %> * @param filter the filter of the request.<% } %> @@ -244,7 +246,9 @@ public class <%= entityClass %>Resource { * to the query. * * @param query the query of the <%= entityInstance %> search.<% if (pagination !== 'no') { %> - * @param pageable the pagination information.<% } %> + * @param pageable the pagination information. + * @param queryParams a {@link MultiValueMap} query parameters. + * @param uriBuilder a {@link UriComponentsBuilder} URI builder.<% } %> * @return the result of the search. */ @GetMapping("/_search/<%= entityApiUrl %>")<%- include('../../common/search_template', {asEntity, asDto, viaService}); -%><% } %> From aa6bee358a5145878399ba154c1b6804732e2ec3 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Wed, 19 Jun 2019 13:48:48 +0300 Subject: [PATCH 200/298] Fix jhipsterContext for entity client, server and i18n blueprints and allow creating blueprints without having to override the parent entity sub-gen --- generators/entity-client/index.js | 5 +- generators/entity-i18n/index.js | 5 +- generators/entity-server/index.js | 3 +- .../blueprint/entity-client-blueprint.spec.js | 74 ++++++++++++++++++ test/blueprint/entity-i18n-blueprint.spec.js | 75 +++++++++++++++++++ .../blueprint/entity-server-blueprint.spec.js | 74 ++++++++++++++++++ test/needle-api/needle-client-react.spec.js | 2 +- .../needle-server-liquibase.spec.js | 2 +- test/templates/ngx-blueprint/.yo-rc.json | 2 +- .../ngx-blueprint/HelloKotlin.kt.ejs | 17 +++++ .../templates/ngx-blueprint/HelloVue.html.ejs | 44 +++++++++++ .../ngx-blueprint/custom-i18n.json.ejs | 23 ++++++ 12 files changed, 318 insertions(+), 8 deletions(-) create mode 100644 test/blueprint/entity-client-blueprint.spec.js create mode 100644 test/blueprint/entity-i18n-blueprint.spec.js create mode 100644 test/blueprint/entity-server-blueprint.spec.js create mode 100644 test/templates/ngx-blueprint/HelloKotlin.kt.ejs create mode 100644 test/templates/ngx-blueprint/HelloVue.html.ejs create mode 100644 test/templates/ngx-blueprint/custom-i18n.json.ejs diff --git a/generators/entity-client/index.js b/generators/entity-client/index.js index 6818688e1cb1..0f7959cce330 100644 --- a/generators/entity-client/index.js +++ b/generators/entity-client/index.js @@ -27,8 +27,9 @@ let useBlueprint; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { super(args, opts); - utils.copyObjectProps(this, this.options.context); - this.configOptions = this.options.configOptions || {}; + utils.copyObjectProps(this, opts.context); + this.jhipsterContext = opts.jhipsterContext || opts.context; + this.configOptions = opts.configOptions || {}; const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); if (!opts.fromBlueprint) { // use global variable since getters dont have access to instance property diff --git a/generators/entity-i18n/index.js b/generators/entity-i18n/index.js index 46161dcd9d29..939bdddbc376 100644 --- a/generators/entity-i18n/index.js +++ b/generators/entity-i18n/index.js @@ -27,8 +27,9 @@ let useBlueprint; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { super(args, opts); - utils.copyObjectProps(this, this.options.context); - this.configOptions = this.options.configOptions || {}; + utils.copyObjectProps(this, opts.context); + this.jhipsterContext = opts.jhipsterContext || opts.context; + this.configOptions = opts.configOptions || {}; const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); if (!opts.fromBlueprint) { // use global variable since getters dont have access to instance property diff --git a/generators/entity-server/index.js b/generators/entity-server/index.js index 389adfcb6087..75a731872226 100644 --- a/generators/entity-server/index.js +++ b/generators/entity-server/index.js @@ -28,7 +28,8 @@ module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { super(args, opts); utils.copyObjectProps(this, opts.context); - this.configOptions = this.options.configOptions || {}; + this.jhipsterContext = opts.jhipsterContext || opts.context; + this.configOptions = opts.configOptions || {}; if (this.databaseType === 'cassandra') { this.pkType = 'UUID'; } diff --git a/test/blueprint/entity-client-blueprint.spec.js b/test/blueprint/entity-client-blueprint.spec.js new file mode 100644 index 000000000000..0dc074ae32a5 --- /dev/null +++ b/test/blueprint/entity-client-blueprint.spec.js @@ -0,0 +1,74 @@ +const path = require('path'); +const fse = require('fs-extra'); +const assert = require('yeoman-assert'); +const helpers = require('yeoman-test'); +const expectedFiles = require('../utils/expected-files').entity; +const EntityClientGenerator = require('../../generators/entity-client'); +const constants = require('../../generators/generator-constants'); + +const CLIENT_MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR; +const ANGULAR_DIR = constants.ANGULAR_DIR; + +const mockBlueprintSubGen = class extends EntityClientGenerator { + constructor(args, opts) { + super(args, { fromBlueprint: true, ...opts }); // fromBlueprint variable is important + + if (!this.jhipsterContext) { + this.error('This is a JHipster blueprint and should be used only like jhipster --blueprint myblueprint'); + } + } + + get writing() { + return { + customPhase() { + this.name = 'JHipster'; + this.template(path.join(process.cwd(), 'HelloVue.html.ejs'), `${ANGULAR_DIR}HelloVue.html`); + } + }; + } +}; + +describe('JHipster entity client generator with blueprint', () => { + const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; + + blueprintNames.forEach(blueprintName => { + describe(`generate client entity with blueprint option '${blueprintName}'`, () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/entity')) + .inTmpDir(dir => { + fse.copySync(path.join(__dirname, '../../test/templates/ngx-blueprint'), dir); + }) + .withArguments(['foo']) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: blueprintName, + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:entity-client']]) + .withPrompts({ + fieldAdd: false, + relationshipAdd: false, + dto: 'no', + service: 'no', + pagination: 'no' + }) + .on('end', done); + }); + + it('creates expected server + i18n entity files from jhipster entity generator', () => { + assert.file(expectedFiles.server); + assert.file(`${CLIENT_MAIN_SRC_DIR}i18n/en/foo.json`); + }); + + it('does not create default entity client files from jhipster entity generator', () => { + assert.noFile(expectedFiles.clientNg2); + }); + + it('contains the specific change added by the blueprint', () => { + assert.fileContent(`${ANGULAR_DIR}HelloVue.html`, /Hello JHipster/); + }); + }); + }); +}); diff --git a/test/blueprint/entity-i18n-blueprint.spec.js b/test/blueprint/entity-i18n-blueprint.spec.js new file mode 100644 index 000000000000..fc3654293bd5 --- /dev/null +++ b/test/blueprint/entity-i18n-blueprint.spec.js @@ -0,0 +1,75 @@ +const path = require('path'); +const fse = require('fs-extra'); +const assert = require('yeoman-assert'); +const helpers = require('yeoman-test'); +const expectedFiles = require('../utils/expected-files').entity; +const EntityI18NGenerator = require('../../generators/entity-i18n'); +const constants = require('../../generators/generator-constants'); + +const CLIENT_MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR; + +const mockBlueprintSubGen = class extends EntityI18NGenerator { + constructor(args, opts) { + super(args, { fromBlueprint: true, ...opts }); // fromBlueprint variable is important + + if (!this.jhipsterContext) { + this.error('This is a JHipster blueprint and should be used only like jhipster --blueprint myblueprint'); + } + } + + get writing() { + return { + customPhase() { + this.name = 'JHipster'; + this.template(path.join(process.cwd(), 'custom-i18n.json.ejs'), `${CLIENT_MAIN_SRC_DIR}i18n/custom-i18n.json`); + } + }; + } +}; + +describe('JHipster entity server generator with blueprint', () => { + const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; + + blueprintNames.forEach(blueprintName => { + describe(`generate server entity with blueprint option '${blueprintName}'`, () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/entity')) + .inTmpDir(dir => { + fse.copySync(path.join(__dirname, '../../test/templates/ngx-blueprint'), dir); + }) + .withArguments(['foo']) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: blueprintName, + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:entity-i18n']]) + .withPrompts({ + fieldAdd: false, + relationshipAdd: false, + dto: 'no', + service: 'no', + pagination: 'no' + }) + .on('end', done); + }); + + it('creates expected entity server + client files from jhipster entity generator', () => { + assert.file(expectedFiles.server); + assert.file(expectedFiles.clientNg2); + }); + + it('does not create default entity i18n files from jhipster entity generator', () => { + assert.noFile(`${CLIENT_MAIN_SRC_DIR}i18n/en/foo.json`); + }); + + it('contains the specific change added by the blueprint', () => { + assert.JSONFileContent(`${CLIENT_MAIN_SRC_DIR}i18n/custom-i18n.json`, { + myblueprintApp: { name: 'JHipster' } + }); + }); + }); + }); +}); diff --git a/test/blueprint/entity-server-blueprint.spec.js b/test/blueprint/entity-server-blueprint.spec.js new file mode 100644 index 000000000000..51dae7a40e78 --- /dev/null +++ b/test/blueprint/entity-server-blueprint.spec.js @@ -0,0 +1,74 @@ +const path = require('path'); +const fse = require('fs-extra'); +const assert = require('yeoman-assert'); +const helpers = require('yeoman-test'); +const expectedFiles = require('../utils/expected-files').entity; +const EntityServerGenerator = require('../../generators/entity-server'); +const constants = require('../../generators/generator-constants'); + +const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR; +const CLIENT_MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR; + +const mockBlueprintSubGen = class extends EntityServerGenerator { + constructor(args, opts) { + super(args, { fromBlueprint: true, ...opts }); // fromBlueprint variable is important + + if (!this.jhipsterContext) { + this.error('This is a JHipster blueprint and should be used only like jhipster --blueprint myblueprint'); + } + } + + get writing() { + return { + customPhase() { + this.name = 'JHipster'; + this.template(path.join(process.cwd(), 'HelloKotlin.kt.ejs'), `${SERVER_MAIN_SRC_DIR}${this.packageFolder}/HelloKotlin.kt`); + } + }; + } +}; + +describe('JHipster entity server generator with blueprint', () => { + const blueprintNames = ['generator-jhipster-myblueprint', 'myblueprint']; + + blueprintNames.forEach(blueprintName => { + describe(`generate server entity with blueprint option '${blueprintName}'`, () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/entity')) + .inTmpDir(dir => { + fse.copySync(path.join(__dirname, '../../test/templates/ngx-blueprint'), dir); + }) + .withArguments(['foo']) + .withOptions({ + 'from-cli': true, + skipInstall: true, + blueprint: blueprintName, + skipChecks: true + }) + .withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:entity-server']]) + .withPrompts({ + fieldAdd: false, + relationshipAdd: false, + dto: 'no', + service: 'no', + pagination: 'no' + }) + .on('end', done); + }); + + it('creates expected entity client files from jhipster entity generator', () => { + assert.file(expectedFiles.clientNg2); + assert.file(`${CLIENT_MAIN_SRC_DIR}i18n/en/foo.json`); + }); + + it('does not create default entity server files from jhipster entity generator', () => { + assert.noFile(expectedFiles.server.filter(f => f.endsWith('.java'))); + }); + + it('contains the specific change added by the blueprint', () => { + assert.fileContent(`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/HelloKotlin.kt`, /Hello JHipster/); + }); + }); + }); +}); diff --git a/test/needle-api/needle-client-react.spec.js b/test/needle-api/needle-client-react.spec.js index 7cb018a68544..b5ebc336a76d 100644 --- a/test/needle-api/needle-client-react.spec.js +++ b/test/needle-api/needle-client-react.spec.js @@ -101,7 +101,7 @@ describe('needle API React: JHipster client generator with blueprint', () => { const indexReducerPath = `${CLIENT_MAIN_SRC_DIR}app/shared/reducers/index.ts`; assert.fileContent(indexModulePath, "import entityName from './entityFolderName';"); - assert.fileContent(indexModulePath, ''); // eslint-disable-line + assert.fileContent(indexModulePath, ''); // eslint-disable-line assert.fileContent( indexReducerPath, diff --git a/test/needle-api/needle-server-liquibase.spec.js b/test/needle-api/needle-server-liquibase.spec.js index 9550acf9ac86..8c25dfc0cf5c 100644 --- a/test/needle-api/needle-server-liquibase.spec.js +++ b/test/needle-api/needle-server-liquibase.spec.js @@ -159,7 +159,7 @@ describe('needle API server liquibase: JHipster server generator with blueprint' `${SERVER_MAIN_RES_DIR}config/liquibase/changelog/dummy_changelog.xml`, ' \n' + ' \n' + - ' \n' + // eslint-disable-line + ' \n' + // eslint-disable-line ' \n' + ' \n' + ' \n' + diff --git a/test/templates/ngx-blueprint/.yo-rc.json b/test/templates/ngx-blueprint/.yo-rc.json index 37e1f060e5c9..5f8dbe720496 100644 --- a/test/templates/ngx-blueprint/.yo-rc.json +++ b/test/templates/ngx-blueprint/.yo-rc.json @@ -22,7 +22,7 @@ "enableSwaggerCodegen": false, "jwtSecretKey": "147e04cf224f52908a60d7a2902e19e0648d0a8c52503b4624f1708478dd29ba2885a9bb823c85873a76b27964a90e22f1e8", "clientFramework": "angularX", - "clientPackageManager": "npm" + "clientPackageManager": "npm" }, "generator-jhipster": { "promptValues": { diff --git a/test/templates/ngx-blueprint/HelloKotlin.kt.ejs b/test/templates/ngx-blueprint/HelloKotlin.kt.ejs new file mode 100644 index 000000000000..c3ba925a965d --- /dev/null +++ b/test/templates/ngx-blueprint/HelloKotlin.kt.ejs @@ -0,0 +1,17 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + This file is part of the JHipster project, see http://www.jhipster.tech/ + for more information. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%=packageName%>.test + +fun main() = println("Hello <%= name %>!!!") diff --git a/test/templates/ngx-blueprint/HelloVue.html.ejs b/test/templates/ngx-blueprint/HelloVue.html.ejs new file mode 100644 index 000000000000..a340c097d65a --- /dev/null +++ b/test/templates/ngx-blueprint/HelloVue.html.ejs @@ -0,0 +1,44 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + This file is part of the JHipster project, see http://www.jhipster.tech/ + for more information. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> + + + + + Hello World in Vue.js + + + + +
    +

    {{ msg }}

    +
    + + + + + + + diff --git a/test/templates/ngx-blueprint/custom-i18n.json.ejs b/test/templates/ngx-blueprint/custom-i18n.json.ejs new file mode 100644 index 000000000000..c624619b7156 --- /dev/null +++ b/test/templates/ngx-blueprint/custom-i18n.json.ejs @@ -0,0 +1,23 @@ +<%# + Copyright 2013-2019 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +{ + "<%= angularAppName %>": { + "name" : "<%= name %>" + } +} From 0ac150a18f44a6d35516cdc55888115459c0618e Mon Sep 17 00:00:00 2001 From: DanielFran Date: Wed, 19 Jun 2019 12:28:06 +0100 Subject: [PATCH 201/298] Remove unused imports --- .../src/main/java/package/config/DefaultProfileUtil.java.ejs | 1 - .../src/main/java/package/domain/PersistentAuditEvent.java.ejs | 1 - 2 files changed, 2 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/DefaultProfileUtil.java.ejs b/generators/server/templates/src/main/java/package/config/DefaultProfileUtil.java.ejs index 48b2a0328a56..0c57e45cca3e 100644 --- a/generators/server/templates/src/main/java/package/config/DefaultProfileUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/config/DefaultProfileUtil.java.ejs @@ -21,7 +21,6 @@ package <%=packageName%>.config; import io.github.jhipster.config.JHipsterConstants; import org.springframework.boot.SpringApplication; -import org.springframework.core.env.Environment; import java.util.*; diff --git a/generators/server/templates/src/main/java/package/domain/PersistentAuditEvent.java.ejs b/generators/server/templates/src/main/java/package/domain/PersistentAuditEvent.java.ejs index fea85b8106f4..72eff855ded7 100644 --- a/generators/server/templates/src/main/java/package/domain/PersistentAuditEvent.java.ejs +++ b/generators/server/templates/src/main/java/package/domain/PersistentAuditEvent.java.ejs @@ -35,7 +35,6 @@ import javax.validation.constraints.NotNull; import java.io.Serializable; import java.time.Instant; import java.util.HashMap; -import java.util.Objects; import java.util.Map; <%_ if (databaseType === 'couchbase') { _%> From 573aa1aa1125752a82ebef533cb747c370ca4732 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Wed, 19 Jun 2019 16:45:25 +0100 Subject: [PATCH 202/298] Fix Javadoc --- .../src/main/java/package/web/rest/AuditResource.java.ejs | 4 ++++ .../src/main/java/package/web/rest/UserResource.java.ejs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs index 0b7fb32999e4..58d3ec82ffe5 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs @@ -52,6 +52,8 @@ public class AuditResource { /** * {@code GET /audits} : get a page of {@link AuditEvent}s. * + * @param queryParams a {@link MultiValueMap} query parameters. + * @param uriBuilder a {@link UriComponentsBuilder} URI builder. * @param pageable the pagination information. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of {@link AuditEvent}s in body. */ @@ -67,6 +69,8 @@ public class AuditResource { * * @param fromDate the start of the time period of {@link AuditEvent} to get. * @param toDate the end of the time period of {@link AuditEvent} to get. + * @param queryParams a {@link MultiValueMap} query parameters. + * @param uriBuilder a {@link UriComponentsBuilder} URI builder. * @param pageable the pagination information. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of {@link AuditEvent} in body. */ diff --git a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs index 4b703f3f9c65..b7b1f3001acf 100644 --- a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs @@ -272,6 +272,8 @@ public class UserResource { /** * {@code GET /users} : get all users. *<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %> + * @param queryParams a {@link MultiValueMap} query parameters. + * @param uriBuilder a {@link UriComponentsBuilder} URI builder. * @param pageable the pagination information.<% } %> * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body all users. */ From 94ff34153d65cc0cad75e9ff9bdbf167e551c8e5 Mon Sep 17 00:00:00 2001 From: Hippolyte Durix Date: Wed, 19 Jun 2019 21:15:11 +0200 Subject: [PATCH 203/298] Change a wrong comment --- .../src/test/java/package/web/rest/EntityResourceIT.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs index 0671bbe96061..8e03827a3efb 100644 --- a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +++ b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs @@ -1067,7 +1067,7 @@ _%> .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isNoContent()); - // Validate the database is empty + // Validate the database contains one less item List<<%= asEntity(entityClass) %>> <%= entityInstance %>List = <%= entityInstance %>Repository.findAll(); assertThat(<%= entityInstance %>List).hasSize(databaseSizeBeforeDelete - 1); <%_ if (searchEngine === 'elasticsearch') { _%> From 4dc414eec53f79fd679aead630c97aceed95f4ec Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Thu, 20 Jun 2019 04:01:17 -0600 Subject: [PATCH 204/298] Adjust UserService to handle JWT Auth with Okta (#9947) --- .../java/package/service/UserService.java.ejs | 25 +++++++++++-------- .../package/service/UserServiceIT.java.ejs | 2 +- package-lock.json | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/generators/server/templates/src/main/java/package/service/UserService.java.ejs b/generators/server/templates/src/main/java/package/service/UserService.java.ejs index 103a981b4035..4ae1e264800d 100644 --- a/generators/server/templates/src/main/java/package/service/UserService.java.ejs +++ b/generators/server/templates/src/main/java/package/service/UserService.java.ejs @@ -813,10 +813,16 @@ public class UserService { private static <%= databaseType === 'no' ? asDto('User') : asEntity('User') %> getUser(Map details) { <%= databaseType === 'no' ? asDto('User') : asEntity('User') %> user = new <%= databaseType === 'no' ? asDto('User') : asEntity('User') %>(); - user.setId((String) details.get("sub")); + // handle resource server JWT, where sub claim is email and uid is ID + if (details.get("uid") != null) { + user.setId((String) details.get("uid")); + user.setLogin((String) details.get("sub")); + } else { + user.setId((String) details.get("sub")); + } if (details.get("preferred_username") != null) { user.setLogin(((String) details.get("preferred_username")).toLowerCase()); - } else { + } else if (user.getLogin() == null) { user.setLogin(user.getId()); } if (details.get("given_name") != null) { @@ -830,19 +836,18 @@ public class UserService { } if (details.get("email") != null) { user.setEmail(((String) details.get("email")).toLowerCase()); + } else { + user.setEmail((String) details.get("sub")); } if (details.get("langKey") != null) { user.setLangKey((String) details.get("langKey")); } else if (details.get("locale") != null) { - // For the locale issue, we suggest you adjust the format based on the OAuth server. - // Here we can't cater for all the use-cases, see: - // https://github.com/jhipster/generator-jhipster/issues/7866 - // for the en_US or en_** issue. - // Since JHipter only has one "en" language, we will handle it here, - // for other languages, please handle it accordingly. + // trim off country code if it exists String locale = (String) details.get("locale"); - if (locale.startsWith("en_") || locale.startsWith("en-")) { - locale = "en"; + if (locale.contains("_")) { + locale = locale.substring(0, locale.indexOf("_")); + } else if (locale.contains("-")) { + locale = locale.substring(0, locale.indexOf("-")); } user.setLangKey(locale.toLowerCase()); } else { diff --git a/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs b/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs index 5084d8d0908a..7162225b18d1 100644 --- a/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs @@ -496,7 +496,7 @@ public class UserServiceIT <% if (databaseType === 'cassandra') { %>extends Abst OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); <%= asDto('User') %> userDTO = userService.getUserFromAuthentication(authentication); - assertThat(userDTO.getLangKey()).isEqualTo("it-it"); + assertThat(userDTO.getLangKey()).isEqualTo("it"); } @Test diff --git a/package-lock.json b/package-lock.json index 9d859d53895a..6267fab535cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.0.1", + "version": "6.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { From 5f69210b3fc676c85b456e6f8cc0c9b884016b7c Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Thu, 20 Jun 2019 17:58:47 +0200 Subject: [PATCH 205/298] set inquirer npm dependency resolution to 6.3.1 fix #9952 --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 63bb17131416..fd25df8fae6f 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,9 @@ "yeoman-assert": "3.1.1", "yeoman-test": "1.9.1" }, + "resolutions": { + "inquirer": "6.3.1" + }, "engines": { "node": ">=8.10.0", "npm": ">=5.6.0" From cec266d1b40a92dd8aed0bd5c2ce037438e5577b Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Thu, 20 Jun 2019 18:37:37 +0200 Subject: [PATCH 206/298] Upgrade to JHipster Core 4.0.2 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6267fab535cb..8d09d7c45a06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2689,9 +2689,9 @@ } }, "jhipster-core": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-4.0.0.tgz", - "integrity": "sha512-lxcdMzqgbsdvHnEDnluiXShG5vooMts+jlmY/Op6s3BmkAeu5IhgTNCt1yZRA66O2RuFRv8kmJ8ySlWw2+bwfQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-4.0.2.tgz", + "integrity": "sha512-E7TEK/Jgql2f1G9SHDR2tTng4r4oo8uX1YtZ9C2VWWaYHB3YrEist2F9XTLEg0mO6jPyokLvcXKSH51WGzYTYw==", "requires": { "chevrotain": "4.4.0", "fs-extra": "8.0.1", diff --git a/package.json b/package.json index 63bb17131416..c58050ca532d 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "glob": "7.1.3", "gulp-filter": "5.1.0", "insight": "0.10.1", - "jhipster-core": "4.0.0", + "jhipster-core": "4.0.2", "js-object-pretty-print": "0.3.0", "js-yaml": "3.13.1", "lodash": "4.17.11", From 18b743b230b0f1598f43512a02578b5081030f89 Mon Sep 17 00:00:00 2001 From: Marlon Luan Date: Thu, 20 Jun 2019 18:24:19 -0300 Subject: [PATCH 207/298] Fix pt-BR --- .../entity-i18n/templates/i18n/entity_pt-br.json.ejs | 2 +- .../main/resources/i18n/messages_pt_BR.properties.ejs | 10 +++++----- .../templates/src/main/webapp/i18n/pt-br/audits.json | 2 +- .../src/main/webapp/i18n/pt-br/global.json.ejs | 6 +++--- .../test/resources/i18n/messages_pt_BR.properties.ejs | 5 ++++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs b/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs index 629dbac89bd1..1d9a14bf9565 100644 --- a/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pt-br.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Criar novo <%= entityClassHumanized %>", "createOrEditLabel": "Criar ou editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Pesquisar por <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "Nenhum <%= entityClassHumanized %> encontrado" },<% if (!microserviceAppName) { %> "created": "Um novo <%= entityClassHumanized %> foi criado com o identificador {{ param }}", "updated": "Um <%= entityClassHumanized %> foi atualizado com o identificador {{ param }}", diff --git a/generators/languages/templates/src/main/resources/i18n/messages_pt_BR.properties.ejs b/generators/languages/templates/src/main/resources/i18n/messages_pt_BR.properties.ejs index 075b031d3512..acfd915bda00 100644 --- a/generators/languages/templates/src/main/resources/i18n/messages_pt_BR.properties.ejs +++ b/generators/languages/templates/src/main/resources/i18n/messages_pt_BR.properties.ejs @@ -27,13 +27,13 @@ email.activation.title=<%= baseName %> ativação email.activation.greeting=Caro {0} email.activation.text1=Sua conta <%= baseName %> foi criada, por favor click na URL abaixo para ativar: email.activation.text2=Atenciosamente, -email.signature=<%= baseName %>. +email.signature=Equipe <%= baseName %>. # Creation email -email.creation.text1=Sua <%= baseName %> account foi criada, por favor clique no URL abaixo para acessá-lo: +email.creation.text1=Sua conta <%= baseName %> foi criada, por favor clique no URL abaixo para acessá-lo: # Reset email -email.reset.title=A Senha da aplicação <%= baseName %> foi reiniciada +email.reset.title=A Senha da aplicação <%= baseName %> foi redifinida email.reset.greeting=Caro {0} -email.reset.text1=Foi solicitado o reinicio de senha da sua conta <%= baseName %>. Por favor clique na url abaixo para alterá-la: -email.reset.text2=Prezado, +email.reset.text1=Foi solicitado a redefinição de senha da sua conta <%= baseName %>. Por favor clique na url abaixo para alterá-la: +email.reset.text2=Atenciosamente, diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json b/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json index 7dc2837ba24a..12cdbce3d878 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json +++ b/generators/languages/templates/src/main/webapp/i18n/pt-br/audits.json @@ -23,6 +23,6 @@ "remoteAddress": "Endereço remoto:" } }, - "notFound": "No audit found" + "notFound": "Nenhuma auditoria encontrada" } } diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs index 2cd3f8f3f188..1b6527f70326 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs @@ -59,8 +59,8 @@ "form": { "username.label": "Usuário", "username.placeholder": "Seu usuário", - "currentpassword.label": "Current password", - "currentpassword.placeholder": "Current password", + "currentpassword.label": "Senha atual", + "currentpassword.placeholder": "Senha atual", "newpassword.label": "Nova senha", "newpassword.placeholder": "Nova senha", "confirmpassword.label": "Confirmação de nova senha", @@ -107,7 +107,7 @@ "id": "Código" }, "ribbon": { - "dev": "Development" + "dev": "Desenvolvimento" }, "item-count": "Mostrando {{first}} - {{second}} de {{total}} resultados." }, diff --git a/generators/languages/templates/src/test/resources/i18n/messages_pt_BR.properties.ejs b/generators/languages/templates/src/test/resources/i18n/messages_pt_BR.properties.ejs index b6bb721ad1f1..7710cb8054ba 100644 --- a/generators/languages/templates/src/test/resources/i18n/messages_pt_BR.properties.ejs +++ b/generators/languages/templates/src/test/resources/i18n/messages_pt_BR.properties.ejs @@ -1 +1,4 @@ -email.test.title=ativação +email.test.title=Título de Teste +# Value used for English locale unit test in MailServiceIT +# as this file is loaded instead of real file +email.activation.title=<%= baseName %> ativação \ No newline at end of file From b877c3309e0cdffb8119ffab2246486109e09ebd Mon Sep 17 00:00:00 2001 From: Frederik Hahne Date: Fri, 21 Jun 2019 08:50:10 +0200 Subject: [PATCH 208/298] import mappings for zalando problem (#9925) * correct typo on swagger api file updates #9911 * update swagger plugin version and dependencies * define import mapping for zalando problem closes #9911 * update to open api generator 4.0.2 --- generators/server/templates/build.gradle.ejs | 9 ++++++--- .../server/templates/gradle/swagger.gradle.ejs | 1 + generators/server/templates/pom.xml.ejs | 14 ++++++++++++-- .../src/main/resources/swagger/api.yml.ejs | 4 ++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 9a3507dd3841..8b41a842ff1c 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -28,9 +28,6 @@ buildscript { dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}" classpath "io.spring.gradle:propdeps-plugin:0.0.10.RELEASE" - <%_ if (enableSwaggerCodegen) { _%> - classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4" - <%_ } _%> //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here } } @@ -42,6 +39,9 @@ plugins { id "jacoco" id "com.google.cloud.tools.jib" version "<%= JIB_VERSION %>" id "com.gorylenko.gradle-git-properties" version "2.0.0" + <%_ if (enableSwaggerCodegen) { _%> + id "org.openapi.generator" version "4.0.2" + <%_ } _%> <%_ if (!skipClient) { _%> id "com.github.node-gradle.node" version "1.3.0" <%_ } _%> @@ -319,6 +319,9 @@ dependencies { <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%> implementation "commons-codec:commons-codec" <%_ } _%> + <%_ if (enableSwaggerCodegen) { _%> + implementation "org.openapitools:jackson-databind-nullable:0.1.0" + <%_ } _%> implementation "org.apache.commons:commons-lang3" implementation "commons-io:commons-io" implementation "javax.transaction:javax.transaction-api" diff --git a/generators/server/templates/gradle/swagger.gradle.ejs b/generators/server/templates/gradle/swagger.gradle.ejs index e715d0978287..153898023424 100644 --- a/generators/server/templates/gradle/swagger.gradle.ejs +++ b/generators/server/templates/gradle/swagger.gradle.ejs @@ -33,6 +33,7 @@ openApiGenerate { supportingFilesConstrainedTo = ["ApiUtil.java"] configOptions = [delegatePattern: "true", title: "<%= dasherizedBaseName %>"] validateSpec = true + importMappings = [Problem:"org.zalando.problem.Problem"] } sourceSets { diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 9931552c2919..35a3b68b6e09 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -123,7 +123,9 @@ 0.0.1 <%_ } _%> 1.3.0.Final - +<%_ if (enableSwaggerCodegen) { _%> + 0.1.0 +<%_ } _%> 3.1.0 3.8.1 @@ -144,7 +146,7 @@ <%= JIB_VERSION %> 1.0.0 <%_ if (enableSwaggerCodegen) { _%> - 3.3.4 + 4.0.2 <%_ } _%> 1.0.0 3.6.0.1398 @@ -305,6 +307,13 @@ commons-io commons-io +<%_ if (enableSwaggerCodegen) { _%> + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable.version} + +<%_ } _%> org.apache.commons commons-lang3 @@ -1255,6 +1264,7 @@ <%= packageName %>.web.api <%= packageName %>.web.api.model ApiUtil.java + Problem=org.zalando.problem.Problem true <%_ if (reactive) { _%> diff --git a/generators/server/templates/src/main/resources/swagger/api.yml.ejs b/generators/server/templates/src/main/resources/swagger/api.yml.ejs index a34f03171be6..7b5245afd9cd 100644 --- a/generators/server/templates/src/main/resources/swagger/api.yml.ejs +++ b/generators/server/templates/src/main/resources/swagger/api.yml.ejs @@ -24,9 +24,9 @@ info: version: 0.0.1 servers: - url: http://localhost:<%= serverPort %> - description: Developpement server + description: Development server - url: https://localhost:<%= serverPort %> - description: Developpement server with TLS Profile + description: Development server with TLS Profile paths: {} <% if(authenticationType === 'jwt') { %> components: From 091d6a3493f0931b5d1538effb44f4c10bad8231 Mon Sep 17 00:00:00 2001 From: Kaido Hallik Date: Fri, 21 Jun 2019 10:32:35 +0300 Subject: [PATCH 209/298] user by email with authorities is now case insensitive close #9950 --- .../main/java/package/repository/UserRepository.java.ejs | 2 +- .../package/security/DomainUserDetailsService.java.ejs | 2 +- .../package/security/DomainUserDetailsServiceIT.java.ejs | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs b/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs index a4916d67f5f6..36514ac570b5 100644 --- a/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +++ b/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs @@ -172,7 +172,7 @@ public interface UserRepository extends <% if (databaseType === 'sql') { %>JpaRe <%_ if (cacheManagerIsAvailable === true) { _%> @Cacheable(cacheNames = USERS_BY_EMAIL_CACHE) <%_ } _%> - Optional<<%= asEntity('User') %>> findOneWithAuthoritiesByEmail(String email); + Optional<<%= asEntity('User') %>> findOneWithAuthoritiesByEmailIgnoreCase(String email); <%_ } _%> <% if (reactive) { %>Flux<% } else { %>Page<% } %><<%= asEntity('User') %>> findAllByLoginNot(Pageable pageable, String login); diff --git a/generators/server/templates/src/main/java/package/security/DomainUserDetailsService.java.ejs b/generators/server/templates/src/main/java/package/security/DomainUserDetailsService.java.ejs index 7c4ade74f246..8e0a7e9bcdb1 100644 --- a/generators/server/templates/src/main/java/package/security/DomainUserDetailsService.java.ejs +++ b/generators/server/templates/src/main/java/package/security/DomainUserDetailsService.java.ejs @@ -66,7 +66,7 @@ public class DomainUserDetailsService implements <% if (reactive) { %>Reactive<% log.debug("Authenticating {}", login); if (new EmailValidator().isValid(login, null)) { - return userRepository.<% if (databaseType === 'sql') { %>findOneWithAuthoritiesByEmail<% } else { %>findOneByEmailIgnoreCase<% } %>(login) + return userRepository.<% if (databaseType === 'sql') { %>findOneWithAuthoritiesByEmailIgnoreCase<% } else { %>findOneByEmailIgnoreCase<% } %>(login) <%_ if (reactive) { _%> .switchIfEmpty(Mono.error(new UsernameNotFoundException("User with email " + login + " was not found in the database"))) <%_ } _%> diff --git a/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs b/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs index f84e77a4d013..182826770b83 100644 --- a/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs @@ -169,9 +169,10 @@ public class DomainUserDetailsServiceIT <% if (databaseType === 'cassandra') { % <%_ if (databaseType === 'sql') { _%> @Test @Transactional - public void assertThatUserCanNotBeFoundByEmailIgnoreCase() { - assertThatExceptionOfType(UsernameNotFoundException.class).isThrownBy( - () -> domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH))); + public void assertThatUserCanBeFoundByEmailIgnoreCase() { + UserDetails userDetails = domainUserDetailsService.<% if (reactive) { %>find<% } else { %>loadUser<% } %>ByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH))<% if (reactive) { %>.block()<% } %>; + assertThat(userDetails).isNotNull(); + assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } <%_ } else { // MongoDB and Cassandra _%> @Test From 44ce8e0500343b20e0ad81ffc37efcc27d3c6445 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Fri, 21 Jun 2019 10:00:47 +0200 Subject: [PATCH 210/298] Upgrade to JHipster dependencies 3.0.3 --- generators/server/templates/gradle.properties.ejs | 2 +- generators/server/templates/pom.xml.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/gradle.properties.ejs b/generators/server/templates/gradle.properties.ejs index 9ed30a609c83..b0a33a325d22 100644 --- a/generators/server/templates/gradle.properties.ejs +++ b/generators/server/templates/gradle.properties.ejs @@ -25,7 +25,7 @@ npm_version=<%= NPM_VERSION %> yarn_version=<%= YARN_VERSION %> # Dependency versions -jhipster_dependencies_version=3.0.3-SNAPSHOT +jhipster_dependencies_version=3.0.3 # 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.1.6.RELEASE diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 35a3b68b6e09..acdceecd98fe 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -91,7 +91,7 @@ - 3.0.3-SNAPSHOT + 3.0.3 2.1.6.RELEASE From dcd51baf231751abc4d2e5f49d140cdfd47a25d3 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Fri, 21 Jun 2019 10:30:18 +0200 Subject: [PATCH 211/298] Release v6.1.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8d09d7c45a06..3490a848f847 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.0", + "version": "6.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ce13a2257a24..eeb7a96431be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.0", + "version": "6.1.1", "description": "Spring Boot + Angular/React in one handy generator", "files": [ "cli", From d094fecf2e7b79475876e76b64eaef7b89e915d1 Mon Sep 17 00:00:00 2001 From: Ivan Milosavljevic Date: Fri, 21 Jun 2019 10:42:36 +0200 Subject: [PATCH 212/298] replace hard-coded value of `test@localhost` with property value In the `MailServiceIT.java.ejs` the value of sender is hard-coded. This value is, by default, the same one as given in the `application.yml` file under the key `jhipster.mail.from`. In the case we change the `test@localhost` value in the `application.yml` file, the tests will fail. This change will make tests pass in this case without having to do anything further. --- .../java/package/service/MailServiceIT.java.ejs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs b/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs index 7e74ae56eecb..b8f1a3362a0e 100644 --- a/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs @@ -107,7 +107,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst MimeMessage message = messageCaptor.getValue(); assertThat(message.getSubject()).isEqualTo("testSubject"); assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent()).isInstanceOf(String.class); assertThat(message.getContent().toString()).isEqualTo("testContent"); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/plain; charset=UTF-8"); @@ -120,7 +120,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst MimeMessage message = messageCaptor.getValue(); assertThat(message.getSubject()).isEqualTo("testSubject"); assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent()).isInstanceOf(String.class); assertThat(message.getContent().toString()).isEqualTo("testContent"); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); @@ -137,7 +137,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst part.writeTo(aos); assertThat(message.getSubject()).isEqualTo("testSubject"); assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent()).isInstanceOf(Multipart.class); assertThat(aos.toString()).isEqualTo("\r\ntestContent"); assertThat(part.getDataHandler().getContentType()).isEqualTo("text/plain; charset=UTF-8"); @@ -154,7 +154,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst part.writeTo(aos); assertThat(message.getSubject()).isEqualTo("testSubject"); assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent()).isInstanceOf(Multipart.class); assertThat(aos.toString()).isEqualTo("\r\ntestContent"); assertThat(part.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); @@ -171,7 +171,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst MimeMessage message = messageCaptor.getValue(); assertThat(message.getSubject()).isEqualTo("test title"); assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent().toString()).isEqualToNormalizingNewlines("test title, http://127.0.0.1:8080, john\n"); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); } @@ -187,7 +187,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst verify(javaMailSender).send(messageCaptor.capture()); MimeMessage message = messageCaptor.getValue(); assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent().toString()).isNotEmpty(); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); } @@ -202,7 +202,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst verify(javaMailSender).send(messageCaptor.capture()); MimeMessage message = messageCaptor.getValue(); assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent().toString()).isNotEmpty(); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); } @@ -217,7 +217,7 @@ public class MailServiceIT <% if (databaseType === 'cassandra') { %>extends Abst verify(javaMailSender).send(messageCaptor.capture()); MimeMessage message = messageCaptor.getValue(); assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); - assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getFrom()[0].toString()).isEqualTo(jHipsterProperties.getMail().getFrom()); assertThat(message.getContent().toString()).isNotEmpty(); assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); } From 3ae9499ae9eee572caa84e0c15d71359a5f9f67f Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Fri, 21 Jun 2019 15:00:49 +0200 Subject: [PATCH 213/298] Hooks on activate component --- .../modules/account/activate/activate.tsx.ejs | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/account/activate/activate.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/account/activate/activate.tsx.ejs index f63e7f7688a5..938c6d99baa1 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/account/activate/activate.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/account/activate/activate.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { Link, RouteComponentProps } from 'react-router-dom'; import { Row, Col, Alert } from 'reactstrap'; @@ -44,36 +44,31 @@ const failureAlert = ( ); -export interface IActivateProps extends StateProps, DispatchProps, RouteComponentProps<{key: any}> {} - -export class ActivatePage extends React.Component { - componentWillUnmount() { - this.props.reset(); - } - - componentDidMount() { - const key = getUrlParameter('key', this.props.location.search); - this.props.activateAction(key); - } - - render() { - const { activationSuccess, activationFailure } = this.props; - - return ( -
    - - -

    - Activation -

    - {activationSuccess ? successAlert : undefined} - {activationFailure ? failureAlert : undefined} - -
    -
    - ); - } -} +export interface IActivateProps extends StateProps, DispatchProps, RouteComponentProps<{ key: any }> {} + +export const ActivatePage = (props: IActivateProps) => { + useEffect(() => { + const key = getUrlParameter('key', props.location.search); + props.activateAction(key); + return () => { + props.reset(); + }; + }, []); + + return ( +
    + + +

    + Activation +

    + {props.activationSuccess ? successAlert : undefined} + {props.activationFailure ? failureAlert : undefined} + +
    +
    + ); +}; const mapStateToProps = ({ activate }: IRootState) => ({ activationSuccess: activate.activationSuccess, From 910ef4642a0ff0283628baa36040e39617230db7 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Fri, 21 Jun 2019 15:03:07 +0200 Subject: [PATCH 214/298] Hooks on settings component --- .../modules/account/settings/settings.tsx.ejs | 186 +++++++++--------- 1 file changed, 89 insertions(+), 97 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/account/settings/settings.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/account/settings/settings.tsx.ejs index 7816e3e22e96..088a542c4f2f 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/account/settings/settings.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/account/settings/settings.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useEffect } from 'react'; import { Button, Col, Alert, Row } from 'reactstrap'; import { connect } from 'react-redux'; import { Translate, translate } from 'react-jhipster'; @@ -29,111 +29,103 @@ import { IRootState } from 'app/shared/reducers'; import { getSession } from 'app/shared/reducers/authentication'; import { saveAccountSettings, reset } from './settings.reducer'; -export interface IUserSettingsProps extends StateProps, DispatchProps {} - -export interface IUserSettingsState { - account: any; -} - -export class SettingsPage extends React.Component { - componentDidMount() { - this.props.getSession(); - } - - componentWillUnmount() { - this.props.reset(); - } +export interface IUserSettingsProps extends StateProps, DispatchProps {} +export const SettingsPage = (props: IUserSettingsProps) => { + useEffect(() => { + props.getSession(); + return () => { + props.reset(); + }; + }, []); - handleValidSubmit = (event, values) => { + const handleValidSubmit = (event, values) => { const account = { - ...this.props.account, + ...props.account, ...values }; - this.props.saveAccountSettings(account); + props.saveAccountSettings(account); event.persist(); }; - render() { - const { account } = this.props; - - return ( -
    - - -

    - User settings for {account.login} -

    - - {/* First name */} - - {/* Last name */} - - {/* Email */} - - <%_ if (enableTranslation) { _%> - {/* Language key */} - - {locales.map(locale => - - )} - - <%_ } _%> - - - -
    -
    - ); - } -} + return ( +
    + + +

    + + User settings for {props.account.login} + +

    + + {/* First name */} + + {/* Last name */} + + {/* Email */} + + <%_ if (enableTranslation) { _%> + {/* Language key */} + + {locales.map(locale => ( + + ))} + + <%_ } _%> + + + +
    +
    + ); +}; const mapStateToProps = ({ authentication }: IRootState) => ({ account: authentication.account, From 2a8940c27cc878fc547450156eeb3bb22a7812da Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Fri, 21 Jun 2019 15:04:10 +0200 Subject: [PATCH 215/298] Hooks on metrics component --- .../administration/metrics/metrics.tsx.ejs | 178 +++++++++--------- 1 file changed, 91 insertions(+), 87 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs index 5408a898edd7..a686dca77681 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Button, Col, Progress, Row, Table } from 'reactstrap'; import { @@ -38,101 +38,105 @@ import { IRootState } from 'app/shared/reducers'; export interface IMetricsPageProps extends StateProps, DispatchProps {} -export interface IMetricsPageState { - showModal: boolean; -} +export const MetricsPage = (props: IMetricsPageProps) => { + const [showModal, setShowModal] = useState(false); -export class MetricsPage extends React.Component { - state: IMetricsPageState = { - showModal: false - }; - - componentDidMount() { - this.props.systemMetrics(); - this.props.systemThreadDump(); - } + useEffect(() => { + props.systemMetrics(); + props.systemThreadDump(); + }, []); - getMetrics = () => { - if (!this.props.isFetching) { - this.props.systemMetrics(); - this.props.systemThreadDump(); + const getMetrics = () => { + if (!props.isFetching) { + props.systemMetrics(); + props.systemThreadDump(); } - } - - render() { - const {metrics, threadDump, isFetching} = this.props; - return ( -
    -

    Application Metrics

    -

    - -

    -
    + }; + const { metrics, threadDump, isFetching } = props; + + return ( +
    +

    Application Metrics

    +

    + +

    +
    + + + +

    JVM Metrics

    + + + {metrics && metrics.jvm ? : ''} + + {threadDump ? : ''} + + {metrics && metrics.processMetrics ? ( + + ) : ( + '' + )} + + + +
    + + {metrics && metrics.garbageCollector ? ( + + ) : ( + '' + )} + {metrics && metrics['http.server.requests'] ? ( + + ) : ( + '' + )} + {metrics && metrics.endpointsRequests ? ( + + ) : ( + '' + )} + + {metrics.cache ? ( -

    JVM Metrics

    - - - {metrics && metrics.jvm ? - : ''} - - - {threadDump ? - : ''} - - - {metrics && metrics.processMetrics ? - : ''} - - +
    + ) : ( + '' + )} - {metrics && metrics.garbageCollector ? - : ''} - {metrics && metrics['http.server.requests'] ? - : ''} - {metrics && metrics.endpointsRequests ? - : ''} - - {metrics.cache ? ( - - - - - - ) : ( - '' - )} - - {(metrics.databases && JSON.stringify(metrics.databases) !== '{}') ? ( - - - - - - ) : ( - '' - )} - -
    - ); - } -} + {metrics.databases && JSON.stringify(metrics.databases) !== '{}' ? ( + + + + + + ) : ( + '' + )} +
    + ); +}; const mapStateToProps = (storeState: IRootState) => ({ metrics: storeState.administration.metrics, From be77f9d8f24f6a71ade69a8391ae4b34600eeaf8 Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Fri, 21 Jun 2019 16:33:00 +0200 Subject: [PATCH 216/298] Hooks on login component --- .../webapp/app/modules/login/login.tsx.ejs | 58 +++++++------------ 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/modules/login/login.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/login/login.tsx.ejs index ffb3f3a142ea..7840cf48c627 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/login/login.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/login/login.tsx.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { Redirect, RouteComponentProps } from 'react-router-dom'; @@ -26,47 +26,31 @@ import LoginModal from './login-modal'; export interface ILoginProps extends StateProps, DispatchProps, RouteComponentProps<{}> {} -export interface ILoginState { - showModal: boolean; -} +export const Login = (props: ILoginProps) => { + const [showModal, setShowModal] = useState(props.showModal); -export class Login extends React.Component { + useEffect(() => { + setShowModal(props.showModal); + }); - state: ILoginState = { - showModal: this.props.showModal, - }; + const handleLogin = (username, password, rememberMe = false) => props.login(username, password, rememberMe); - componentDidUpdate(prevProps: ILoginProps, prevState) { - if (this.props !== prevProps) { - this.setState({ showModal: this.props.showModal }); - } - } - - handleLogin = (username, password, rememberMe = false) => { - this.props.login(username, password, rememberMe); - } - - handleClose = () => { - this.setState({ showModal: false }); - } + const handleClose = () => setShowModal(false); - render() { - const { location, isAuthenticated } = this.props; - const { from } = location.state || { from: { pathname: '/', search: location.search } }; - const { showModal } = this.state; - if (isAuthenticated) { - return ; - } - return ( - - ); + const { location, isAuthenticated } = props; + const { from } = location.state || { from: { pathname: '/', search: location.search } }; + if (isAuthenticated) { + return ; } -} + return ( + + ); +}; const mapStateToProps = ({ authentication }: IRootState) => ({ isAuthenticated: authentication.isAuthenticated, From d743d4f31760fc24128a05e75b5b675f4fdd54cf Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Fri, 21 Jun 2019 22:30:50 +0200 Subject: [PATCH 217/298] Hooks on app component --- .../react/src/main/webapp/app/app.tsx.ejs | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/generators/client/templates/react/src/main/webapp/app/app.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/app.tsx.ejs index 4bd13bda4cc7..9b8b1d2bc880 100644 --- a/generators/client/templates/react/src/main/webapp/app/app.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/app.tsx.ejs @@ -19,7 +19,7 @@ import 'react-toastify/dist/ReactToastify.css'; import './app.<%= styleSheetExt %>'; -import React from 'react'; +import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { Card } from 'reactstrap'; import { BrowserRouter as Router } from 'react-router-dom'; @@ -43,44 +43,42 @@ const baseHref = document.querySelector('base').getAttribute('href').replace(/\/ export interface IAppProps extends StateProps, DispatchProps {} -export class App extends React.Component { - componentDidMount() { - this.props.getSession(); - this.props.getProfile(); - } +export const App = (props: IAppProps) => { + useEffect(() => { + props.getSession(); + props.getProfile(); + }, []); - render() { - const paddingTop = '60px'; - return ( - -
    - - -
    - currentLocale={this.props.currentLocale} - onLocaleChange={this.props.setLocale} - <%_ } _%> - ribbonEnv={this.props.ribbonEnv} - isInProduction={this.props.isInProduction} - isSwaggerEnabled={this.props.isSwaggerEnabled} - /> - -
    - - - - - -
    -
    + const paddingTop = '60px'; + return ( + +
    + + +
    + currentLocale={props.currentLocale} + onLocaleChange={props.setLocale} + <%_ } _%> + ribbonEnv={props.ribbonEnv} + isInProduction={props.isInProduction} + isSwaggerEnabled={props.isSwaggerEnabled} + /> + +
    + + + + + +
    - - ); - } -} +
    +
    + ); +}; const mapStateToProps = ({ authentication, applicationProfile<% if (enableTranslation) { %>, locale<% } %> }: IRootState) => ({ <%_ if (enableTranslation) { _%> From f6670f390f721b3c87c615320f942a74ce92c298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Sat, 22 Jun 2019 23:36:28 +0200 Subject: [PATCH 218/298] fix #9973: add variable to know when to generate fake data text file --- generators/entity-server/files.js | 2 +- generators/entity/index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/generators/entity-server/files.js b/generators/entity-server/files.js index e75b960f9279..c2ac5da60ae4 100644 --- a/generators/entity-server/files.js +++ b/generators/entity-server/files.js @@ -83,7 +83,7 @@ const serverFiles = { templates: [{ file: 'config/liquibase/data/blob/hipster.png', method: 'copy', noEjs: true }] }, { - condition: generator => generator.databaseType === 'sql' && generator.fieldsContainBlobOrImage === true, + condition: generator => generator.databaseType === 'sql' && generator.fieldsContainTextBlob === true, path: SERVER_MAIN_RES_DIR, templates: [{ file: 'config/liquibase/data/blob/hipster.txt', method: 'copy' }] }, diff --git a/generators/entity/index.js b/generators/entity/index.js index 385747e2591e..940c5eaf9ea6 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -700,6 +700,7 @@ class EntityGenerator extends BaseBlueprintGenerator { context.fieldsContainBigDecimal = false; context.fieldsContainBlob = false; context.fieldsContainImageBlob = false; + context.fieldsContainTextBlob = false; context.fieldsContainBlobOrImage = false; context.validation = false; context.fieldsContainOwnerManyToMany = false; @@ -845,6 +846,8 @@ class EntityGenerator extends BaseBlueprintGenerator { } if (field.fieldTypeBlobContent !== 'text') { context.fieldsContainBlobOrImage = true; + } else { + context.fieldsContainTextBlob = true; } } From a36876aabba160ec3d6baae5b05fcd7c0c1499dc Mon Sep 17 00:00:00 2001 From: Zsombor Gegesy Date: Thu, 20 Jun 2019 00:21:13 +0200 Subject: [PATCH 219/298] Fix to use greaterThanOrEquals in the tests and increase the code coverage to check more field types and more filters --- .../web/rest/EntityResourceIT.java.ejs | 60 ++++++++++++++++--- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs index 8e03827a3efb..edb1412ac0e2 100644 --- a/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +++ b/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs @@ -176,6 +176,7 @@ _%> <%_ for (idx in fields) { const defaultValueName = 'DEFAULT_' + fields[idx].fieldNameUnderscored.toUpperCase(); const updatedValueName = 'UPDATED_' + fields[idx].fieldNameUnderscored.toUpperCase(); + const smallerValueName = 'SMALLER_' + fields[idx].fieldNameUnderscored.toUpperCase(); let defaultValue = 1; let updatedValue = 2; @@ -271,22 +272,27 @@ _%> private static final Integer <%=defaultValueName %> = <%= defaultValue %>; private static final Integer <%=updatedValueName %> = <%= updatedValue %>; + private static final Integer <%=smallerValueName %> = <%= defaultValue %> - 1; <%_ } else if (fieldType === 'Long') { _%> private static final Long <%=defaultValueName %> = <%= defaultValue %>L; private static final Long <%=updatedValueName %> = <%= updatedValue %>L; + private static final Long <%=smallerValueName %> = <%= defaultValue %>L - 1L; <%_ } else if (fieldType === 'Float') { _%> private static final <%=fieldType %> <%=defaultValueName %> = <%= defaultValue %>F; private static final <%=fieldType %> <%=updatedValueName %> = <%= updatedValue %>F; + private static final <%=fieldType %> <%=smallerValueName %> = <%= defaultValue %>F - 1F; <%_ } else if (fieldType === 'Double') { _%> private static final <%=fieldType %> <%=defaultValueName %> = <%= defaultValue %>D; private static final <%=fieldType %> <%=updatedValueName %> = <%= updatedValue %>D; + private static final <%=fieldType %> <%=smallerValueName %> = <%= defaultValue %>D - 1D; <%_ } else if (fieldType === 'BigDecimal') { _%> private static final BigDecimal <%=defaultValueName %> = new BigDecimal(<%= defaultValue %>); private static final BigDecimal <%=updatedValueName %> = new BigDecimal(<%= updatedValue %>); + private static final BigDecimal <%=smallerValueName %> = new BigDecimal(<%= defaultValue %> - 1); <%_ } else if (fieldType === 'UUID') { _%> private static final UUID <%=defaultValueName %> = UUID.randomUUID(); @@ -295,18 +301,22 @@ _%> private static final LocalDate <%=defaultValueName %> = LocalDate.ofEpochDay(0L); private static final LocalDate <%=updatedValueName %> = LocalDate.now(ZoneId.systemDefault()); + private static final LocalDate <%=smallerValueName %> = LocalDate.ofEpochDay(-1L); <%_ } else if (fieldType === 'Instant') { _%> private static final Instant <%=defaultValueName %> = Instant.ofEpochMilli(0L); private static final Instant <%=updatedValueName %> = Instant.now().truncatedTo(ChronoUnit.MILLIS); + private static final Instant <%=smallerValueName %> = Instant.ofEpochMilli(-1L); <%_ } else if (fieldType === 'ZonedDateTime') { _%> private static final ZonedDateTime <%=defaultValueName %> = ZonedDateTime.ofInstant(Instant.ofEpochMilli(0L), ZoneOffset.UTC); private static final ZonedDateTime <%=updatedValueName %> = ZonedDateTime.now(ZoneId.systemDefault()).withNano(0); + private static final ZonedDateTime <%=smallerValueName %> = ZonedDateTime.ofInstant(Instant.ofEpochMilli(-1L), ZoneOffset.UTC); <%_ } else if (fieldType === 'Duration') { _%> private static final Duration <%=defaultValueName %> = Duration.ofHours(6); private static final Duration <%=updatedValueName %> = Duration.ofHours(12); + private static final Duration <%=smallerValueName %> = Duration.ofHours(5); <%_ } else if (fieldType === 'Boolean') { _%> private static final Boolean <%=defaultValueName %> = false; @@ -797,12 +807,20 @@ _%> <%_ } // the range criteria - if (['Byte', 'Short', 'Integer', 'Long', 'LocalDate', 'ZonedDateTime'].includes(searchBy.fieldType)) { + if (['BigDecimal', 'Byte', 'Double', 'Duration', 'Float', 'Short', + 'Integer', 'Long', 'LocalDate', 'ZonedDateTime'].includes(searchBy.fieldType)) { var defaultValue = 'DEFAULT_' + searchBy.fieldNameUnderscored.toUpperCase(); var biggerValue = 'UPDATED_' + searchBy.fieldNameUnderscored.toUpperCase(); + var smallerValue = 'SMALLER_' + searchBy.fieldNameUnderscored.toUpperCase(); if (searchBy.fieldValidate === true && searchBy.fieldValidateRules.includes('max')) { // if maximum is specified the updated variable is smaller than the default one! - biggerValue = '(' + defaultValue + ' + 1)'; + if (searchBy.fieldType === 'BigDecimal') { + biggerValue = '(' + defaultValue + '.add(BigDecimal.ONE))'; + } else if (['Duration', 'LocalDate', 'ZonedDateTime'].includes(searchBy.fieldType)) { + biggerValue = '(' + defaultValue + '.plus(1, ChronoUnit.DAYS))'; + } else { + biggerValue = '(' + defaultValue + ' + 1)'; + } } _%> @@ -812,11 +830,24 @@ _%> // Initialize the database <%= entityInstance %>Repository.saveAndFlush(<%= asEntity(entityInstance) %>); - // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> greater than or equals to <%= defaultValue %> - default<%= entityClass %>ShouldBeFound("<%= searchBy.fieldName %>.greaterOrEqualThan=" + <%= defaultValue %>); + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is greater than or equal to <%= defaultValue %> + default<%= entityClass %>ShouldBeFound("<%= searchBy.fieldName %>.greaterThanOrEqual=" + <%= defaultValue %>); - // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> greater than or equals to <%= biggerValue %> - default<%= entityClass %>ShouldNotBeFound("<%= searchBy.fieldName %>.greaterOrEqualThan=" + <%= biggerValue %>); + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is greater than or equal to <%= biggerValue %> + default<%= entityClass %>ShouldNotBeFound("<%= searchBy.fieldName %>.greaterThanOrEqual=" + <%= biggerValue %>); + } + + @Test<% if (databaseType === 'sql') { %> + @Transactional<% } %> + public void getAll<%= entityClassPlural %>By<%= searchBy.fieldInJavaBeanMethod %>IsLessThanOrEqualToSomething() throws Exception { + // Initialize the database + <%= entityInstance %>Repository.saveAndFlush(<%= asEntity(entityInstance) %>); + + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is less than or equal to <%= defaultValue %> + default<%= entityClass %>ShouldBeFound("<%= searchBy.fieldName %>.lessThanOrEqual=" + <%= defaultValue %>); + + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is less than or equal to <%= smallerValue %> + default<%= entityClass %>ShouldNotBeFound("<%= searchBy.fieldName %>.lessThanOrEqual=" + <%= smallerValue %>); } @Test<% if (databaseType === 'sql') { %> @@ -825,13 +856,26 @@ _%> // Initialize the database <%= entityInstance %>Repository.saveAndFlush(<%= asEntity(entityInstance) %>); - // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> less than or equals to <%= defaultValue %> + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is less than <%= defaultValue %> default<%= entityClass %>ShouldNotBeFound("<%= searchBy.fieldName %>.lessThan=" + <%= defaultValue %>); - // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> less than or equals to <%= biggerValue %> + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is less than <%= biggerValue %> default<%= entityClass %>ShouldBeFound("<%= searchBy.fieldName %>.lessThan=" + <%= biggerValue %>); } + @Test<% if (databaseType === 'sql') { %> + @Transactional<% } %> + public void getAll<%= entityClassPlural %>By<%= searchBy.fieldInJavaBeanMethod %>IsGreaterThanSomething() throws Exception { + // Initialize the database + <%= entityInstance %>Repository.saveAndFlush(<%= asEntity(entityInstance) %>); + + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is greater than <%= defaultValue %> + default<%= entityClass %>ShouldNotBeFound("<%= searchBy.fieldName %>.greaterThan=" + <%= defaultValue %>); + + // Get all the <%= entityInstance %>List where <%= searchBy.fieldName %> is greater than <%= smallerValue %> + default<%= entityClass %>ShouldBeFound("<%= searchBy.fieldName %>.greaterThan=" + <%= smallerValue %>); + } + <%_ } _%> <%_ }); _%> <%_ relationships.forEach((relationship) => { _%> From 6e0df8d151183b027f91c795f13987613b7e4b91 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 23 Jun 2019 16:28:25 +0200 Subject: [PATCH 220/298] Feign access token refresh according to review --- .../package/config/SecurityConfiguration.java.ejs | 3 +-- .../java/package/security/SecurityUtils.java.ejs | 4 ++-- .../security/oauth2/AuthorizationHeaderUtil.java.ejs | 12 ++++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index ae892578d6a5..c818a3c89945 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -304,8 +304,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { authorities.forEach(authority -> { OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority; - mappedAuthorities.addAll(SecurityUtils.mapRolesToGrantedAuthorities( - SecurityUtils.getRolesFromClaims(oidcUserAuthority.getUserInfo().getClaims()))); + mappedAuthorities.addAll(extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); }); return mappedAuthorities; }; diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 7b48dfd72753..59ff5ebadeef 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -184,12 +184,12 @@ public final class SecurityUtils { } @SuppressWarnings("unchecked") - public static Collection getRolesFromClaims(Map claims) { + private static Collection getRolesFromClaims(Map claims) { return (Collection) claims.getOrDefault("groups", claims.getOrDefault("roles", new ArrayList<>())); } - public static List mapRolesToGrantedAuthorities(Collection roles) { + private static List mapRolesToGrantedAuthorities(Collection roles) { return roles.stream() .filter(role -> role.startsWith("ROLE_")) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index 2717ba041416..f6136ae7a3f5 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -43,7 +43,6 @@ import org.springframework.security.oauth2.core.*; import org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse; import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; -import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; @@ -58,13 +57,11 @@ public class AuthorizationHeaderUtil { private final OAuth2AuthorizedClientService clientService; private final RestTemplateBuilder restTemplateBuilder; - private final JwtDecoder jwtDecoder; private final Logger log = LoggerFactory.getLogger(AuthorizationHeaderUtil.class); - public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService, RestTemplateBuilder restTemplateBuilder, JwtDecoder jwtDecoder) { + public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService, RestTemplateBuilder restTemplateBuilder) { this.clientService = clientService; this.restTemplateBuilder = restTemplateBuilder; - this.jwtDecoder = jwtDecoder; } public Optional getAuthorizationHeader() { @@ -99,9 +96,8 @@ public class AuthorizationHeaderUtil { } else if (authentication instanceof JwtAuthenticationToken) { JwtAuthenticationToken accessToken = (JwtAuthenticationToken) authentication; - String tokenType = (String) accessToken.getToken().getClaims().get("typ"); String tokenValue = accessToken.getToken().getTokenValue(); - String authorizationHeaderValue = String.format("%s %s", tokenType, tokenValue); + String authorizationHeaderValue = String.format("%s %s", OAuth2AccessToken.TokenType.BEARER.getValue(), tokenValue); return Optional.of(authorizationHeaderValue); } return Optional.empty(); @@ -110,7 +106,7 @@ public class AuthorizationHeaderUtil { private String refreshToken(OAuth2AuthorizedClient client, OAuth2AuthenticationToken oauthToken) { OAuth2AccessTokenResponse atr = refreshTokenClient(client); if (atr == null || atr.getAccessToken() == null) { - log.info("Failed to refresh token for ${currentUser.name}"); + log.info("Failed to refresh token for user"); return null; } @@ -141,7 +137,7 @@ public class AuthorizationHeaderUtil { ResponseEntity responseEntity = r.exchange(requestEntity, OAuthIdpTokenResponseDTO.class); return toOAuth2AccessTokenResponse(responseEntity.getBody()); } catch (OAuth2AuthorizationException e) { - log.error("Unable to refresh token ${e.error.errorCode}"); + log.error("Unable to refresh token ${e.getError().getErrorCode()}"); throw new OAuth2AuthenticationException(e.getError(), e); } } From 5c300100bd6550f0dfff0432cb84b67b30e66587 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 23 Jun 2019 17:09:06 +0200 Subject: [PATCH 221/298] Use of SecurityUtils function to map token --- .../src/main/java/package/config/SecurityConfiguration.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index c818a3c89945..84d6729bf6f2 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -304,7 +304,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { authorities.forEach(authority -> { OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority; - mappedAuthorities.addAll(extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); + mappedAuthorities.addAll(SecurityUtils.extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); }); return mappedAuthorities; }; From 3a7b9a9650104a7d1165be97fe38ef09a68faeac Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sun, 23 Jun 2019 17:40:14 +0200 Subject: [PATCH 222/298] Release v6.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eeb7a96431be..56e2427b06c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.1", + "version": "6.1.2", "description": "Spring Boot + Angular/React in one handy generator", "files": [ "cli", From 0223af99d29d270387d11eeac947442b28956a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 23 Jun 2019 21:43:03 +0200 Subject: [PATCH 223/298] Removed outdated user data templates: they're in data subfolder now --- .../main/resources/config/liquibase/authorities.csv.ejs | 3 --- .../config/liquibase/oauth_client_details.csv.ejs | 2 -- .../src/main/resources/config/liquibase/users.csv.ejs | 7 ------- .../resources/config/liquibase/users_authorities.csv.ejs | 8 -------- 4 files changed, 20 deletions(-) delete mode 100644 generators/server/templates/src/main/resources/config/liquibase/authorities.csv.ejs delete mode 100644 generators/server/templates/src/main/resources/config/liquibase/oauth_client_details.csv.ejs delete mode 100644 generators/server/templates/src/main/resources/config/liquibase/users.csv.ejs delete mode 100644 generators/server/templates/src/main/resources/config/liquibase/users_authorities.csv.ejs diff --git a/generators/server/templates/src/main/resources/config/liquibase/authorities.csv.ejs b/generators/server/templates/src/main/resources/config/liquibase/authorities.csv.ejs deleted file mode 100644 index af5c6dfa186d..000000000000 --- a/generators/server/templates/src/main/resources/config/liquibase/authorities.csv.ejs +++ /dev/null @@ -1,3 +0,0 @@ -name -ROLE_ADMIN -ROLE_USER diff --git a/generators/server/templates/src/main/resources/config/liquibase/oauth_client_details.csv.ejs b/generators/server/templates/src/main/resources/config/liquibase/oauth_client_details.csv.ejs deleted file mode 100644 index ad3d52d67be9..000000000000 --- a/generators/server/templates/src/main/resources/config/liquibase/oauth_client_details.csv.ejs +++ /dev/null @@ -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 -<%= baseName %>app;res_<%= baseName %>;bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl;read,write;password,refresh_token,authorization_code,implicit;;ROLE_ADMIN,ROLE_USER;1800;2000;{};true diff --git a/generators/server/templates/src/main/resources/config/liquibase/users.csv.ejs b/generators/server/templates/src/main/resources/config/liquibase/users.csv.ejs deleted file mode 100644 index 590a55c9cf7d..000000000000 --- a/generators/server/templates/src/main/resources/config/liquibase/users.csv.ejs +++ /dev/null @@ -1,7 +0,0 @@ -id;login;<% if (authenticationType !== 'oauth2') { %>password_hash;<% } %>first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by -1;system;<% if (authenticationType !== 'oauth2') { %>$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG;<% } %>System;System;system@localhost;;true;<%= nativeLanguage %>;system;system -2;anonymoususer;<% if (authenticationType !== 'oauth2') { %>$2a$10$j8S5d7Sr7.8VTOYNviDPOeWX8KcYILUVJBsYV83Y5NtECayypx9lO;<% } %>Anonymous;User;anonymous@localhost;;true;<%= nativeLanguage %>;system;system -<%_ if (authenticationType !== 'oauth2') { _%> -3;admin;$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC;Administrator;Administrator;admin@localhost;;true;<%= nativeLanguage %>;system;system -4;user;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;User;User;user@localhost;;true;<%= nativeLanguage %>;system;system -<%_ } _%> diff --git a/generators/server/templates/src/main/resources/config/liquibase/users_authorities.csv.ejs b/generators/server/templates/src/main/resources/config/liquibase/users_authorities.csv.ejs deleted file mode 100644 index 7d17146cc5d0..000000000000 --- a/generators/server/templates/src/main/resources/config/liquibase/users_authorities.csv.ejs +++ /dev/null @@ -1,8 +0,0 @@ -user_id;authority_name -1;ROLE_ADMIN -1;ROLE_USER -<%_ if (authenticationType !== 'oauth2') { _%> -3;ROLE_ADMIN -3;ROLE_USER -4;ROLE_USER -<%_ } _%> From e2eb04304eda4e298494c9a3c31b2628c6724715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sun, 23 Jun 2019 21:44:23 +0200 Subject: [PATCH 224/298] Move fake data from 'data' folder to more explicit 'fake-data' folder --- generators/entity-server/files.js | 8 ++++---- .../config/liquibase/changelog/added_entity.xml.ejs | 2 +- .../liquibase/{data => fake-data}/blob/hipster.png | Bin .../{data => fake-data}/blob/hipster.txt.ejs | 0 .../liquibase/{data => fake-data}/table.csv.ejs | 4 ++-- .../liquibase/changelog/dummy_changelog.xml.ejs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) rename generators/entity-server/templates/src/main/resources/config/liquibase/{data => fake-data}/blob/hipster.png (100%) rename generators/entity-server/templates/src/main/resources/config/liquibase/{data => fake-data}/blob/hipster.txt.ejs (100%) rename generators/entity-server/templates/src/main/resources/config/liquibase/{data => fake-data}/table.csv.ejs (98%) diff --git a/generators/entity-server/files.js b/generators/entity-server/files.js index c2ac5da60ae4..1c3445b03400 100644 --- a/generators/entity-server/files.js +++ b/generators/entity-server/files.js @@ -50,7 +50,7 @@ const serverFiles = { renameTo: generator => `config/liquibase/changelog/${generator.changelogDate}_added_entity_${generator.entityClass}.xml` }, { - file: 'config/liquibase/data/table.csv', + file: 'config/liquibase/fake-data/table.csv', options: { interpolate: INTERPOLATE_REGEX, context: { @@ -58,7 +58,7 @@ const serverFiles = { randexp } }, - renameTo: generator => `config/liquibase/data/${generator.entityTableName}.csv` + renameTo: generator => `config/liquibase/fake-data/${generator.entityTableName}.csv` } ] }, @@ -80,12 +80,12 @@ const serverFiles = { condition: generator => generator.databaseType === 'sql' && (generator.fieldsContainImageBlob === true || generator.fieldsContainBlob === true), path: SERVER_MAIN_RES_DIR, - templates: [{ file: 'config/liquibase/data/blob/hipster.png', method: 'copy', noEjs: true }] + templates: [{ file: 'config/liquibase/fake-data/blob/hipster.png', method: 'copy', noEjs: true }] }, { condition: generator => generator.databaseType === 'sql' && generator.fieldsContainTextBlob === true, path: SERVER_MAIN_RES_DIR, - templates: [{ file: 'config/liquibase/data/blob/hipster.txt', method: 'copy' }] + templates: [{ file: 'config/liquibase/fake-data/blob/hipster.txt', method: 'copy' }] }, { condition: generator => generator.databaseType === 'cassandra', diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs index 34fd74f71eba..71018f28ed5c 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/changelog/added_entity.xml.ejs @@ -186,7 +186,7 @@ --> diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/blob/hipster.png b/generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/blob/hipster.png similarity index 100% rename from generators/entity-server/templates/src/main/resources/config/liquibase/data/blob/hipster.png rename to generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/blob/hipster.png diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/blob/hipster.txt.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/blob/hipster.txt.ejs similarity index 100% rename from generators/entity-server/templates/src/main/resources/config/liquibase/data/blob/hipster.txt.ejs rename to generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/blob/hipster.txt.ejs diff --git a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs b/generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/table.csv.ejs similarity index 98% rename from generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs rename to generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/table.csv.ejs index d5866c3d9914..27a9a7a6acd7 100644 --- a/generators/entity-server/templates/src/main/resources/config/liquibase/data/table.csv.ejs +++ b/generators/entity-server/templates/src/main/resources/config/liquibase/fake-data/table.csv.ejs @@ -145,9 +145,9 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) { } } if (columnType === 'blob' || columnType === 'longblob') { - data = '../data/blob/hipster.png' + data = '../fake-data/blob/hipster.png' } else if (columnType === '${clobType}'){ - data = '../data/blob/hipster.txt' + data = '../fake-data/blob/hipster.txt' } // Validation rules diff --git a/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs b/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs index 2ba316655e8e..b7ee406100d0 100644 --- a/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs +++ b/test/needle-api/templates/src/main/resources/config/liquibase/changelog/dummy_changelog.xml.ejs @@ -52,7 +52,7 @@ From b1ea9306e22f4f60ee05cc8bd4c44da93a5aab6c Mon Sep 17 00:00:00 2001 From: Florian Rampp Date: Tue, 25 Jun 2019 10:46:46 +0200 Subject: [PATCH 225/298] use correct Spring profiles when building app with different Gradle profile (#9984) Before, when first compiling the project with Gradle `dev` profile and then, without cleaning the project, with Gradle `prod` profile, the list of active Spring profiles was not updated. Now it is. --- generators/server/templates/gradle/profile_dev.gradle.ejs | 2 ++ generators/server/templates/gradle/profile_prod.gradle.ejs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/generators/server/templates/gradle/profile_dev.gradle.ejs b/generators/server/templates/gradle/profile_dev.gradle.ejs index 4dbe8e13895c..a5261822e55a 100644 --- a/generators/server/templates/gradle/profile_dev.gradle.ejs +++ b/generators/server/templates/gradle/profile_dev.gradle.ejs @@ -75,6 +75,8 @@ task webpackBuildDev(type: <%= _.upperFirst(clientPackageManager) %>Task) { <%_ } _%> processResources { + inputs.property('version', version) + inputs.property('springProfiles', profiles) filesMatching("**/application.yml") { filter { it.replace("#project.version#", version) diff --git a/generators/server/templates/gradle/profile_prod.gradle.ejs b/generators/server/templates/gradle/profile_prod.gradle.ejs index 1a92b9280f65..70651f2d097c 100644 --- a/generators/server/templates/gradle/profile_prod.gradle.ejs +++ b/generators/server/templates/gradle/profile_prod.gradle.ejs @@ -53,6 +53,8 @@ task webpack(type: <%= _.upperFirst(clientPackageManager) %>Task, dependsOn: "<% <%_ } _%> processResources { + inputs.property('version', version) + inputs.property('springProfiles', profiles) filesMatching("**/application.yml") { filter { it.replace("#project.version#", version) From 81a01c51ac08d2663cab8aa247131db8edde693b Mon Sep 17 00:00:00 2001 From: Florian Rampp Date: Tue, 25 Jun 2019 10:47:33 +0200 Subject: [PATCH 226/298] allow using Gradle project version in jib configuration (#9985) We decided to not use `latest` as the tag for the Docker image built by jib, but the Gradle project version. While I think changing the default Docker image tag is not a good change for JHipster in general, moving the project version up allows it to be referenced by Jib. Not knowing too much about Gradle project configuration before, we stumbled over this and I want to save others this learning. --- generators/server/templates/build.gradle.ejs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs index 8b41a842ff1c..6b5351f665af 100644 --- a/generators/server/templates/build.gradle.ejs +++ b/generators/server/templates/build.gradle.ejs @@ -55,6 +55,11 @@ plugins { //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here } +group = "<%= packageName %>" +version = "0.0.1-SNAPSHOT" + +description = "" + sourceCompatibility=<%= JAVA_VERSION %> targetCompatibility=<%= JAVA_VERSION %> assert System.properties["java.specification.version"] == "1.8" || "11" || "12" @@ -123,11 +128,6 @@ if (OperatingSystem.current().isWindows()) { defaultTasks "bootRun" -group = "<%= packageName %>" -version = "0.0.1-SNAPSHOT" - -description = "" - springBoot { mainClassName = "<%= packageName %>.<%= mainClass %>" } From 6a89e7865b20bf07bdf0d3f214e9b9f78382aba7 Mon Sep 17 00:00:00 2001 From: Florian Rampp Date: Tue, 25 Jun 2019 10:30:07 +0200 Subject: [PATCH 227/298] pass app version to NPM as env var instead of parsing it from build file Currently, the webpack `DefinePlugin` sets the `VERSION` by parsing it from either `build.gradle` (in case of a Gradle build) or from `pom.xml` (in case of a Maven build). The problem with this is that if the version is not statically set, but rather dynamically calcualted (e.g. using https://github.com/palantir/gradle-git-version to determine it from the Git repo), the parsing breaks. Thus, this PR changes this by passing the version to show in the frontend from the server build tool (Gradle/Maven) as an environment variable to the NPM webpack task. This is more robust and does not rely on parsing the Gradle/Maven file. In the Maven case, it also removes the dependency on xml2js. The downside is that if only `npm start` is run, instead of the version, `UNKNOWN` is shown. I think the advantages (allowing dynamic version in Gradle, removing parsing code) outweigh this downside. I tested this by 1. generating Maven and Gradle projects 2. generating Angular and React clients 3. running it using `dev` vs. `prod` profiles 4. running the server build tool vs. `npm start` (but not all combinations of the above :-). --- .../client/templates/angular/package.json.ejs | 4 +- .../templates/angular/webpack/utils.js.ejs | 37 ------------------- .../angular/webpack/webpack.common.js.ejs | 8 +++- .../client/templates/react/package.json.ejs | 3 +- .../templates/react/webpack/utils.js.ejs | 34 ----------------- .../react/webpack/webpack.common.js.ejs | 8 +++- .../templates/gradle/profile_dev.gradle.ejs | 1 + .../templates/gradle/profile_prod.gradle.ejs | 1 + generators/server/templates/pom.xml.ejs | 6 +++ 9 files changed, 24 insertions(+), 78 deletions(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 70925c3a4fed..7227e8e18377 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -150,9 +150,7 @@ "webpack-notifier": "1.7.0", "webpack-visualizer-plugin": "0.1.11", "workbox-webpack-plugin": "4.3.1", - "write-file-webpack-plugin": "4.5.0"<% if (buildTool === 'maven') { %>, - "xml2js": "0.4.19" - <%_ } _%> + "write-file-webpack-plugin": "4.5.0" }, "engines": { "node": ">=8.9.0"<% if (clientPackageManager === 'yarn') { %>, diff --git a/generators/client/templates/angular/webpack/utils.js.ejs b/generators/client/templates/angular/webpack/utils.js.ejs index 5087450fb5d0..501ecd5d2230 100644 --- a/generators/client/templates/angular/webpack/utils.js.ejs +++ b/generators/client/templates/angular/webpack/utils.js.ejs @@ -16,50 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. -%> -const fs = require('fs'); const path = require('path'); module.exports = { - parseVersion, root, isExternalLib }; -<%_ if (buildTool === 'maven') { _%> -const parseString = require('xml2js').parseString; -// return the version number from `pom.xml` file -function parseVersion() { - let version = null; - const pomXml = fs.readFileSync('pom.xml', 'utf8'); - parseString(pomXml, (err, result) => { - if (err) { - throw new Error('Failed to parse pom.xml: ' + err); - } - if (result.project.version && result.project.version[0]) { - version = result.project.version[0]; - } else if (result.project.parent && result.project.parent[0] && result.project.parent[0].version && result.project.parent[0].version[0]) { - version = result.project.parent[0].version[0]; - } - }); - if (version === null) { - throw new Error('pom.xml is malformed. No version is defined'); - } - return version; -} -<%_ } else if (buildTool === 'gradle') { _%> -// Returns the second occurrence of the version number from `build.gradle` file -function parseVersion() { - const versionRegex = /^version\s*=\s*[',"]([^',"]*)[',"]/gm; // Match and group the version number - const buildGradle = fs.readFileSync('build.gradle', 'utf8'); - return versionRegex.exec(buildGradle)[1]; -} -<%_ } else { _%> -// Returns a static version number when server is skipped -function parseVersion() { - return '0.0.1-SNAPSHOT'; -}; -<%_ } _%> - const _root = path.resolve(__dirname, '..'); function root(args) { diff --git a/generators/client/templates/angular/webpack/webpack.common.js.ejs b/generators/client/templates/angular/webpack/webpack.common.js.ejs index f8e3e04f6b79..fea3ed85936b 100644 --- a/generators/client/templates/angular/webpack/webpack.common.js.ejs +++ b/generators/client/templates/angular/webpack/webpack.common.js.ejs @@ -78,7 +78,13 @@ module.exports = (options) => ({ 'process.env': { NODE_ENV: `'${options.env}'`, BUILD_TIMESTAMP: `'${new Date().getTime()}'`, - VERSION: `'${utils.parseVersion()}'`, +<%_ if (buildTool === 'gradle' || buildTool === 'maven') { _%> + // If webpack is run through Gradle 'webpack'/'webpackBuildDev' NpmTasks / Maven 'frontend-maven-plugin', then APP_VERSION is set. + VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, +<%_ } else { _%> + // Server generation is skipped, so there is no way to determine the application version from server. + VERSION: `'0.0.1-SNAPSHOT'`, +<%_ } _%> DEBUG_INFO_ENABLED: options.env === 'development', // The root URL for API calls, ending with a '/' - for example: `"https://www.jhipster.tech:8081/myservice/"`. // If this URL is left empty (""), then it will be relative to the current context. diff --git a/generators/client/templates/react/package.json.ejs b/generators/client/templates/react/package.json.ejs index 8bea0ed600a8..21f52a46c8f2 100644 --- a/generators/client/templates/react/package.json.ejs +++ b/generators/client/templates/react/package.json.ejs @@ -172,8 +172,7 @@ limitations under the License. "webpack-merge": "4.2.1", "webpack-notifier": "1.7.0", "workbox-webpack-plugin": "4.1.1", - "write-file-webpack-plugin": "4.5.0"<% if (buildTool === 'maven') { %>, - "xml2js": "0.4.19"<% } %> + "write-file-webpack-plugin": "4.5.0" }, <%_ if (clientPackageManager === 'yarn') { _%> "resolutions": { diff --git a/generators/client/templates/react/webpack/utils.js.ejs b/generators/client/templates/react/webpack/utils.js.ejs index 17719989f82f..fd626976869c 100644 --- a/generators/client/templates/react/webpack/utils.js.ejs +++ b/generators/client/templates/react/webpack/utils.js.ejs @@ -16,47 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. -%> -const fs = require('fs'); const path = require('path'); module.exports = { - parseVersion, root, isExternalLib }; -<%_ if (buildTool === 'maven') { _%> -const parseString = require('xml2js').parseString; -// return the version number from `pom.xml` file -function parseVersion() { - let version = null; - const pomXml = fs.readFileSync('pom.xml', 'utf8'); - parseString(pomXml, (err, result) => { - if (result.project.version && result.project.version[0]) { - version = result.project.version[0]; - } else if (result.project.parent && result.project.parent[0] && result.project.parent[0].version && result.project.parent[0].version[0]) { - version = result.project.parent[0].version[0]; - } - }); - if (version === null) { - throw new Error('pom.xml is malformed. No version is defined'); - } - return version; -} -<%_ } else if (buildTool === 'gradle') { _%> -// Returns the second occurrence of the version number from `build.gradle` file -function parseVersion() { - const versionRegex = /^version\s*=\s*[',"]([^',"]*)[',"]/gm; // Match and group the version number - const buildGradle = fs.readFileSync('build.gradle', 'utf8'); - return versionRegex.exec(buildGradle)[1]; -} -<%_ } else { _%> -// Returns a static version number when server is skipped -function parseVersion() { - return '0.0.1-SNAPSHOT'; -} -<%_ } _%> - const _root = path.resolve(__dirname, '..'); function root(args) { diff --git a/generators/client/templates/react/webpack/webpack.common.js.ejs b/generators/client/templates/react/webpack/webpack.common.js.ejs index a3cd68a19232..5d639a54a78a 100644 --- a/generators/client/templates/react/webpack/webpack.common.js.ejs +++ b/generators/client/templates/react/webpack/webpack.common.js.ejs @@ -123,7 +123,13 @@ module.exports = options => ({ <%_ if (enableTranslation) { _%> BUILD_TIMESTAMP: `'${new Date().getTime()}'`, <%_ } _%> - VERSION: `'${utils.parseVersion()}'`, +<%_ if (buildTool === 'gradle' || buildTool === 'maven') { _%> + // If webpack is run through Gradle 'webpack'/'webpackBuildDev' NpmTasks / Maven 'frontend-maven-plugin', then APP_VERSION is set. + VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, +<%_ } else { _%> + // Server generation is skipped, so there is no way to determine the application version from server. + VERSION: `'0.0.1-SNAPSHOT'`, +<%_ } _%> DEBUG_INFO_ENABLED: options.env === 'development', // The root URL for API calls, ending with a '/' - for example: `"https://www.jhipster.tech:8081/myservice/"`. // If this URL is left empty (""), then it will be relative to the current context. diff --git a/generators/server/templates/gradle/profile_dev.gradle.ejs b/generators/server/templates/gradle/profile_dev.gradle.ejs index a5261822e55a..504d471e3ed5 100644 --- a/generators/server/templates/gradle/profile_dev.gradle.ejs +++ b/generators/server/templates/gradle/profile_dev.gradle.ejs @@ -71,6 +71,7 @@ task webpackBuildDev(type: <%= _.upperFirst(clientPackageManager) %>Task) { dependsOn <%= clientPackageManager %><%_ if (clientPackageManager === 'npm') { _%>Install<%_ } _%> args = ["run", "webpack:build"] + environment = [APP_VERSION: project.version] } <%_ } _%> diff --git a/generators/server/templates/gradle/profile_prod.gradle.ejs b/generators/server/templates/gradle/profile_prod.gradle.ejs index 70651f2d097c..13f9bd75b95a 100644 --- a/generators/server/templates/gradle/profile_prod.gradle.ejs +++ b/generators/server/templates/gradle/profile_prod.gradle.ejs @@ -49,6 +49,7 @@ task webpack_test(type: <%= _.upperFirst(clientPackageManager) %>Task, dependsOn task webpack(type: <%= _.upperFirst(clientPackageManager) %>Task, dependsOn: "<%= clientPackageManager %><%_ if (clientPackageManager === 'npm') { _%>Install<%_ } _%>") { args = ["run", "webpack:prod"] + environment = [APP_VERSION: project.version] } <%_ } _%> diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index acdceecd98fe..65da996ec4a9 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -1393,6 +1393,9 @@ generate-resources run webpack:build + + ${project.version} + <%_ if (clientPackageManager === 'yarn') { _%> false <%_ } else if (clientPackageManager === 'npm') { _%> @@ -1545,6 +1548,9 @@ generate-resources run webpack:prod + + ${project.version} + <%_ if (clientPackageManager === 'yarn') { _%> false <%_ } else if (clientPackageManager === 'npm') { _%> From bf58f417856eaee37351978c9321dd28b84f7bb1 Mon Sep 17 00:00:00 2001 From: Jay Pitroda Date: Wed, 26 Jun 2019 21:12:43 +0530 Subject: [PATCH 228/298] change default remember me option to "false" in login modal and updated unit test --- .../src/main/webapp/app/shared/login/login.component.html.ejs | 2 +- .../src/main/webapp/app/shared/login/login.component.ts.ejs | 2 +- .../spec/app/shared/login/login.component.spec.ts.ejs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.html.ejs index 7a4329640418..8910b1da705d 100644 --- a/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.html.ejs @@ -42,7 +42,7 @@
    hidden<% } %>>
    diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.ts.ejs index fcf763759637..eecba8e6836b 100644 --- a/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/shared/login/login.component.ts.ejs @@ -35,7 +35,7 @@ export class <%=jhiPrefixCapitalized%>LoginModalComponent implements AfterViewIn loginForm = this.fb.group({ username: [''], password: [''], - rememberMe: [true] + rememberMe: [false] }); constructor( diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/login.component.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/login.component.spec.ts.ejs index b5530cab2065..bec1f80ca4b3 100644 --- a/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/login.component.spec.ts.ejs +++ b/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/login.component.spec.ts.ejs @@ -149,7 +149,7 @@ describe('Component Tests', () => { const expected = { username: '', password: '', - rememberMe: true + rememberMe: false }; From c73d318773d590619233a715aa760063d9681fa2 Mon Sep 17 00:00:00 2001 From: Vishal Mahajan Date: Wed, 26 Jun 2019 21:22:32 +0530 Subject: [PATCH 229/298] Use client side package version if build tool is undefined --- .../client/templates/angular/webpack/utils.js.ejs | 11 +---------- .../angular/webpack/webpack.common.js.ejs | 13 +++++++------ .../client/templates/react/webpack/utils.js.ejs | 11 +---------- .../templates/react/webpack/webpack.common.js.ejs | 15 ++++++++------- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/generators/client/templates/angular/webpack/utils.js.ejs b/generators/client/templates/angular/webpack/utils.js.ejs index 501ecd5d2230..f30d5c555498 100644 --- a/generators/client/templates/angular/webpack/utils.js.ejs +++ b/generators/client/templates/angular/webpack/utils.js.ejs @@ -19,8 +19,7 @@ const path = require('path'); module.exports = { - root, - isExternalLib + root }; const _root = path.resolve(__dirname, '..'); @@ -29,11 +28,3 @@ function root(args) { args = Array.prototype.slice.call(arguments, 0); return path.join.apply(path, [_root].concat(args)); } - -function isExternalLib(module, check = /node_modules/) { - const req = module.userRequest; - if (typeof req !== 'string') { - return false; - } - return req.search(check) >= 0; -} diff --git a/generators/client/templates/angular/webpack/webpack.common.js.ejs b/generators/client/templates/angular/webpack/webpack.common.js.ejs index fea3ed85936b..000b76121017 100644 --- a/generators/client/templates/angular/webpack/webpack.common.js.ejs +++ b/generators/client/templates/angular/webpack/webpack.common.js.ejs @@ -23,8 +23,10 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const rxPaths = require('rxjs/_esm5/path-mapping'); <%_ if (enableTranslation) { _%> const MergeJsonWebpackPlugin = require("merge-jsons-webpack-plugin"); -<%_ } _%> +<%_ } if (buildTool === undefined) { _%> +const packageJson = require('./../package.json'); +<%_ } _%> const utils = require('./utils.js'); module.exports = (options) => ({ @@ -78,12 +80,11 @@ module.exports = (options) => ({ 'process.env': { NODE_ENV: `'${options.env}'`, BUILD_TIMESTAMP: `'${new Date().getTime()}'`, -<%_ if (buildTool === 'gradle' || buildTool === 'maven') { _%> - // If webpack is run through Gradle 'webpack'/'webpackBuildDev' NpmTasks / Maven 'frontend-maven-plugin', then APP_VERSION is set. - VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, +<%_ if (buildTool === undefined) { _%> + VERSION: `'${packageJson.version}'`, <%_ } else { _%> - // Server generation is skipped, so there is no way to determine the application version from server. - VERSION: `'0.0.1-SNAPSHOT'`, + // APP_VERSION is passed as an environment variable from the Gradle / Maven build tasks. + VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, <%_ } _%> DEBUG_INFO_ENABLED: options.env === 'development', // The root URL for API calls, ending with a '/' - for example: `"https://www.jhipster.tech:8081/myservice/"`. diff --git a/generators/client/templates/react/webpack/utils.js.ejs b/generators/client/templates/react/webpack/utils.js.ejs index fd626976869c..733740d00ea2 100644 --- a/generators/client/templates/react/webpack/utils.js.ejs +++ b/generators/client/templates/react/webpack/utils.js.ejs @@ -19,8 +19,7 @@ const path = require('path'); module.exports = { - root, - isExternalLib + root }; const _root = path.resolve(__dirname, '..'); @@ -29,11 +28,3 @@ function root(args) { args = Array.prototype.slice.call(arguments, 0); return path.join.apply(path, [_root].concat(args)); } - -function isExternalLib(module, check = /node_modules/) { - const req = module.userRequest; - if (typeof req !== 'string') { - return false; - } - return req.search(check) >= 0; -} diff --git a/generators/client/templates/react/webpack/webpack.common.js.ejs b/generators/client/templates/react/webpack/webpack.common.js.ejs index 5d639a54a78a..5a869da13b16 100644 --- a/generators/client/templates/react/webpack/webpack.common.js.ejs +++ b/generators/client/templates/react/webpack/webpack.common.js.ejs @@ -16,6 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> +const path = require('path'); const webpack = require('webpack'); const { BaseHrefWebpackPlugin } = require('base-href-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); @@ -23,9 +24,10 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); <%_ if (enableTranslation) { _%> const MergeJsonWebpackPlugin = require('merge-jsons-webpack-plugin'); -<%_ } _%> -const path = require('path'); +<%_ } if (buildTool === undefined) { _%> +const packageJson = require('./../package.json'); +<%_ } _%> const utils = require('./utils.js'); const getTsLoaderRule = env => { @@ -123,12 +125,11 @@ module.exports = options => ({ <%_ if (enableTranslation) { _%> BUILD_TIMESTAMP: `'${new Date().getTime()}'`, <%_ } _%> -<%_ if (buildTool === 'gradle' || buildTool === 'maven') { _%> - // If webpack is run through Gradle 'webpack'/'webpackBuildDev' NpmTasks / Maven 'frontend-maven-plugin', then APP_VERSION is set. - VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, +<%_ if (buildTool === undefined) { _%> + VERSION: `'${packageJson.version}'`, <%_ } else { _%> - // Server generation is skipped, so there is no way to determine the application version from server. - VERSION: `'0.0.1-SNAPSHOT'`, + // APP_VERSION is passed as an environment variable from the Gradle / Maven build tasks. + VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`, <%_ } _%> DEBUG_INFO_ENABLED: options.env === 'development', // The root URL for API calls, ending with a '/' - for example: `"https://www.jhipster.tech:8081/myservice/"`. From 5f4afcf8cd11625cc12f43ef92e6befbbbbcdf19 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Wed, 26 Jun 2019 10:49:05 +0300 Subject: [PATCH 230/298] Allow loading .yo-rc.json from an alternate root path other than cwd --- generators/generator-base.js | 7 ++++++- generators/utils.js | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/generators/generator-base.js b/generators/generator-base.js index ba474403c96d..ba26218c51a4 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -1995,7 +1995,12 @@ module.exports = class extends PrivateBase { * @param {boolean} force force getting direct from file */ getAllJhipsterConfig(generator = this, force) { - return jhipsterUtils.getAllJhipsterConfig(generator, force); + const configRootPath = + generator.configRootPath || + (generator.options && generator.options.configRootPath) || + (generator.configOptions && generator.configOptions.configRootPath) || + ''; + return jhipsterUtils.getAllJhipsterConfig(generator, force, configRootPath); } /** diff --git a/generators/utils.js b/generators/utils.js index e28e05fd3a7f..ae24987dca93 100644 --- a/generators/utils.js +++ b/generators/utils.js @@ -414,11 +414,13 @@ function decodeBase64(string, encoding = 'utf-8') { * Get all the generator configuration from the .yo-rc.json file * @param {Generator} generator the generator instance to use * @param {boolean} force force getting direct from file + * @param {String} base path where the .yo-rc.json file is located. Default is cwd. */ -function getAllJhipsterConfig(generator, force) { +function getAllJhipsterConfig(generator, force, basePath = '') { let configuration = generator && generator.config ? generator.config.getAll() || {} : {}; - if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist('.yo-rc.json')) { - const yoRc = JSON.parse(fs.readFileSync('.yo-rc.json', { encoding: 'utf-8' })); + const filePath = path.join(basePath, '.yo-rc.json'); + if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist(filePath)) { + const yoRc = JSON.parse(fs.readFileSync(filePath, { encoding: 'utf-8' })); configuration = yoRc['generator-jhipster']; // merge the blueprint config if available if (configuration.blueprint) { From c02d19662ec56b49d1b64e15c49a8931adeec774 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Fri, 28 Jun 2019 11:11:22 +0300 Subject: [PATCH 231/298] Add unit tests for utils.getAllJhipsterConfig() Fix upgrade sub-gen test not resetting cwd after changing it --- generators/utils.js | 2 +- test/upgrade.spec.js | 10 ++++++++++ test/utils.spec.js | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/generators/utils.js b/generators/utils.js index ae24987dca93..c632130b3553 100644 --- a/generators/utils.js +++ b/generators/utils.js @@ -418,7 +418,7 @@ function decodeBase64(string, encoding = 'utf-8') { */ function getAllJhipsterConfig(generator, force, basePath = '') { let configuration = generator && generator.config ? generator.config.getAll() || {} : {}; - const filePath = path.join(basePath, '.yo-rc.json'); + const filePath = path.join(basePath || '', '.yo-rc.json'); if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist(filePath)) { const yoRc = JSON.parse(fs.readFileSync(filePath, { encoding: 'utf-8' })); configuration = yoRc['generator-jhipster']; diff --git a/test/upgrade.spec.js b/test/upgrade.spec.js index e0977a5933d3..7ca02ef77049 100644 --- a/test/upgrade.spec.js +++ b/test/upgrade.spec.js @@ -10,6 +10,7 @@ const packageJson = require('../package.json'); describe('JHipster upgrade generator', function() { this.timeout(200000); describe('default application', () => { + const cwd = process.cwd(); before(done => { let workingDirectory; helpers @@ -77,8 +78,13 @@ describe('JHipster upgrade generator', function() { // - master: merge commit of jhipster_upgrade expect(commitsCount).to.equal('5'); }); + + after(() => { + process.chdir(cwd); + }); }); describe('blueprint application', () => { + const cwd = process.cwd(); const blueprintName = 'generator-jhipster-sample-blueprint'; const blueprintVersion = '0.1.1'; before(done => { @@ -162,5 +168,9 @@ describe('JHipster upgrade generator', function() { assert.fileContent('.yo-rc.json', new RegExp(`"blueprintVersion": "${blueprintVersion}"`)); assert.fileContent('package.json', new RegExp(`"${blueprintName}": "${blueprintVersion}"`)); }); + + after(() => { + process.chdir(cwd); + }); }); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index 54a680736e2e..4fbb273e70bf 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -1,4 +1,5 @@ const assert = require('yeoman-assert'); +const helpers = require('yeoman-test'); const utils = require('../generators/utils'); describe('JHipster Utils', () => { @@ -88,4 +89,40 @@ describe('JHipster Utils', () => { assert.textEqual(generatorName, '@corp/foo'); }); }); + describe('::getAllJhipsterConfig', () => { + const cwd = process.cwd(); + const configRootDir = './test/templates/default'; + const expectedConfig = { + applicationType: 'monolith', + baseName: 'sampleMysql', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + authenticationType: 'session', + cacheProvider: 'ehcache', + websocket: 'no', + databaseType: 'sql', + devDatabaseType: 'h2Disk', + prodDatabaseType: 'mysql', + searchEngine: 'no', + buildTool: 'maven', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['en', 'fr'], + rememberMeKey: '2bb60a80889aa6e6767e9ccd8714982681152aa5', + testFrameworks: ['gatling'] + }; + + it('load config from alternate directory', () => { + const loadedConfig = utils.getAllJhipsterConfig(helpers.createDummyGenerator(), true, configRootDir); + assert.objectContent(loadedConfig, expectedConfig); + }); + it('load config from current working directory', () => { + process.chdir(configRootDir); + const loadedConfig = utils.getAllJhipsterConfig(helpers.createDummyGenerator(), true); + assert.objectContent(loadedConfig, expectedConfig); + }); + after(() => { + process.chdir(cwd); + }); + }); }); From 555af5d705f9ed5b896088c2c765483344277a2d Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Fri, 28 Jun 2019 11:48:26 +0200 Subject: [PATCH 232/298] Use the yo cli script from generator-jhipster node modules (no need to install it globally) --- generators/generator-base-private.js | 8 +- package-lock.json | 1724 +++++++++++++++++++++++++- package.json | 3 +- 3 files changed, 1716 insertions(+), 19 deletions(-) diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index fc3c10e14462..ade090c9699b 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -830,7 +830,11 @@ module.exports = class extends Generator { done(); return; } - shelljs.exec('yo --generators', { silent: true }, (err, stdout, stderr) => { + + // Path to the yo cli script in generator-jhipster's node_modules + const yoInternalCliPath = `${__dirname}/../node_modules/yo/lib/cli.js`; + + shelljs.exec(`${yoInternalCliPath} --generators`, { silent: true }, (err, stdout, stderr) => { if (!stdout.includes(` ${blueprint}\n`) && !stdout.includes(` ${generatorName}\n`)) { this.error( `The ${chalk.yellow(blueprint)} blueprint provided is not installed. Please install it using command ${chalk.yellow( @@ -1355,7 +1359,7 @@ module.exports = class extends Generator { this.warning( `Deprecated: JHipster seems to be invoked using Yeoman command. Please use the JHipster CLI. Run ${chalk.red( 'jhipster ' - )} instead of ${chalk.red('yo jhipster:')}` + )} instead of ${chalk.red(`yo jhipster:`)}` ); } } diff --git a/package-lock.json b/package-lock.json index 3490a848f847..82447bc97cda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.1", + "version": "6.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -44,6 +44,11 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==" + }, "@sinonjs/commons": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.1.tgz", @@ -116,6 +121,15 @@ "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, + "aggregate-error": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-1.0.0.tgz", + "integrity": "sha1-iINE2tAiCnLjr1CQYRf0h3GSX6w=", + "requires": { + "clean-stack": "^1.0.0", + "indent-string": "^3.0.0" + } + }, "ajv": { "version": "6.9.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", @@ -132,6 +146,14 @@ "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=" }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "requires": { + "string-width": "^2.0.0" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -284,8 +306,7 @@ "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==" }, "async": { "version": "2.6.2", @@ -399,6 +420,37 @@ "tweetnacl": "^0.14.3" } }, + "bin-version": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-2.0.0.tgz", + "integrity": "sha1-LMldg7Uive8umZeOdq61SRyBFP8=", + "requires": { + "execa": "^0.1.1", + "find-versions": "^2.0.0" + }, + "dependencies": { + "execa": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.1.1.tgz", + "integrity": "sha1-sJwqkwm8DvBQFHlHLbMYD41MPt0=", + "requires": { + "cross-spawn-async": "^2.1.1", + "object-assign": "^4.0.1", + "strip-eof": "^1.0.0" + } + } + } + }, + "bin-version-check": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bin-version-check/-/bin-version-check-3.0.0.tgz", + "integrity": "sha1-4k6/prY8sDh8X8F0+G5cyBLKfMk=", + "requires": { + "bin-version": "^2.0.0", + "semver": "^5.1.0", + "semver-truncate": "^1.0.0" + } + }, "binaryextensions": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.2.tgz", @@ -410,6 +462,20 @@ "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==", "dev": true }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -492,6 +558,32 @@ "unset-value": "^1.0.0" } }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" + } + } + }, "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", @@ -518,6 +610,11 @@ "quick-lru": "^1.0.0" } }, + "capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==" + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -575,6 +672,11 @@ "regexp-to-ast": "0.4.0" } }, + "ci-info": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==" + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -601,6 +703,16 @@ } } }, + "clean-stack": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", + "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=" + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -609,6 +721,11 @@ "restore-cursor": "^2.0.0" } }, + "cli-list": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/cli-list/-/cli-list-0.2.0.tgz", + "integrity": "sha1-fmc+4N05phGkhkduU/PGs5QctYI=" + }, "cli-table": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", @@ -687,6 +804,23 @@ "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" }, + "clone-regexp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.1.tgz", + "integrity": "sha512-Fcij9IwRW27XedRIJnSOEupS7RVcXtObJXbcUOX93UCLqqOdRpkvzKywOOSizmEK/Is3S/RHX9dLdfo6R1Q1mw==", + "requires": { + "is-regexp": "^1.0.0", + "is-supported-regexp-flag": "^1.0.0" + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "requires": { + "mimic-response": "^1.0.0" + } + }, "clone-stats": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", @@ -817,6 +951,28 @@ "write-file-atomic": "^2.3.0" } }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "configstore": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", + "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", + "requires": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -833,6 +989,14 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "requires": { + "capture-stack-trace": "^1.0.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -845,6 +1009,20 @@ "which": "^1.2.9" } }, + "cross-spawn-async": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz", + "integrity": "sha1-hF/wwINKPe2dFg2sptOQkGuyiMw=", + "requires": { + "lru-cache": "^4.0.0", + "which": "^1.2.8" + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -933,6 +1111,11 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-uid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-uid/-/default-uid-1.0.0.tgz", + "integrity": "sha1-/O+p359axAyJFtkS3R/hFGqjxZ4=" + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1045,6 +1228,15 @@ "is-obj": "^1.0.0" } }, + "downgrade-root": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/downgrade-root/-/downgrade-root-1.2.2.tgz", + "integrity": "sha1-UxMZcVsOgf/MIusoR4uidkPhLGw=", + "requires": { + "default-uid": "^1.0.0", + "is-root": "^1.0.0" + } + }, "drange": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/drange/-/drange-1.1.1.tgz", @@ -1055,6 +1247,22 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "each-async": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.1.tgz", + "integrity": "sha1-3uUim98KtrogEqOV4bhpq/iBNHM=", + "requires": { + "onetime": "^1.0.0", + "set-immediate-shim": "^1.0.0" + }, + "dependencies": { + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + } + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -1140,6 +1348,11 @@ "env-variable": "0.0.x" } }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -1221,6 +1434,11 @@ "is-symbol": "^1.0.2" } }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1638,6 +1856,14 @@ } } }, + "execall": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execall/-/execall-1.0.0.tgz", + "integrity": "sha1-c9CQTjlbPKsGWLCNCewlMH8pu3M=", + "requires": { + "clone-regexp": "^1.0.0" + } + }, "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", @@ -1868,6 +2094,11 @@ } } }, + "filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -1876,6 +2107,15 @@ "locate-path": "^2.0.0" } }, + "find-versions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-2.0.0.tgz", + "integrity": "sha1-KtkNSQ9oKMGqQCks9wmsMxghDDw=", + "requires": { + "array-uniq": "^1.0.0", + "semver-regex": "^1.0.0" + } + }, "first-chunk-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", @@ -1946,6 +2186,11 @@ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, + "foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=" + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -1969,6 +2214,15 @@ "map-cache": "^0.2.2" } }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -1985,6 +2239,59 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fullname": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fullname/-/fullname-3.3.0.tgz", + "integrity": "sha1-oIdH1pISKWELgXi3YU/OEMsYX1o=", + "requires": { + "execa": "^0.6.0", + "filter-obj": "^1.1.0", + "mem": "^1.1.0", + "p-any": "^1.0.0", + "p-try": "^1.0.0", + "passwd-user": "^2.1.0", + "rc": "^1.1.6" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", + "integrity": "sha1-V7aaWU8IF1nGnlNw8NF7nLEWWP4=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "^1.0.0" + } + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2102,6 +2409,25 @@ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "requires": { + "ini": "^1.3.4" + } + }, + "global-tunnel-ng": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz", + "integrity": "sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg==", + "requires": { + "encodeurl": "^1.0.2", + "lodash": "^4.17.10", + "npm-conf": "^1.1.3", + "tunnel": "^0.0.6" + } + }, "globals": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", @@ -2286,6 +2612,11 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==" + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -2296,6 +2627,14 @@ "sshpk": "^1.7.0" } }, + "humanize-string": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/humanize-string/-/humanize-string-1.0.2.tgz", + "integrity": "sha512-PH5GBkXqFxw5+4eKaKRIkD23y6vRd/IXSl7IldyJxEXpDH9SEIXRORkBtkGni/ae2P7RVOw6Wxypd2tGXhha1w==", + "requires": { + "decamelize": "^1.0.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -2319,6 +2658,11 @@ "resolve-from": "^4.0.0" } }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -2343,6 +2687,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, "inquirer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", @@ -2441,6 +2790,22 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==" }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + }, + "dependencies": { + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + } + } + }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -2480,6 +2845,14 @@ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "requires": { + "ci-info": "^1.5.0" + } + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -2521,6 +2894,11 @@ } } }, + "is-docker": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-1.1.0.tgz", + "integrity": "sha1-8EN01O7lMQ6ajhE78UlUEeRhdqE=" + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -2531,6 +2909,14 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -2544,6 +2930,20 @@ "is-extglob": "^2.1.1" } }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "requires": { + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" + } + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -2572,6 +2972,14 @@ "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "^1.0.1" + } + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -2590,6 +2998,11 @@ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" + }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -2599,11 +3012,21 @@ "has": "^1.0.1" } }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=" + }, "is-retry-allowed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" }, + "is-root": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-root/-/is-root-1.0.0.tgz", + "integrity": "sha1-B7bCM7w5TNnQK6FclmvWZg1jQtU=" + }, "is-scoped": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-scoped/-/is-scoped-1.0.0.tgz", @@ -2617,6 +3040,11 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-supported-regexp-flag": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-supported-regexp-flag/-/is-supported-regexp-flag-1.0.1.tgz", + "integrity": "sha512-3vcJecUUrpgCqc/ca0aWeNu64UGgxcvO60K/Fkr1N6RSvfGCTU60UKN68JDmKokgba0rFFJs12EnzOQa14ubKQ==" + }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", @@ -2641,6 +3069,11 @@ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2781,6 +3214,11 @@ } } }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2832,6 +3270,14 @@ "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", "dev": true }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", @@ -2854,6 +3300,50 @@ "colornames": "^1.1.1" } }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "requires": { + "package-json": "^4.0.0" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "requires": { + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" + } + }, + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "requires": { + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" + } + } + } + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -2901,6 +3391,14 @@ "path-exists": "^3.0.0" } }, + "locutus": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.11.tgz", + "integrity": "sha512-C0q1L38lK5q1t+wE0KY21/9szrBHxye6o2z5EJzU+5B79tubNOC+nLAEzTTn1vPUGoUuehKh8kYKqiVUTWRyaQ==", + "requires": { + "es6-promise": "^4.2.5" + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -2982,6 +3480,15 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, "macos-release": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-1.1.0.tgz", @@ -3559,6 +4066,41 @@ "validate-npm-package-license": "^3.0.1" } }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + } + } + }, + "npm-conf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz", + "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==", + "requires": { + "config-chain": "^1.1.11", + "pify": "^3.0.0" + } + }, + "npm-keyword": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-keyword/-/npm-keyword-5.0.0.tgz", + "integrity": "sha1-mbha7Cn8s4jS3TUfABO/Umh4fmc=", + "requires": { + "got": "^7.1.0", + "registry-url": "^3.0.3" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -3626,6 +4168,11 @@ "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", "dev": true }, + "object-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object-values/-/object-values-1.0.0.tgz", + "integrity": "sha1-cq+DljARnluYw7AruMJ+MjcVgQU=" + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -3697,6 +4244,14 @@ "mimic-fn": "^1.0.0" } }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "requires": { + "is-wsl": "^1.1.0" + } + }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", @@ -3711,6 +4266,11 @@ "wordwrap": "~1.0.0" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, "os-locale": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", @@ -3740,6 +4300,14 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, + "p-any": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-any/-/p-any-1.1.0.tgz", + "integrity": "sha512-Ef0tVa4CZ5pTAmKn+Cg3w8ABBXh+hHO1aV8281dKOoUHfX+3tjG2EaFcC+aZyagg9b4EYGsHEjz21DnEE8Og2g==", + "requires": { + "p-some": "^2.0.0" + } + }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -3776,6 +4344,14 @@ "p-limit": "^1.1.0" } }, + "p-some": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-some/-/p-some-2.0.1.tgz", + "integrity": "sha1-Zdh8ixVO289SIdFnd4ttLhUPbwY=", + "requires": { + "aggregate-error": "^1.0.0" + } + }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -3789,9 +4365,82 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, - "parent-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "package-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-5.0.0.tgz", + "integrity": "sha512-EeHQFFTlEmLrkIQoxbE9w0FuAWHoc1XpthDqnZ/i9keOt701cteyXwAxQFLpVqVjj3feh2TodkihjLaRUtIgLg==", + "requires": { + "got": "^8.3.1", + "registry-auth-token": "^3.3.2", + "registry-url": "^3.1.0", + "semver": "^5.5.0" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + } + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==" + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "requires": { + "p-finally": "^1.0.0" + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "requires": { + "prepend-http": "^2.0.0" + } + } + } + }, + "pad-component": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pad-component/-/pad-component-0.0.1.tgz", + "integrity": "sha1-rR8izhvw/cDW3dkIrxfzUaQEuKw=" + }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", "dev": true, "requires": { @@ -3803,6 +4452,14 @@ "resolved": "https://registry.npmjs.org/parse-gitignore/-/parse-gitignore-1.0.1.tgz", "integrity": "sha512-UGyowyjtx26n65kdAMWhm6/3uy5uSrpcuH7tt+QEVudiBoVS+eqHxD5kbi9oWVRwj7sCzXqwuM+rUGw7earl6A==" }, + "parse-help": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-help/-/parse-help-1.0.0.tgz", + "integrity": "sha512-dlOrbBba6Rrw/nrJ+V7/vkGZdiimWJQzMHZZrYsUq03JE8AV3fAv6kOYX7dP/w2h67lIdmRf8ES8mU44xAgE/Q==", + "requires": { + "execall": "^1.0.0" + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -3817,6 +4474,48 @@ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" }, + "passwd-user": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/passwd-user/-/passwd-user-2.1.0.tgz", + "integrity": "sha1-+tnbauJS+LCI4MXezSCn2gxdnx4=", + "requires": { + "execa": "^0.4.0", + "pify": "^2.3.0" + }, + "dependencies": { + "execa": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.4.0.tgz", + "integrity": "sha1-TrZGejaglfq7KXD/nV4/t7zm68M=", + "requires": { + "cross-spawn-async": "^2.1.1", + "is-stream": "^1.1.0", + "npm-run-path": "^1.0.0", + "object-assign": "^4.0.1", + "path-key": "^1.0.0", + "strip-eof": "^1.0.0" + } + }, + "npm-run-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-1.0.0.tgz", + "integrity": "sha1-9cMr9ZX+ga6Sfa7FLoL4sACsPI8=", + "requires": { + "path-key": "^1.0.0" + } + }, + "path-key": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz", + "integrity": "sha1-XVPVeAGWRsDWiADbThRua9wqx68=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -3835,8 +4534,7 @@ "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" }, "path-key": { "version": "2.0.1", @@ -3982,6 +4680,16 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, "psl": { "version": "1.1.31", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", @@ -4006,6 +4714,16 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, "quick-lru": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", @@ -4020,6 +4738,24 @@ "ret": "^0.2.0" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, "read-chunk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-3.0.0.tgz", @@ -4131,6 +4867,23 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "registry-auth-token": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "requires": { + "rc": "^1.0.1" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -4146,6 +4899,14 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "^1.0.0" + } + }, "replace-ext": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", @@ -4191,6 +4952,14 @@ "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -4219,6 +4988,15 @@ "glob": "^7.1.3" } }, + "root-check": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/root-check/-/root-check-1.0.0.tgz", + "integrity": "sha1-xSp5S/Dbn61WdTbkGJjwyeCoZpc=", + "requires": { + "downgrade-root": "^1.0.0", + "sudo-block": "^1.1.0" + } + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -4281,12 +5059,38 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "requires": { + "semver": "^5.0.3" + } + }, + "semver-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-1.0.0.tgz", + "integrity": "sha1-kqSWkGX5xwxpR1PVUkj8aPj2Usk=" + }, + "semver-truncate": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/semver-truncate/-/semver-truncate-1.1.2.tgz", + "integrity": "sha1-V/Qd5pcHpicJp+AQS6IRcQnqR+g=", + "requires": { + "semver": "^5.3.0" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -4490,6 +5294,23 @@ } } }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "sort-on": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sort-on/-/sort-on-3.0.0.tgz", + "integrity": "sha512-e2RHeY1iM6dT9od3RoqeJSyz3O7naNFsGy34+EFEcwghjAncuOXC2/Xwq87S4FbypqLVp6PcizYEsGEGsGIDXA==", + "requires": { + "arrify": "^1.0.0", + "dot-prop": "^4.1.1" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -4629,6 +5450,20 @@ "readable-stream": "^2.0.2" } }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + } + }, "string-template": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", @@ -4696,8 +5531,54 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "sudo-block": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/sudo-block/-/sudo-block-1.2.0.tgz", + "integrity": "sha1-zFOb+BkWJNT1B9g+60W0zqJ/NGM=", + "requires": { + "chalk": "^1.0.0", + "is-docker": "^1.0.0", + "is-root": "^1.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } }, "supports-color": { "version": "5.5.0", @@ -4935,6 +5816,66 @@ "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", "dev": true }, + "taketalk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/taketalk/-/taketalk-1.0.0.tgz", + "integrity": "sha1-tNTw3u0gauffd1sSnqLKbeUvJt0=", + "requires": { + "get-stdin": "^4.0.1", + "minimist": "^1.1.0" + }, + "dependencies": { + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "requires": { + "execa": "^0.7.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + } + } + }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -4968,6 +5909,11 @@ "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, + "titleize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-1.0.1.tgz", + "integrity": "sha512-rUwGDruKq1gX+FFHbTl5qjI7teVO7eOe+C8IcQ7QT+1BK3eEUXJqbZcBOeaRP4FwSC/C1A5jDoIVta0nIQ9yew==" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -5057,6 +6003,11 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -5070,6 +6021,16 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "twig": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/twig/-/twig-1.13.3.tgz", + "integrity": "sha512-Kjart2102Kf0IdsEmLonSJKcByU7o9uiJhBde3GhrNHrX4XenT5WSKu4Hpkx+rF6Kyppeyd48BKsCREIOPXd/g==", + "requires": { + "locutus": "^2.0.5", + "minimatch": "3.0.x", + "walk": "2.3.x" + } + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -5139,6 +6100,14 @@ } } }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "requires": { + "crypto-random-string": "^1.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -5185,6 +6154,28 @@ "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==" }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=" + }, + "update-notifier": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", + "requires": { + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -5216,6 +6207,14 @@ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" }, + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "requires": { + "os-homedir": "^1.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5283,6 +6282,14 @@ } } }, + "walk": { + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.14.tgz", + "integrity": "sha512-5skcWAUmySj6hkBdH6B6+3ddMjVQYH5Qy9QGbPmN8kVmLteXk+yVXg+yfk1nbX30EYakahLrr8iPcCxJQSCBeg==", + "requires": { + "foreachasync": "^3.0.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -5306,6 +6313,14 @@ "string-width": "^1.0.2 || 2" } }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "requires": { + "string-width": "^2.1.1" + } + }, "win-release": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/win-release/-/win-release-1.1.1.tgz", @@ -5378,7 +6393,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -5387,14 +6401,12 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5403,7 +6415,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5414,7 +6425,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5445,6 +6455,11 @@ "signal-exit": "^3.0.2" } }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" + }, "xmlcreate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", @@ -5462,6 +6477,11 @@ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", @@ -5770,6 +6790,47 @@ "integrity": "sha512-bCuLb/j/WzpvrJZCTdJJLFzm7KK8IYQJ3+dF9dYtNs2CUYyezFJDuULiZ2neM4eqjf45GN1KH/MzCTT3i90wUQ==", "dev": true }, + "yeoman-character": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/yeoman-character/-/yeoman-character-1.1.0.tgz", + "integrity": "sha1-kNS1vq+SdZCGF3AVsv36LgaE18c=", + "requires": { + "supports-color": "^3.1.2" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "yeoman-doctor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yeoman-doctor/-/yeoman-doctor-3.0.3.tgz", + "integrity": "sha512-L/1PUIReI8cOzAWgmBY64VBCLeH2IEpgtnF3X97BUU6SraQFczeXXIzh6n5idG4jfzMfWRF1lS4zf6wdg7hAbw==", + "requires": { + "ansi-styles": "^3.2.0", + "bin-version-check": "^3.0.0", + "chalk": "^2.3.0", + "each-async": "^1.1.1", + "global-tunnel-ng": "^2.5.3", + "latest-version": "^3.1.0", + "log-symbols": "^2.1.0", + "object-values": "^1.0.0", + "semver": "^5.0.3", + "twig": "^1.10.5", + "user-home": "^2.0.0" + } + }, "yeoman-environment": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-2.3.4.tgz", @@ -6186,6 +7247,637 @@ } } } + }, + "yo": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/yo/-/yo-2.0.6.tgz", + "integrity": "sha512-1OleNumZXtE/Lo/ZDPsMXqOX8oXr8tpBXYgUGEDAONYqLX3/n3PV3BWkXI7Iwq6vhuAAYPRLinncUe30izlcSg==", + "requires": { + "async": "^2.6.1", + "chalk": "^2.4.1", + "cli-list": "^0.2.0", + "configstore": "^3.1.2", + "cross-spawn": "^6.0.5", + "figures": "^2.0.0", + "fullname": "^3.2.0", + "global-tunnel-ng": "^2.5.3", + "got": "^8.3.2", + "humanize-string": "^1.0.2", + "inquirer": "^6.0.0", + "insight": "0.10.1", + "lodash": "^4.17.10", + "meow": "^3.0.0", + "npm-keyword": "^5.0.0", + "opn": "^5.3.0", + "package-json": "^5.0.0", + "parse-help": "^1.0.0", + "read-pkg-up": "^4.0.0", + "root-check": "^1.0.0", + "sort-on": "^3.0.0", + "string-length": "^2.0.0", + "tabtab": "^1.3.2", + "titleize": "^1.0.1", + "update-notifier": "^2.5.0", + "user-home": "^2.0.0", + "yeoman-character": "^1.0.0", + "yeoman-doctor": "^3.0.1", + "yeoman-environment": "^2.3.0", + "yosay": "^2.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "requires": { + "repeating": "^2.0.0" + } + }, + "inquirer": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.4.1.tgz", + "integrity": "sha512-/Jw+qPZx4EDYsaT6uz7F4GJRNFMRdKNeUZw3ZnKV8lyuUgz/YWRCSUAJMZSVhSq4Ec0R2oYnyi6b3d4JXcL5Nw==", + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + } + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==" + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "^3.0.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + } + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "requires": { + "tslib": "^1.9.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "requires": { + "get-stdin": "^4.0.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "tabtab": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-1.3.2.tgz", + "integrity": "sha1-u5wspjJPZZ/edjTCyvPAluEYfKc=", + "requires": { + "debug": "^2.2.0", + "inquirer": "^1.0.2", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "npmlog": "^2.0.3", + "object-assign": "^4.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "requires": { + "prepend-http": "^2.0.0" + } + } + } + }, + "yosay": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/yosay/-/yosay-2.0.2.tgz", + "integrity": "sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA==", + "requires": { + "ansi-regex": "^2.0.0", + "ansi-styles": "^3.0.0", + "chalk": "^1.0.0", + "cli-boxes": "^1.0.0", + "pad-component": "0.0.1", + "string-width": "^2.0.0", + "strip-ansi": "^3.0.0", + "taketalk": "^1.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } } } } diff --git a/package.json b/package.json index 56e2427b06c6..3e353217b473 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,8 @@ "through2": "3.0.1", "uuid": "3.3.2", "yeoman-environment": "2.3.4", - "yeoman-generator": "3.2.0" + "yeoman-generator": "3.2.0", + "yo": "2.0.6" }, "devDependencies": { "chai": "4.2.0", From 321cd2514ea723d804f657da1d6ad4ee7d22d5aa Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Tue, 18 Jun 2019 14:17:20 +0300 Subject: [PATCH 233/298] Support multiple blueprints --- .github/FUNDING.yml | 2 +- cli/commands.js | 41 ++++-- generators/app/index.js | 57 ++++++-- generators/cleanup.js | 4 + generators/client/index.js | 32 ++-- generators/common/index.js | 21 +-- generators/entity-client/index.js | 22 +-- generators/entity-i18n/index.js | 19 +-- generators/entity-server/index.js | 20 +-- generators/entity/index.js | 25 +--- generators/generator-base-private.js | 36 +++++ generators/languages/index.js | 28 ++-- generators/server/index.js | 30 ++-- generators/spring-controller/index.js | 22 +-- generators/spring-service/index.js | 22 +-- generators/upgrade/index.js | 149 +++++++++++++------ generators/utils.js | 74 +++++++++- test/blueprint/app-blueprint.spec.js | 4 +- test/blueprint/multiple-blueprints.spec.js | 162 +++++++++++++++++++++ test/blueprint/scoped-blueprint.spec.js | 4 +- test/cli/cli.spec.js | 19 ++- test/upgrade.spec.js | 5 +- test/utils.spec.js | 31 ++++ 23 files changed, 582 insertions(+), 247 deletions(-) create mode 100644 test/blueprint/multiple-blueprints.spec.js diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 7efb418ba1d5..27ad37a22cfc 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ open_collective: generator-jhipster -custom: https://www.jhipster.tech/sponsors/ \ No newline at end of file +custom: https://www.jhipster.tech/sponsors/ diff --git a/cli/commands.js b/cli/commands.js index 711096f45a04..296a039665f5 100644 --- a/cli/commands.js +++ b/cli/commands.js @@ -19,20 +19,37 @@ const chalk = require('chalk'); const jhipsterUtils = require('../generators/utils'); -let customCommands = {}; -const indexOfBlueprintArgv = process.argv.indexOf('--blueprint'); -if (indexOfBlueprintArgv > -1) { - /* eslint-disable import/no-dynamic-require */ - /* eslint-disable global-require */ +const customCommands = loadBlueprintCommands(); - const blueprint = jhipsterUtils.normalizeBlueprintName(process.argv[indexOfBlueprintArgv + 1]); - try { - customCommands = require(`${blueprint}/cli/commands`); - } catch (e) { - const msg = `No custom command found within blueprint: ${blueprint}`; - /* eslint-disable no-console */ - console.info(`${chalk.green.bold('INFO!')} ${msg}`); +function loadBlueprintCommands() { + const blueprintNames = []; + const indexOfBlueprintArgv = process.argv.indexOf('--blueprint'); + if (indexOfBlueprintArgv > -1) { + blueprintNames.push(process.argv[indexOfBlueprintArgv + 1]); } + const indexOfBlueprintsArgv = process.argv.indexOf('--blueprints'); + if (indexOfBlueprintsArgv > -1) { + blueprintNames.push(...process.argv[indexOfBlueprintsArgv + 1].split(',')); + } + let result = {}; + if (blueprintNames.length > 0) { + blueprintNames + .filter((v, i, a) => a.indexOf(v) === i) + .map(v => jhipsterUtils.normalizeBlueprintName(v)) + .forEach(blueprint => { + /* eslint-disable import/no-dynamic-require */ + /* eslint-disable global-require */ + try { + const blueprintCommands = require(`${blueprint}/cli/commands`); + result = { ...customCommands, ...blueprintCommands }; + } catch (e) { + const msg = `No custom commands found within blueprint: ${blueprint}`; + /* eslint-disable no-console */ + console.info(`${chalk.green.bold('INFO!')} ${msg}`); + } + }); + } + return result; } const defaultCommands = { diff --git a/generators/app/index.js b/generators/app/index.js index f5fb9937e663..f0541f8dcaea 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -156,9 +156,15 @@ module.exports = class extends BaseGenerator { type: String }); - // This adds support for a `--blueprint` flag which can be used to specify a blueprint to use for generation + // NOTE: Deprecated!!! Use --blueprints instead this.option('blueprint', { - desc: 'Specify a generator blueprint to use for the sub generators', + desc: 'Specify one or more generator blueprints to use for the sub generators', + type: String + }); + // This adds support for a `--blueprints` flag which can be used to specify one or more blueprints to use for generation + this.option('blueprints', { + desc: + 'A comma separated list of one or more generator blueprints to use for the sub generators, e.g. --blueprints kotlin,vuejs', type: String }); @@ -189,8 +195,24 @@ module.exports = class extends BaseGenerator { this.withEntities = this.options['with-entities']; this.skipChecks = this.options['skip-checks']; - const blueprint = jhipsterUtils.normalizeBlueprintName(this.options.blueprint || this.config.get('blueprint')); - this.blueprint = this.configOptions.blueprint = blueprint; + + let blueprints = this.options.blueprints || ''; + // check for old single blueprint declaration + const blueprint = this.options.blueprint; + if (blueprint) { + this.warning('--blueprint option is deprecated. Please use --blueprints instead'); + if (!blueprints.split(',').includes(blueprint)) { + blueprints = `${blueprint},${blueprints}`; + } + } + if (blueprints) { + blueprints = jhipsterUtils.parseBluePrints(blueprints); + } else { + blueprints = jhipsterUtils.loadBlueprintsFromConfiguration(this); + } + + this.blueprints = this.configOptions.blueprints = blueprints; + this.useNpm = this.configOptions.useNpm = !this.options.yarn; this.useYarn = !this.useNpm; @@ -210,8 +232,8 @@ module.exports = class extends BaseGenerator { }, validateBlueprint() { - if (this.blueprint && !this.skipChecks) { - this.checkBlueprint(this.blueprint); + if (this.blueprints && !this.skipChecks) { + this.blueprints.forEach(e => this.checkBlueprint(e)); } }, @@ -254,11 +276,14 @@ module.exports = class extends BaseGenerator { this.jhipsterVersion = this.config.get('jhipsterVersion'); } this.otherModules = this.config.get('otherModules') || []; - if (this.blueprint) { - this.blueprintVersion = this.findBlueprintVersion(this.blueprint); + if (this.blueprints && this.blueprints.length > 0) { + this.blueprints.forEach(blueprint => { + blueprint.version = this.findBlueprintVersion(blueprint.name) || 'latest'; + }); + // Remove potential previous value to avoid duplicates - this.otherModules = this.otherModules.filter(module => module.name !== this.blueprint); - this.otherModules.push({ name: this.blueprint, version: this.blueprintVersion || 'latest' }); + this.otherModules = this.otherModules.filter(module => this.blueprints.findIndex(bp => bp.name === module.name) === -1); + this.otherModules.push(...this.blueprints); } this.testFrameworks = this.config.get('testFrameworks'); this.enableTranslation = this.config.get('enableTranslation'); @@ -409,7 +434,7 @@ module.exports = class extends BaseGenerator { config.nativeLanguage = this.nativeLanguage; config.languages = this.languages; } - this.blueprint && (config.blueprint = this.blueprint); + this.blueprints && (config.blueprints = this.blueprints); this.blueprintVersion && (config.blueprintVersion = this.blueprintVersion); this.reactive && (config.reactive = this.reactive); this.skipClient && (config.skipClient = true); @@ -492,11 +517,11 @@ module.exports = class extends BaseGenerator { if (code === 0 && this.gitInitialized) { this.gitExec('add -A', { trace: false }, () => { let commitMsg = `Initial application generated by JHipster-${this.jhipsterVersion}`; - if (this.blueprint) { - commitMsg += ` with blueprint: ${this.blueprint.replace('generator-jhipster-', '')}`; - if (this.blueprintVersion) { - commitMsg += `-${this.blueprintVersion}`; - } + if (this.blueprints && this.blueprints.length > 0) { + const bpInfo = this.blueprints + .map(bp => `${bp.name.replace('generator-jhipster-', '')}-${bp.version}`) + .join(', '); + commitMsg += ` with blueprints: ${bpInfo}`; } this.gitExec(`commit -am "${commitMsg}"`, { trace: false }, () => { this.log(chalk.green.bold('Application successfully committed to Git.')); diff --git a/generators/cleanup.js b/generators/cleanup.js index d629760f2866..33bf41b9aecd 100644 --- a/generators/cleanup.js +++ b/generators/cleanup.js @@ -190,4 +190,8 @@ function cleanupOldServerFiles(generator, javaDir, testDir, mainResourceDir, tes generator.removeFolder(`${CLIENT_MAIN_SRC_DIR}app/shared/layout/header/menus`); generator.removeFolder(`${CLIENT_TEST_SRC_DIR}spec/app/shared/layout/header/menus`); } + if (generator.isJhipsterVersionLessThan('6.1.0')) { + generator.config.delete('blueprint'); + generator.config.delete('blueprintVersion'); + } } diff --git a/generators/client/index.js b/generators/client/index.js index 72ef33a0915e..fbe8f50a5b66 100644 --- a/generators/client/index.js +++ b/generators/client/index.js @@ -27,7 +27,7 @@ const packagejs = require('../../package.json'); const constants = require('../generator-constants'); const statistics = require('../statistics'); -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -62,16 +62,8 @@ module.exports = class extends BaseBlueprintGenerator { }); this.setupClientOptions(this); - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - // use global variable since getters dont have access to instance property - if (!opts.fromBlueprint) { - useBlueprint = this.composeBlueprint(blueprint, 'client', { - ...this.options, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('client'); } // Public API method used by the getter and also by Blueprints @@ -178,7 +170,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -201,7 +193,7 @@ module.exports = class extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -273,7 +265,7 @@ module.exports = class extends BaseBlueprintGenerator { } get configuring() { - if (useBlueprint) return; + if (useBlueprints) return; return this._configuring(); } @@ -357,7 +349,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -368,16 +360,16 @@ module.exports = class extends BaseBlueprintGenerator { if (this.skipClient) return; switch (this.clientFramework) { case 'react': - return writeReactFiles.call(this, useBlueprint); + return writeReactFiles.call(this, useBlueprints); default: - return writeAngularFiles.call(this, useBlueprint); + return writeAngularFiles.call(this, useBlueprints); } } }; } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } @@ -409,7 +401,7 @@ module.exports = class extends BaseBlueprintGenerator { } get install() { - if (useBlueprint) return; + if (useBlueprints) return; return this._install(); } @@ -431,7 +423,7 @@ module.exports = class extends BaseBlueprintGenerator { } get end() { - if (useBlueprint) return; + if (useBlueprints) return; return this._end(); } }; diff --git a/generators/common/index.js b/generators/common/index.js index 5819d3b34505..93f2a8f3c98b 100644 --- a/generators/common/index.js +++ b/generators/common/index.js @@ -22,7 +22,7 @@ const writeFiles = require('./files').writeFiles; const prettierConfigFiles = require('./files').prettierConfigFiles; const constants = require('../generator-constants'); -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -38,17 +38,8 @@ module.exports = class extends BaseBlueprintGenerator { this.setupServerOptions(this); this.setupClientOptions(this); - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'common', { - ...this.options, - 'client-hook': !this.skipClient, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('common', { 'client-hook': !this.skipClient }); } // Public API method used by the getter and also by Blueprints @@ -76,7 +67,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -100,7 +91,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -110,7 +101,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/entity-client/index.js b/generators/entity-client/index.js index 0f7959cce330..dda20aac8f36 100644 --- a/generators/entity-client/index.js +++ b/generators/entity-client/index.js @@ -22,7 +22,7 @@ const writeFiles = require('./files').writeFiles; const utils = require('../utils'); const BaseBlueprintGenerator = require('../generator-base-blueprint'); -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -30,18 +30,10 @@ module.exports = class extends BaseBlueprintGenerator { utils.copyObjectProps(this, opts.context); this.jhipsterContext = opts.jhipsterContext || opts.context; this.configOptions = opts.configOptions || {}; - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'entity-client', { - ...this.options, - context: opts.context, - debug: opts.context.isDebugEnabled, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = + !opts.fromBlueprint && + this.instantiateBlueprints('entity-client', { context: opts.context, debug: opts.context.isDebugEnabled }); } // Public API method used by the getter and also by Blueprints @@ -50,7 +42,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } @@ -67,7 +59,7 @@ module.exports = class extends BaseBlueprintGenerator { } get end() { - if (useBlueprint) return; + if (useBlueprints) return; return this._end(); } }; diff --git a/generators/entity-i18n/index.js b/generators/entity-i18n/index.js index 939bdddbc376..1e30bd026c38 100644 --- a/generators/entity-i18n/index.js +++ b/generators/entity-i18n/index.js @@ -22,7 +22,7 @@ const utils = require('../utils'); const BaseBlueprintGenerator = require('../generator-base-blueprint'); /* constants used throughout */ -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -30,18 +30,9 @@ module.exports = class extends BaseBlueprintGenerator { utils.copyObjectProps(this, opts.context); this.jhipsterContext = opts.jhipsterContext || opts.context; this.configOptions = opts.configOptions || {}; - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'entity-i18n', { - ...this.options, - context: opts.context, - debug: opts.context.isDebugEnabled, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = + !opts.fromBlueprint && this.instantiateBlueprints('entity-i18n', { context: opts.context, debug: opts.context.isDebugEnabled }); } // Public API method used by the getter and also by Blueprints @@ -50,7 +41,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/entity-server/index.js b/generators/entity-server/index.js index 75a731872226..9bd887c8ae95 100644 --- a/generators/entity-server/index.js +++ b/generators/entity-server/index.js @@ -22,7 +22,7 @@ const utils = require('../utils'); const BaseBlueprintGenerator = require('../generator-base-blueprint'); /* constants used throughout */ -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -33,18 +33,10 @@ module.exports = class extends BaseBlueprintGenerator { if (this.databaseType === 'cassandra') { this.pkType = 'UUID'; } - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'entity-server', { - ...this.options, - context: opts.context, - debug: opts.context.isDebugEnabled, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = + !opts.fromBlueprint && + this.instantiateBlueprints('entity-server', { context: opts.context, debug: opts.context.isDebugEnabled }); } // Public API method used by the getter and also by Blueprints @@ -53,7 +45,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/entity/index.js b/generators/entity/index.js index 940c5eaf9ea6..ef97e2dee687 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -29,7 +29,7 @@ const statistics = require('../statistics'); /* constants used throughout */ const SUPPORTED_VALIDATION_RULES = constants.SUPPORTED_VALIDATION_RULES; -let useBlueprint; +let useBlueprints; class EntityGenerator extends BaseBlueprintGenerator { constructor(args, opts) { @@ -124,17 +124,8 @@ class EntityGenerator extends BaseBlueprintGenerator { this.setupEntityOptions(this, this, this.context); this.registerPrettierTransform(); - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'entity', { - ...this.options, - configOptions: this.configOptions, - arguments: [this.context.name] - }); - } else { - useBlueprint = false; - } + + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('entity', { arguments: [this.context.name] }); } // Public API method used by the getter and also by Blueprints @@ -336,7 +327,7 @@ class EntityGenerator extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -360,7 +351,7 @@ class EntityGenerator extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -1088,7 +1079,7 @@ class EntityGenerator extends BaseBlueprintGenerator { } get configuring() { - if (useBlueprint) return; + if (useBlueprints) return; return this._configuring(); } @@ -1146,7 +1137,7 @@ class EntityGenerator extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } @@ -1185,7 +1176,7 @@ class EntityGenerator extends BaseBlueprintGenerator { } get install() { - if (useBlueprint) return; + if (useBlueprints) return; return this._install(); } } diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index fc3c10e14462..2273674b86da 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -759,6 +759,42 @@ module.exports = class extends Generator { } } + /** + * Instantiates the blueprint generators, if any. + * @param {string} subGen - sub generator + * @param {any} extraOptions - extra options to pass to blueprint generator + * @return {true} useBlueprints - true if one or more blueprints generators have been constructed; false otherwise + */ + instantiateBlueprints(subGen, extraOptions) { + let useBlueprints = false; + + const blueprints = jhipsterUtils.parseBluePrints( + this.options.blueprints || + this.configOptions.blueprints || + this.config.get('blueprints') || + this.options.blueprint || + this.configOptions.blueprint || + this.config.get('blueprint') + ); + if (blueprints && blueprints.length > 0) { + blueprints.forEach(blueprint => { + let bpOptions = { + ...this.options, + configOptions: this.configOptions + }; + if (extraOptions) { + bpOptions = { ...bpOptions, ...extraOptions }; + } + const useBP = this.composeBlueprint(blueprint.name, subGen, bpOptions); + // use global variable since getters dont have access to instance property + if (!useBlueprints && useBP) { + useBlueprints = true; + } + }); + } + return useBlueprints; + } + /** * Compose external blueprint module * @param {string} blueprint - name of the blueprint diff --git a/generators/languages/index.js b/generators/languages/index.js index a89a10722706..cf20ec88dd11 100644 --- a/generators/languages/index.js +++ b/generators/languages/index.js @@ -25,7 +25,7 @@ const statistics = require('../statistics'); const constants = require('../generator-constants'); -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -78,18 +78,10 @@ module.exports = class extends BaseBlueprintGenerator { } }); } - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - // use global variable since getters dont have access to instance property - if (!opts.fromBlueprint) { - useBlueprint = this.composeBlueprint(blueprint, 'languages', { - ...this.options, - languages: this.languages, - configOptions: this.configOptions, - arguments: this.options.languages - }); - } else { - useBlueprint = false; - } + + useBlueprints = + !opts.fromBlueprint && + this.instantiateBlueprints('languages', { languages: this.languages, arguments: this.options.languages }); } // Public API method used by the getter and also by Blueprints @@ -134,7 +126,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -146,7 +138,7 @@ module.exports = class extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -163,7 +155,7 @@ module.exports = class extends BaseBlueprintGenerator { } get configuring() { - if (useBlueprint) return; + if (useBlueprints) return; return this._configuring(); } @@ -212,7 +204,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -250,7 +242,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/server/index.js b/generators/server/index.js index 6fb4403a2bb1..01ad39bbdde7 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -28,7 +28,7 @@ const constants = require('../generator-constants'); const statistics = require('../statistics'); const { getBase64Secret, getRandomHex } = require('../utils'); -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -59,17 +59,9 @@ module.exports = class extends BaseBlueprintGenerator { this.uaaBaseName = this.options.uaaBaseName || this.configOptions.uaaBaseName || this.config.get('uaaBaseName'); this.setupServerOptions(this); - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'server', { - ...this.options, - 'client-hook': !this.skipClient, - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('server', { 'client-hook': !this.skipClient }); + this.registerPrettierTransform(); } @@ -298,7 +290,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -338,7 +330,7 @@ module.exports = class extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -417,7 +409,7 @@ module.exports = class extends BaseBlueprintGenerator { } get configuring() { - if (useBlueprint) return; + if (useBlueprints) return; return this._configuring(); } @@ -460,7 +452,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -470,7 +462,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } @@ -493,7 +485,7 @@ module.exports = class extends BaseBlueprintGenerator { } get install() { - if (useBlueprint) return; + if (useBlueprints) return; return this._install(); } @@ -525,7 +517,7 @@ module.exports = class extends BaseBlueprintGenerator { } get end() { - if (useBlueprint) return; + if (useBlueprints) return; return this._end(); } }; diff --git a/generators/spring-controller/index.js b/generators/spring-controller/index.js index 844cda883855..cba7daa76a7a 100644 --- a/generators/spring-controller/index.js +++ b/generators/spring-controller/index.js @@ -27,7 +27,7 @@ const statistics = require('../statistics'); const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR; const SERVER_TEST_SRC_DIR = constants.SERVER_TEST_SRC_DIR; -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { @@ -48,17 +48,7 @@ module.exports = class extends BaseBlueprintGenerator { }); this.defaultOption = this.options.default; - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'spring-controller', { - ...this.options, - arguments: [this.name], - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('spring-controller', { arguments: [this.name] }); } // Public API method used by the getter and also by Blueprints @@ -89,7 +79,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -101,7 +91,7 @@ module.exports = class extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -115,7 +105,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -178,7 +168,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/spring-service/index.js b/generators/spring-service/index.js index c6006593737e..08e3e19b0de4 100644 --- a/generators/spring-service/index.js +++ b/generators/spring-service/index.js @@ -24,7 +24,7 @@ const statistics = require('../statistics'); const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR; -let useBlueprint; +let useBlueprints; module.exports = class extends BaseBlueprintGenerator { constructor(args, opts) { super(args, opts); @@ -44,17 +44,7 @@ module.exports = class extends BaseBlueprintGenerator { }); this.defaultOption = this.options.default; - const blueprint = this.options.blueprint || this.configOptions.blueprint || this.config.get('blueprint'); - if (!opts.fromBlueprint) { - // use global variable since getters dont have access to instance property - useBlueprint = this.composeBlueprint(blueprint, 'spring-service', { - ...this.options, - arguments: [this.name], - configOptions: this.configOptions - }); - } else { - useBlueprint = false; - } + useBlueprints = !opts.fromBlueprint && this.instantiateBlueprints('spring-service', { arguments: [this.name] }); } // Public API method used by the getter and also by Blueprints @@ -76,7 +66,7 @@ module.exports = class extends BaseBlueprintGenerator { } get initializing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._initializing(); } @@ -106,7 +96,7 @@ module.exports = class extends BaseBlueprintGenerator { } get prompting() { - if (useBlueprint) return; + if (useBlueprints) return; return this._prompting(); } @@ -120,7 +110,7 @@ module.exports = class extends BaseBlueprintGenerator { } get default() { - if (useBlueprint) return; + if (useBlueprints) return; return this._default(); } @@ -149,7 +139,7 @@ module.exports = class extends BaseBlueprintGenerator { } get writing() { - if (useBlueprint) return; + if (useBlueprints) return; return this._writing(); } }; diff --git a/generators/upgrade/index.js b/generators/upgrade/index.js index 03ada0425b49..6fb25df7c40c 100644 --- a/generators/upgrade/index.js +++ b/generators/upgrade/index.js @@ -25,6 +25,7 @@ const gitignore = require('parse-gitignore'); const BaseGenerator = require('../generator-base'); const constants = require('../generator-constants'); const statistics = require('../statistics'); +const utils = require('../utils'); /* Constants used throughout */ const GENERATOR_JHIPSTER = 'generator-jhipster'; @@ -48,9 +49,9 @@ module.exports = class extends BaseGenerator { desc: 'Upgrade to a specific version instead of the latest', type: String }); - // This adds support for a `--target-blueprint-version` flag - this.option('target-blueprint-version', { - desc: 'Upgrade to a specific blueprint version instead of the latest', + // This adds support for a `--target-blueprint-versions` flag + this.option('target-blueprint-versions', { + desc: 'Upgrade to specific blueprint versions instead of the latest', type: String }); @@ -69,7 +70,7 @@ module.exports = class extends BaseGenerator { }); this.targetJhipsterVersion = this.options['target-version']; - this.targetBlueprintVersion = this.options['target-blueprint-version']; + this.targetBlueprintVersions = utils.parseBluePrints(this.options['target-blueprint-versions']); this.skipInstall = this.options['skip-install']; this.silent = this.options.silent; } @@ -88,8 +89,7 @@ module.exports = class extends BaseGenerator { loadConfig() { this.config = this.getAllJhipsterConfig(this, true); this.currentJhipsterVersion = this.config.get('jhipsterVersion'); - this.blueprint = this.config.get('blueprint'); - this.currentBlueprintVersion = this.config.get('blueprintVersion'); + this.blueprints = utils.loadBlueprintsFromConfiguration(this); this.clientPackageManager = this.config.get('clientPackageManager'); this.clientFramework = this.config.get('clientFramework'); } @@ -116,8 +116,7 @@ module.exports = class extends BaseGenerator { this.success('Cleaned up project directory'); } - _generate(jhipsterVersion, blueprintVersion, callback) { - const blueprintInfo = this.blueprint ? ` and ${this.blueprint} ${blueprintVersion}` : ''; + _generate(jhipsterVersion, blueprintInfo, callback) { this.log(`Regenerating application with JHipster ${jhipsterVersion}${blueprintInfo}...`); let generatorCommand = 'yo jhipster'; if (semver.gte(jhipsterVersion, FIRST_CLI_SUPPORTED_VERSION)) { @@ -154,12 +153,11 @@ module.exports = class extends BaseGenerator { }); } - _regenerate(jhipsterVersion, blueprintVersion, callback) { - this._generate(jhipsterVersion, blueprintVersion, () => { + _regenerate(jhipsterVersion, blueprintInfo, callback) { + this._generate(jhipsterVersion, blueprintInfo, () => { const keystore = `${SERVER_MAIN_RES_DIR}config/tls/keystore.p12`; this.info(`Removing ${keystore}`); shelljs.rm('-Rf', keystore); - const blueprintInfo = this.blueprint ? ` and ${this.blueprint} ${blueprintVersion}` : ''; this._gitCommitAll(`Generated with JHipster ${jhipsterVersion}${blueprintInfo}`, () => { callback(); }); @@ -211,34 +209,58 @@ module.exports = class extends BaseGenerator { }); }, - checkLatestBlueprintVersion() { - if (!this.blueprint) { - this.log('No blueprint detected, skipping check of last blueprint version'); - return; - } - if (!this.currentBlueprintVersion) { - this.error('No blueprintVersion defined in .yo-rc.json, unable to upgrade'); - } - if (this.targetBlueprintVersion) { - this.log(`Upgrading to the target blueprint version: ${this.targetBlueprintVersion}`); - this.latestBlueprintVersion = this.targetBlueprintVersion; + checkLatestBlueprintVersions() { + if (!this.blueprints || this.blueprints.length < 0) { + this.log('No blueprints detected, skipping check of last blueprint version'); return; } + + this.success('Checking for new blueprint versions'); const done = this.async(); - this._retrieveLatestVersion(this.blueprint, latestVersion => { - this.latestBlueprintVersion = latestVersion; - if (semver.lt(this.currentBlueprintVersion, this.latestBlueprintVersion)) { - this.newBlueprintVersionFound = true; - this.success(`New ${this.blueprint} version found: ${this.latestBlueprintVersion}`); - } else if (this.force) { - this.newBlueprintVersionFound = true; - this.log(chalk.yellow('Forced re-generation')); - } else { - this.newBlueprintVersionFound = false; - this.warning( - `${chalk.green('No update available.')} Application has already been generated with latest blueprint version.` - ); - } + Promise.all( + this.blueprints + .filter(blueprint => { + if (this.targetBlueprintVersions && this.targetBlueprintVersions.length > 0) { + const targetBlueprint = this.targetBlueprintVersions.find(elem => { + return elem.name === blueprint.name; + }); + if (targetBlueprint && targetBlueprint.version && targetBlueprint.version !== 'latest') { + this.log( + `Blueprint ${targetBlueprint.name} will be upgraded to target version: ${targetBlueprint.version}` + ); + blueprint.latestBlueprintVersion = targetBlueprint.version; + return false; + } + } + return true; + }) + .map(blueprint => { + return new Promise(resolve => { + this._retrieveLatestVersion(blueprint.name, latestVersion => { + blueprint.latestBlueprintVersion = latestVersion; + if (semver.lt(blueprint.version, blueprint.latestBlueprintVersion)) { + this.newBlueprintVersionFound = true; + this.success(`New ${blueprint.name} version found: ${this.latestBlueprintVersion}`); + } else if (this.force) { + this.newBlueprintVersionFound = true; + this.log(chalk.yellow('Forced re-generation')); + } else { + if (this.newBlueprintVersionFound === undefined) { + this.newBlueprintVersionFound = false; + } + this.warning( + `${chalk.green( + 'No update available.' + )} Application has already been generated with latest version for blueprint: ${blueprint.name}` + ); + } + this.success(`Done checking for new version for blueprint ${blueprint.name}`); + resolve(); + }); + }); + }) + ).then(() => { + this.success('Done checking for new blueprint versions'); done(); }); }, @@ -339,20 +361,38 @@ module.exports = class extends BaseGenerator { this._installNpmPackageLocally(GENERATOR_JHIPSTER, version, callback); }; - const installBlueprintLocally = (version, callback) => { - if (!this.blueprint) { + const installBlueprintsLocally = callback => { + if (!this.blueprints || this.blueprints.length < 1) { this.log('Skipping local blueprint installation since no blueprint has been detected'); callback(); return; } - this._installNpmPackageLocally(this.blueprint, version, callback); + + this.success('Installing blueprints locally...'); + Promise.all( + this.blueprints.map(blueprint => { + return new Promise(resolve => { + this._installNpmPackageLocally(blueprint.name, blueprint.version, () => { + this.success(`Done installing blueprint: ${blueprint.name}@${blueprint.version}`); + resolve(); + }); + }); + }) + ).then(() => { + this.success('Done installing blueprints locally'); + callback(); + }); }; const regenerate = () => { this._cleanUp(); installJhipsterLocally(this.currentJhipsterVersion, () => { - installBlueprintLocally(this.currentBlueprintVersion, () => { - this._regenerate(this.currentJhipsterVersion, this.currentBlueprintVersion, () => { + installBlueprintsLocally(() => { + const blueprintInfo = + this.blueprints && this.blueprints.length > 0 + ? ` and ${this.blueprints.map(bp => bp.name + bp.version).join(', ')} ` + : ''; + this._regenerate(this.currentJhipsterVersion, blueprintInfo, () => { this._gitCheckout(this.sourceBranch, () => { // consider code up-to-date recordCodeHasBeenGenerated(); @@ -394,19 +434,37 @@ module.exports = class extends BaseGenerator { this._installNpmPackageLocally(GENERATOR_JHIPSTER, this.latestJhipsterVersion, done); }, - updateBlueprint() { - if (!this.blueprint) { + updateBlueprints() { + if (!this.blueprints || this.blueprints.length < 1) { this.log('Skipping blueprint update since no blueprint has been detected'); return; } + + this.success('Upgrading blueprints...'); const done = this.async(); - this._installNpmPackageLocally(this.blueprint, this.latestBlueprintVersion, done); + Promise.all( + this.blueprints.map(blueprint => { + return new Promise(resolve => { + this._installNpmPackageLocally(blueprint.name, blueprint.latestBlueprintVersion, () => { + this.success(`Done upgrading blueprint ${blueprint.name} to version ${blueprint.latestBlueprintVersion}`); + resolve(); + }); + }); + }) + ).then(() => { + this.success('Done upgrading blueprints'); + done(); + }); }, generateWithLatestVersion() { const done = this.async(); this._cleanUp(); - this._regenerate(this.latestJhipsterVersion, this.latestBlueprintVersion, done); + + const blueprintInfo = this.blueprints + ? ` and ${this.blueprints.map(bp => bp.name + bp.latestBlueprintVersion).join(', ')} ` + : ''; + this._regenerate(this.latestJhipsterVersion, blueprintInfo, done); }, checkoutSourceBranch() { @@ -422,6 +480,7 @@ module.exports = class extends BaseGenerator { done(); }); }, + checkConflictsInPackageJson() { const done = this.async(); this.gitExec(['diff', '--name-only', '--diff-filter=U', 'package.json'], { silent: this.silent }, (code, msg, err) => { diff --git a/generators/utils.js b/generators/utils.js index c632130b3553..840e642d154a 100644 --- a/generators/utils.js +++ b/generators/utils.js @@ -47,6 +47,8 @@ module.exports = { getBase64Secret, getRandomHex, checkStringInFile, + loadBlueprintsFromConfiguration, + parseBluePrints, normalizeBlueprintName }; @@ -422,9 +424,21 @@ function getAllJhipsterConfig(generator, force, basePath = '') { if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist(filePath)) { const yoRc = JSON.parse(fs.readFileSync(filePath, { encoding: 'utf-8' })); configuration = yoRc['generator-jhipster']; - // merge the blueprint config if available - if (configuration.blueprint) { - configuration = { ...configuration, ...yoRc[configuration.blueprint] }; + + // merge the blueprint configs if available + const oldBlueprintName = configuration.blueprint; + const blueprints = configuration.blueprints || []; + if (oldBlueprintName && blueprints.indexOf(oldBlueprintName) === -1) { + const oldBlueprintVersion = configuration.blueprintVersion || 'latest'; + blueprints.push({ + name: oldBlueprintName, + version: oldBlueprintVersion + }); + } + const blueprintConfigs = blueprints.map(bp => yoRc[bp.name]).filter(el => el !== null && el !== undefined); + if (blueprintConfigs.length > 0) { + const mergedConfigs = Object.assign(...blueprintConfigs); + configuration = { ...configuration, ...mergedConfigs }; } } if (!configuration.get || typeof configuration.get !== 'function') { @@ -472,9 +486,63 @@ function checkStringInFile(path, search, generator) { return fileContent.includes(search); } +/** + * Loads the blueprint information from the configuration of the specified generator. + * @param config - the generator's configuration object. + * @returns {Array} an array that contains the info for each blueprint + */ +function loadBlueprintsFromConfiguration(generator) { + // load blueprints from config file + const blueprints = generator.config.get('blueprints') || []; + + const oldBlueprintName = generator.config.get('blueprint'); + if (oldBlueprintName) { + const version = generator.config.get('blueprintVersion') || 'latest'; + blueprints.push(parseBlueprintInfo(`${oldBlueprintName}@${version}`)); + } + return blueprints; +} + +/** + * Splits and normalizes a comma separated list of blueprint names with optional versions. + * @param {string} blueprints - comma separated list of blueprint names, e.g kotlin,vuewjs@1.0.1. If an array then + * no processing is performed and it is returned as is. + * @returns {Array} an array that contains the info for each blueprint + */ +function parseBluePrints(blueprints) { + if (blueprints && !Array.isArray(blueprints)) { + return blueprints + .split(',') + .filter(el => el != null && el.length > 0) + .map(blueprint => parseBlueprintInfo(blueprint)); + } + return blueprints; +} + +/** + * Normalize blueprint name if needed and also extracts version if defined. If no version is defined then `latest` + * is used by default. + * @param {string} blueprint - name of the blueprint and optionally a version, e.g kotlin[@0.8.1] + * @returns {object} containing the name and version of the blueprint + */ +function parseBlueprintInfo(blueprint) { + let bpName = normalizeBlueprintName(blueprint); + let version = 'latest'; + const idx = bpName.lastIndexOf('@'); + if (idx > 0) { + version = bpName.slice(idx + 1); + bpName = bpName.slice(0, idx); + } + return { + name: bpName, + version + }; +} + /** * Normalize blueprint name: prepend 'generator-jhipster-' if needed * @param {string} blueprint - name of the blueprint + * @returns {string} the normalized blueprint name */ function normalizeBlueprintName(blueprint) { if (blueprint && blueprint.startsWith('@')) { diff --git a/test/blueprint/app-blueprint.spec.js b/test/blueprint/app-blueprint.spec.js index 2ceeda46fced..14af72380386 100644 --- a/test/blueprint/app-blueprint.spec.js +++ b/test/blueprint/app-blueprint.spec.js @@ -60,7 +60,9 @@ describe('JHipster application generator with blueprint', () => { }); it('blueprint version is saved in .yo-rc.json', () => { - assert.fileContent('.yo-rc.json', /"blueprintVersion": "9.9.9"/); + assert.JSONFileContent('.yo-rc.json', { + 'generator-jhipster': { blueprints: [{ name: 'generator-jhipster-myblueprint', version: '9.9.9' }] } + }); }); it('blueprint module and version are in package.json', () => { assert.fileContent('package.json', /"generator-jhipster-myblueprint": "9.9.9"/); diff --git a/test/blueprint/multiple-blueprints.spec.js b/test/blueprint/multiple-blueprints.spec.js new file mode 100644 index 000000000000..aa3b178c5914 --- /dev/null +++ b/test/blueprint/multiple-blueprints.spec.js @@ -0,0 +1,162 @@ +const path = require('path'); +const assert = require('yeoman-assert'); +const helpers = require('yeoman-test'); +const expectedFiles = require('../utils/expected-files'); +const ClientGenerator = require('../../generators/client'); +const ServerGenerator = require('../../generators/server'); + +const mockClientBlueprintSubGen = class extends ClientGenerator { + constructor(args, opts) { + super(args, Object.assign({ fromBlueprint: true }, opts)); // fromBlueprint variable is important + } + + get initializing() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._initializing(); + } + + get prompting() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._prompting(); + } + + get configuring() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._configuring(); + } + + get default() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._default(); + } + + get writing() { + const phaseFromJHipster = super._writing(); + const customPhaseSteps = { + addDummyProperty() { + this.addNpmDependency('dummy-blueprint-property', '2.0'); + } + }; + return { + ...phaseFromJHipster, + ...customPhaseSteps + }; + } + + get install() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._install(); + } + + get end() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._end(); + } +}; + +const mockServerBlueprintSubGen = class extends ServerGenerator { + constructor(args, opts) { + super(args, Object.assign({ fromBlueprint: true }, opts)); // fromBlueprint variable is important + } + + get initializing() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._initializing(); + } + + get writing() { + const phaseFromJHipster = super._writing(); + const customPhaseSteps = { + addDummyProperty() { + this.addMavenProperty('dummy-blueprint-property', 'foo'); + } + }; + return { + ...phaseFromJHipster, + ...customPhaseSteps + }; + } + + get prompting() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._prompting(); + } + + get configuring() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._configuring(); + } + + get default() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._default(); + } + + get install() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._install(); + } + + get end() { + // Here we are not overriding this phase and hence its being handled by JHipster + return super._end(); + } +}; + +describe('JHipster entity generator with multiple blueprints', () => { + const blueprintNames = [ + 'generator-jhipster-my-client-blueprint,generator-jhipster-my-server-blueprint', + 'my-client-blueprint,my-server-blueprint' + ]; + + blueprintNames.forEach(blueprints => { + describe(`generate entity with multiple blueprints option '${blueprints}'`, () => { + before(done => { + helpers + .run(path.join(__dirname, '../../generators/app')) + .withOptions({ + 'from-cli': true, + skipInstall: true, + skipChecks: true, + blueprints + }) + .withGenerators([ + [mockClientBlueprintSubGen, 'jhipster-my-client-blueprint:client'], + [mockServerBlueprintSubGen, 'jhipster-my-server-blueprint:server'] + ]) + .withPrompts({ + baseName: 'jhipster', + clientFramework: 'angularX', + packageName: 'com.mycompany.myapp', + packageFolder: 'com/mycompany/myapp', + serviceDiscoveryType: false, + authenticationType: 'jwt', + cacheProvider: 'ehcache', + enableHibernateCache: true, + databaseType: 'sql', + devDatabaseType: 'h2Memory', + prodDatabaseType: 'mysql', + enableTranslation: true, + nativeLanguage: 'en', + languages: ['fr'] + }) + .on('end', done); + }); + + it('creates expected files from jhipster app generator', () => { + assert.file(expectedFiles.common); + assert.file(expectedFiles.server); + assert.file(expectedFiles.maven); + assert.file(expectedFiles.client); + }); + + it('contains the specific change added by the client blueprint', () => { + assert.fileContent('package.json', /dummy-blueprint-property/); + }); + + it('contains the specific change added by the server blueprint', () => { + assert.fileContent('pom.xml', /dummy-blueprint-property/); + }); + }); + }); +}); diff --git a/test/blueprint/scoped-blueprint.spec.js b/test/blueprint/scoped-blueprint.spec.js index 1f1f0f3e2fef..fca3d75cafdc 100644 --- a/test/blueprint/scoped-blueprint.spec.js +++ b/test/blueprint/scoped-blueprint.spec.js @@ -60,7 +60,9 @@ describe('JHipster application generator with scoped blueprint', () => { }); it('blueprint version is saved in .yo-rc.json', () => { - assert.fileContent('.yo-rc.json', /"blueprintVersion": "9.9.9"/); + assert.JSONFileContent('.yo-rc.json', { + 'generator-jhipster': { blueprints: [{ name: '@jhipster/generator-jhipster-scoped-blueprint', version: '9.9.9' }] } + }); }); it('blueprint module and version are in package.json', () => { assert.fileContent('package.json', /"@jhipster\/generator-jhipster-scoped-blueprint": "9.9.9"/); diff --git a/test/cli/cli.spec.js b/test/cli/cli.spec.js index eb1e1169f50b..445d08894b94 100644 --- a/test/cli/cli.spec.js +++ b/test/cli/cli.spec.js @@ -45,8 +45,23 @@ describe('jhipster cli test', () => { expect(error).to.not.be.null; expect(error.code).to.equal(1); /* eslint-disable prettier/prettier */ - expect(stdout.includes('No custom command found within blueprint')).to.be.true; - expect(stderr.includes('is not a known command')).to.be.true; + expect(stdout.includes('No custom commands found within blueprint: generator-jhipster-bar')).to.be.true; + expect(stderr.includes('foo is not a known command')).to.be.true; + done(); + }); + }); + + it('should delegate to blueprint on multiple blueprints command but will not find it', function(done) { + this.timeout(4000); + + exec(`${cmd} foo --blueprints bar,baz`, (error, stdout, stderr) => { + console.log(error); + expect(error).to.not.be.null; + expect(error.code).to.equal(1); + /* eslint-disable prettier/prettier */ + expect(stdout.includes('No custom commands found within blueprint: generator-jhipster-bar')).to.be.true; + expect(stdout.includes('No custom commands found within blueprint: generator-jhipster-baz')).to.be.true; + expect(stderr.includes('foo is not a known command')).to.be.true; done(); }); }); diff --git a/test/upgrade.spec.js b/test/upgrade.spec.js index 7ca02ef77049..40159ba87a55 100644 --- a/test/upgrade.spec.js +++ b/test/upgrade.spec.js @@ -164,8 +164,9 @@ describe('JHipster upgrade generator', function() { }); it('still contains blueprint information', () => { - assert.fileContent('.yo-rc.json', new RegExp(`"blueprint": "${blueprintName}"`)); - assert.fileContent('.yo-rc.json', new RegExp(`"blueprintVersion": "${blueprintVersion}"`)); + assert.JSONFileContent('.yo-rc.json', { + 'generator-jhipster': { blueprints: [{ name: blueprintName, version: blueprintVersion }] } + }); assert.fileContent('package.json', new RegExp(`"${blueprintName}": "${blueprintVersion}"`)); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index 4fbb273e70bf..eafc5b106f0c 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -75,6 +75,37 @@ describe('JHipster Utils', () => { }); }); }); + describe('::parseBluePrints', () => { + it('does nothing if an array', () => { + const expected = [{ name: 'generator-jhipster-foo', version: 'latest' }]; + const actual = utils.parseBluePrints(expected); + assert.deepStrictEqual(actual, expected); + }); + it('adds generator-jhipster prefix if it is absent', () => { + const expected = [{ name: 'generator-jhipster-foo', version: 'latest' }]; + const actual = utils.parseBluePrints('foo'); + assert.deepStrictEqual(actual, expected); + }); + it('keeps generator-jhipster prefix if it is present', () => { + const expected = [{ name: 'generator-jhipster-foo', version: '1.0.1' }]; + const actual = utils.parseBluePrints('generator-jhipster-foo@1.0.1'); + assert.deepStrictEqual(actual, expected); + }); + it("doesn't modify scoped package and extracts version", () => { + const expected = [{ name: '@corp/foo', version: '1.0.1' }]; + const actual = utils.parseBluePrints('@corp/foo@1.0.1'); + assert.deepStrictEqual(actual, expected); + }); + it('parses comma separated list', () => { + const expected = [ + { name: 'generator-jhipster-foo', version: 'latest' }, + { name: 'generator-jhipster-bar', version: '1.0.1' }, + { name: '@corp/foo', version: 'latest' } + ]; + const actual = utils.parseBluePrints('foo,bar@1.0.1,@corp/foo'); + assert.deepStrictEqual(actual, expected); + }); + }); describe('::normalizeBlueprintName', () => { it('adds generator-jhipster prefix if it is absent', () => { const generatorName = utils.normalizeBlueprintName('foo'); From a42df1e6155b2bf2388eb013c898f656e840b18a Mon Sep 17 00:00:00 2001 From: charliemordant Date: Sun, 30 Jun 2019 14:33:04 +0200 Subject: [PATCH 234/298] token exception logging --- .../package/security/oauth2/AuthorizationHeaderUtil.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index f6136ae7a3f5..2c5efed21b78 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -137,7 +137,7 @@ public class AuthorizationHeaderUtil { ResponseEntity responseEntity = r.exchange(requestEntity, OAuthIdpTokenResponseDTO.class); return toOAuth2AccessTokenResponse(responseEntity.getBody()); } catch (OAuth2AuthorizationException e) { - log.error("Unable to refresh token ${e.getError().getErrorCode()}"); + log.error("Unable to refresh token", e); throw new OAuth2AuthenticationException(e.getError(), e); } } From 9cb978bb50a8f4879d1f7e0f7df29f4ae9b6a0b6 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sun, 30 Jun 2019 17:27:18 +0200 Subject: [PATCH 235/298] No records found message should be plural --- generators/entity-i18n/templates/i18n/entity_al.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_bn.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_by.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ca.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_cs.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_da.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_de.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_el.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_en.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_es.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_et.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_fa.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_gl.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_hi.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_hu.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_hy.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_in.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_it.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ja.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ko.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_mr.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_my.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_nl.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_pl.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ro.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ru.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_sk.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_sr.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_sv.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ta.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_te.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_th.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_tr.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_ua.json.ejs | 2 +- .../entity-i18n/templates/i18n/entity_uz-Cyrl-uz.json.ejs | 2 +- .../entity-i18n/templates/i18n/entity_uz-Latn-uz.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_vi.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs | 2 +- generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/generators/entity-i18n/templates/i18n/entity_al.json.ejs b/generators/entity-i18n/templates/i18n/entity_al.json.ejs index 53b8250f21b6..3acabbb00c5a 100644 --- a/generators/entity-i18n/templates/i18n/entity_al.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_al.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Krijo një të ri <%= entityClassHumanized %>", "createOrEditLabel": "Krijo ose përpuno një <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Kërko për <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Një <%= entityClassHumanized %> i ri u krijua me identifikues {{ param }}", "updated": "Një <%= entityClassHumanized %> u përpunua me identifikues {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs b/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs index ad3a44786cf0..f5332bce9d04 100644 --- a/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ar-ly.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_bn.json.ejs b/generators/entity-i18n/templates/i18n/entity_bn.json.ejs index ad3a44786cf0..f5332bce9d04 100644 --- a/generators/entity-i18n/templates/i18n/entity_bn.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_bn.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_by.json.ejs b/generators/entity-i18n/templates/i18n/entity_by.json.ejs index 9b175ce6e234..1f1eae83edc9 100644 --- a/generators/entity-i18n/templates/i18n/entity_by.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_by.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Стварыць новы <%= entityClassHumanized %>", "createOrEditLabel": "Стварыць або адрэдагаваць <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Знайсці <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новы <%= entityClassHumanized %> створан з ідэнтыфікатарам {{ param }}", "updated": "<%= entityClassHumanized %> абноўлен з ідэнтыфікатарам {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ca.json.ejs b/generators/entity-i18n/templates/i18n/entity_ca.json.ejs index ad3a44786cf0..f5332bce9d04 100644 --- a/generators/entity-i18n/templates/i18n/entity_ca.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ca.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_cs.json.ejs b/generators/entity-i18n/templates/i18n/entity_cs.json.ejs index 126e8c87e61e..ab0f317d95e3 100644 --- a/generators/entity-i18n/templates/i18n/entity_cs.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_cs.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Vytvořit <%= entityClassHumanized %>", "createOrEditLabel": "Vytvořit nebo upravit <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Vyhledat <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Byl vytvořen potomek entity <%= entityClassHumanized %> s identifikátorem {{ param }}", "updated": "Potomek entity <%= entityClassHumanized %> s identifikátorem {{ param }} byl upravený.", diff --git a/generators/entity-i18n/templates/i18n/entity_da.json.ejs b/generators/entity-i18n/templates/i18n/entity_da.json.ejs index ad3a44786cf0..f5332bce9d04 100644 --- a/generators/entity-i18n/templates/i18n/entity_da.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_da.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_de.json.ejs b/generators/entity-i18n/templates/i18n/entity_de.json.ejs index 12acf5a718f3..f2c45d0d3914 100644 --- a/generators/entity-i18n/templates/i18n/entity_de.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_de.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "<%= entityClassHumanized %> erstellen", "createOrEditLabel": "<%= entityClassHumanized %> erstellen oder bearbeiten"<% if (searchEngine === 'elasticsearch') { %>, "search": "Suche nach <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> erstellt mit ID {{ param }}", "updated": "<%= entityClassHumanized %> aktualisiert mit ID {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_el.json.ejs b/generators/entity-i18n/templates/i18n/entity_el.json.ejs index 4fde7bbe9fe7..fac8ba639062 100644 --- a/generators/entity-i18n/templates/i18n/entity_el.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_el.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Δημιουργήστε ένα νέο <%= entityClassHumanized %>", "createOrEditLabel": "Δημιουργήστε η επεξεργαστείτε ένα <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Αναζήτηση για <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Ένα νέο <%= entityClassHumanized %> έχει δημιουργηθεί με αναγνωριστικό {{ param }}", "updated": "Ένα <%= entityClassHumanized %> έχει ενημερωθεί με αναγνωριστικό {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_en.json.ejs b/generators/entity-i18n/templates/i18n/entity_en.json.ejs index 10b6dfb805f6..00db0f4ddb89 100644 --- a/generators/entity-i18n/templates/i18n/entity_en.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_en.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found"<% %> + "notFound": "No <%= entityClassPluralHumanized %> found"<% %> },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_es.json.ejs b/generators/entity-i18n/templates/i18n/entity_es.json.ejs index aa40720933dc..a3ac0cd2775a 100644 --- a/generators/entity-i18n/templates/i18n/entity_es.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_es.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Crear nuevo <%= entityClassHumanized %>", "createOrEditLabel": "Crear o editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Un nuevo <%= entityClassHumanized %> ha sido creado con el identificador {{ param }}", "updated": "Un <%= entityClassHumanized %> ha sido actualizado con el identificador {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_et.json.ejs b/generators/entity-i18n/templates/i18n/entity_et.json.ejs index ef2877bcc0de..46af66ac2b69 100644 --- a/generators/entity-i18n/templates/i18n/entity_et.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_et.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Lisa uus <%= entityClassHumanized %>", "createOrEditLabel": "Lisa või muuda <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Otsi <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Uus <%= entityClassHumanized %> on loodud identifikaatoriga {{ param }}", "updated": "<%= entityClassHumanized %> identifikaatoriga {{ param }} on muudetud", diff --git a/generators/entity-i18n/templates/i18n/entity_fa.json.ejs b/generators/entity-i18n/templates/i18n/entity_fa.json.ejs index ad3a44786cf0..f5332bce9d04 100644 --- a/generators/entity-i18n/templates/i18n/entity_fa.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_fa.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_gl.json.ejs b/generators/entity-i18n/templates/i18n/entity_gl.json.ejs index 129d9e718f18..fc7d7fced39b 100644 --- a/generators/entity-i18n/templates/i18n/entity_gl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_gl.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Crear novo <%= entityClassHumanized %>", "createOrEditLabel": "Crear ou editar <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Un novo <%= entityClassHumanized %> foi creado co identificador {{ param }}", "updated": "Un <%= entityClassHumanized %> foi actualizado co identificador {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_hi.json.ejs b/generators/entity-i18n/templates/i18n/entity_hi.json.ejs index da06263c99cf..7f266e4dc091 100644 --- a/generators/entity-i18n/templates/i18n/entity_hi.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hi.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "नया <%= entityClassHumanized %> बनाएँ", "createOrEditLabel": "<%= entityClassHumanized %> बनाएँ या संपादित करें"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %> खोजें"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "एक नया <%= entityClassHumanized %> [identifier: {{ param }}] तैयार है", "updated": "एक <%= entityClassHumanized %> [identifier: {{ param }}] का अद्यतन हुआ है", diff --git a/generators/entity-i18n/templates/i18n/entity_hu.json.ejs b/generators/entity-i18n/templates/i18n/entity_hu.json.ejs index 8cb6aa9f21da..6b725e93713b 100644 --- a/generators/entity-i18n/templates/i18n/entity_hu.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hu.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Egy új <%= entityClassHumanized %> létrehozása", "createOrEditLabel": "Hozzon létre, vagy módosítson <%= entityClassHumanized %>t"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %> keresése"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Egy új <%= entityClassHumanized %> lett létrehozva {{ param }} azonosítóval", "updated": "A <%= entityClassHumanized %> módosítva lett {{ param }} azonosítóval", diff --git a/generators/entity-i18n/templates/i18n/entity_hy.json.ejs b/generators/entity-i18n/templates/i18n/entity_hy.json.ejs index 68f8dce5cf54..c7cec8dff2e1 100644 --- a/generators/entity-i18n/templates/i18n/entity_hy.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_hy.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Ստեղծել նոր <%= entityClassHumanized %>", "createOrEditLabel": "Ստեղծել կամ փոփոխել <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Գտնել <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Նոր <%= entityClassHumanized %> ստեղծված է {{ param }} նունացուցիչով", "updated": "<%= entityClassHumanized %> թարմացվաց է {{ param }} նունացուցիչով", diff --git a/generators/entity-i18n/templates/i18n/entity_in.json.ejs b/generators/entity-i18n/templates/i18n/entity_in.json.ejs index 1653cb9c25d6..feedc69c61a9 100644 --- a/generators/entity-i18n/templates/i18n/entity_in.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_in.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Buat <%= entityClassHumanized %> baru", "createOrEditLabel": "Buat atau edit <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Cari <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> dengan id {{ param }} telah dibuat", "updated": "<%= entityClassHumanized %> dengan id {{ param }} telah diperbaharui", diff --git a/generators/entity-i18n/templates/i18n/entity_it.json.ejs b/generators/entity-i18n/templates/i18n/entity_it.json.ejs index 6b3734753e3b..0a9520865e0a 100644 --- a/generators/entity-i18n/templates/i18n/entity_it.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_it.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Genera un nuovo <%= entityClassHumanized %>", "createOrEditLabel": "Genera o modifica un <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Cerca <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "È stato generato un nuovo <%= entityClassHumanized %> con identificatore {{ param }}", "updated": "È stato aggiornato <%= entityClassHumanized %> identificato da {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ja.json.ejs b/generators/entity-i18n/templates/i18n/entity_ja.json.ejs index 9784e4e32831..a66499a52610 100644 --- a/generators/entity-i18n/templates/i18n/entity_ja.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ja.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "<%= entityClassHumanized %> を追加", "createOrEditLabel": "<%= entityClassHumanized %>を追加または編集"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ko.json.ejs b/generators/entity-i18n/templates/i18n/entity_ko.json.ejs index aca6a0e0ad4d..d251ee5a8584 100644 --- a/generators/entity-i18n/templates/i18n/entity_ko.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ko.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_mr.json.ejs b/generators/entity-i18n/templates/i18n/entity_mr.json.ejs index fcd03621f8d7..ca18d9ebd270 100644 --- a/generators/entity-i18n/templates/i18n/entity_mr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_mr.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "नवीन <%= entityClassHumanized %> तयार करा", "createOrEditLabel": "<%= entityClassHumanized %> तयार किंवा संपादित करा"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %> शोधा"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> [identifier: {{ param }}] तयार आहे", "updated": "<%= entityClassHumanized %> [identifier: {{ param }}] सुधारित केले आहे", diff --git a/generators/entity-i18n/templates/i18n/entity_my.json.ejs b/generators/entity-i18n/templates/i18n/entity_my.json.ejs index 5a1e0ec5d262..50c810bf0780 100644 --- a/generators/entity-i18n/templates/i18n/entity_my.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_my.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "<%= entityClassHumanized %> အသစ်ထည့်မည်", "createOrEditLabel": "<%= entityClassHumanized %> အသစ်ထည့်ခြင်း (သို့) ပြုပြင်ခြင်း"<% if (searchEngine === 'elasticsearch') { %>, "search": "ရှာဖွေရန် <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "{{ param }} အိုင်ဒီဖြင့် <%= entityClassHumanized %> အသစ်တစ်ခုအား ထည့်ပြီးပါပြီ။", "updated": "{{ param }} အိုင်ဒီဖြင့် <%= entityClassHumanized %> တစ်ခုအား ပြုပြင်ပြီးပါပြီ။", diff --git a/generators/entity-i18n/templates/i18n/entity_nl.json.ejs b/generators/entity-i18n/templates/i18n/entity_nl.json.ejs index 7b8abed584f4..a0874c7813c0 100644 --- a/generators/entity-i18n/templates/i18n/entity_nl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_nl.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Maak een nieuwe <%= entityClassHumanized %>", "createOrEditLabel": "Maak of wijzig een <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_pl.json.ejs b/generators/entity-i18n/templates/i18n/entity_pl.json.ejs index e6635f3a0c0e..aa4c1969b2ca 100644 --- a/generators/entity-i18n/templates/i18n/entity_pl.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pl.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Dodaj <%= entityClassHumanized %>", "createOrEditLabel": "Dodaj lub edytuj: <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Szukaj <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Utworzono nowy obiekt typu <%= entityClassHumanized %> z identyfikatorem {{ param }}", "updated": "Uaktualniono obiekt typu <%= entityClassHumanized %> z identyfikatorem {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs b/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs index d1385aed3f27..a3f3b5ad9292 100644 --- a/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_pt-pt.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Criar um(a) novo(a) <%= entityClassHumanized %>", "createOrEditLabel": "Criar ou editar um(a) <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ro.json.ejs b/generators/entity-i18n/templates/i18n/entity_ro.json.ejs index d57f4777fbbc..ba7950d57994 100644 --- a/generators/entity-i18n/templates/i18n/entity_ro.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ro.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Creeare o nouă entitate <%= entityClassHumanized %>", "createOrEditLabel": "Creeare sau editare <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Căutare după <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A fost creată o nouă entitate <%= entityClassHumanized %> cu identificatorul {{ param }}", "updated": "<%= entityClassHumanized %> cu identificatorul {{ param }} a fost actualizată", diff --git a/generators/entity-i18n/templates/i18n/entity_ru.json.ejs b/generators/entity-i18n/templates/i18n/entity_ru.json.ejs index 53633fd706a0..e313130b0dab 100644 --- a/generators/entity-i18n/templates/i18n/entity_ru.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ru.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Создать новый <%= entityClassHumanized %>", "createOrEditLabel": "Создать или отредактировать <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Найти <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новый <%= entityClassHumanized %> создан с идентификатором {{ param }}", "updated": "<%= entityClassHumanized %> обновлен с идентификатором {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_sk.json.ejs b/generators/entity-i18n/templates/i18n/entity_sk.json.ejs index 62d46574e3c6..d052a9187fd1 100644 --- a/generators/entity-i18n/templates/i18n/entity_sk.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sk.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Pridať <%= entityClassHumanized %>", "createOrEditLabel": "Pridať alebo upraviť <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Vyhľadať <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Bol vytvorený potomok entity <%= entityClassHumanized %> s identifikátorom {{ param }}", "updated": "Potomok entity <%= entityClassHumanized %> s identifikátorom {{ param }} bol upravený.", diff --git a/generators/entity-i18n/templates/i18n/entity_sr.json.ejs b/generators/entity-i18n/templates/i18n/entity_sr.json.ejs index f5eedeffb435..19388545c2fa 100644 --- a/generators/entity-i18n/templates/i18n/entity_sr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sr.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Kreiraj novi <%= entityClassHumanized %>", "createOrEditLabel": "Kreirajte ili izmenite <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Potražite <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Kreiran je novi <%= entityClassHumanized %> pod nazivom {{ param }}", "updated": "<%= entityClassHumanized %> pod nazivom {{ param }} je ažuriran", diff --git a/generators/entity-i18n/templates/i18n/entity_sv.json.ejs b/generators/entity-i18n/templates/i18n/entity_sv.json.ejs index f499438a08cc..5b218886f39b 100644 --- a/generators/entity-i18n/templates/i18n/entity_sv.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_sv.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Skapa en ny <%= entityClassHumanized %>", "createOrEditLabel": "Skapa eller ändra en <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Sök efter <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "En ny <%= entityClassHumanized %> är skapad med id {{ param }}", "updated": "En <%= entityClassHumanized %> är uppdaterad med id {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ta.json.ejs b/generators/entity-i18n/templates/i18n/entity_ta.json.ejs index 5e78d94e577c..1c71ec4d6517 100644 --- a/generators/entity-i18n/templates/i18n/entity_ta.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ta.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "<%= entityClassHumanized %>-ஐ உருவாக்கு", "createOrEditLabel": "<%= entityClassHumanized %> -ஐ மாற்று (அ) உருவாக்கு"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> புதிதாக உருவாக்கப்பட்டது, அடையாளம் {{ param }}", "updated": "<%= entityClassHumanized %> மாற்றப்பட்டது, அடையாளம் {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_te.json.ejs b/generators/entity-i18n/templates/i18n/entity_te.json.ejs index 5ec0bfa7fa60..0e9908ebb3c9 100644 --- a/generators/entity-i18n/templates/i18n/entity_te.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_te.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "కొత్త <%= entityClassHumanized %> సృష్టించండి", "createOrEditLabel": "<%= entityClassHumanized %> సృష్టించండి లేదా సవరించండి"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %> కొరకు శోధించండి"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "{{ param }} ఐడీ తో ఒక కొత్త <%= entityClassHumanized %> సృష్టించబడినది", "updated": "{{ param }} ఐడీ తో ఒక కొత్త <%= entityClassHumanized %> సవరించబడినది", diff --git a/generators/entity-i18n/templates/i18n/entity_th.json.ejs b/generators/entity-i18n/templates/i18n/entity_th.json.ejs index 143bd0d09c67..a05a61497884 100644 --- a/generators/entity-i18n/templates/i18n/entity_th.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_th.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "สร้าง <%= entityClassHumanized %>", "createOrEditLabel": "สร้างหรือแก้ไข <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "ค้นหา <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> ถูกสร้างด้วย {{ param }}", "updated": "<%= entityClassHumanized %> ถูกแก้ไขด้วย {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_tr.json.ejs b/generators/entity-i18n/templates/i18n/entity_tr.json.ejs index aca6a0e0ad4d..d251ee5a8584 100644 --- a/generators/entity-i18n/templates/i18n/entity_tr.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_tr.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Create a new <%= entityClassHumanized %>", "createOrEditLabel": "Create or edit a <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Search for <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "A new <%= entityClassHumanized %> is created with identifier {{ param }}", "updated": "A <%= entityClassHumanized %> is updated with identifier {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_ua.json.ejs b/generators/entity-i18n/templates/i18n/entity_ua.json.ejs index 5ac5ea5602a3..84481346c908 100644 --- a/generators/entity-i18n/templates/i18n/entity_ua.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_ua.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Створити новий <%= entityClassHumanized %>", "createOrEditLabel": "Створити чи редагувати <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Знайти <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Новий <%= entityClassHumanized %> створений з ідентифікатором {{ param }}", "updated": "<%= entityClassHumanized %> оновлений з ідентифікатором {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_uz-Cyrl-uz.json.ejs b/generators/entity-i18n/templates/i18n/entity_uz-Cyrl-uz.json.ejs index 2aae913036f2..b7046917187c 100644 --- a/generators/entity-i18n/templates/i18n/entity_uz-Cyrl-uz.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_uz-Cyrl-uz.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Янги <%= entityClassHumanized %> қўшиш", "createOrEditLabel": "<%= entityClassHumanized %>ни таҳрирлаш"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %>ни излаш"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} билан қўшилди.", "updated": "{{ param }}- <%= entityClassHumanized %> сақланди.", diff --git a/generators/entity-i18n/templates/i18n/entity_uz-Latn-uz.json.ejs b/generators/entity-i18n/templates/i18n/entity_uz-Latn-uz.json.ejs index 85ddd7627fbe..9d2610902f6f 100644 --- a/generators/entity-i18n/templates/i18n/entity_uz-Latn-uz.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_uz-Latn-uz.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Yangi <%= entityClassHumanized %> qo`shish", "createOrEditLabel": "<%= entityClassHumanized %>ni tahrirlash"<% if (searchEngine === 'elasticsearch') { %>, "search": "<%= entityClassHumanized %>ni izlash"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} bilan qo`shildi", "updated": "{{ param }}- <%= entityClassHumanized %> saqlandi", diff --git a/generators/entity-i18n/templates/i18n/entity_vi.json.ejs b/generators/entity-i18n/templates/i18n/entity_vi.json.ejs index 5036f334b7ad..8b569a7ce7ec 100644 --- a/generators/entity-i18n/templates/i18n/entity_vi.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_vi.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "Thêm mới một <%= entityClassHumanized %>", "createOrEditLabel": "Thêm mới hoặc cập nhật <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "Tìm <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "Một <%= entityClassHumanized %> mới được tạo với định danh {{ param }}", "updated": "Một <%= entityClassHumanized %> cập nhật với định danh {{ param }}", diff --git a/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs b/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs index 74dbaa0ddde9..51f34936388a 100644 --- a/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_zh-cn.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "创建新 <%= entityClassHumanized %>", "createOrEditLabel": "创建或编辑 <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "查找 <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "<%= entityClassHumanized %> {{ param }} 创建成功", "updated": "<%= entityClassHumanized %> {{ param }} 更新成功", diff --git a/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs b/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs index 116595eaff40..8b0fd0d62f3a 100644 --- a/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs +++ b/generators/entity-i18n/templates/i18n/entity_zh-tw.json.ejs @@ -25,7 +25,7 @@ let helpBlocks = 0; %> "createLabel": "建立一筆新的 <%= entityClassHumanized %>", "createOrEditLabel": "建立或編輯 <%= entityClassHumanized %>"<% if (searchEngine === 'elasticsearch') { %>, "search": "搜尋 <%= entityClassHumanized %>"<% } %>, - "notFound": "No <%= entityClassHumanized %> found" + "notFound": "No <%= entityClassPluralHumanized %> found" },<% if (!microserviceAppName) { %> "created": "新的 <%= entityClassHumanized %> 建立成功,識別碼為 {{ param }}", "updated": "識別碼為 {{ param }} 的 <%= entityClassHumanized %> 更新成功", From ab4d07a46e29dc9e5d6b4885bc370364ea27ed7c Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sun, 30 Jun 2019 17:27:59 +0200 Subject: [PATCH 236/298] Revert "improve performance" This reverts commit c77d5cfe78b6d09763ef2283297b0e3b378ed188. --- cli/cli.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/cli.js b/cli/cli.js index cfe737d65ade..40d112398dd1 100644 --- a/cli/cli.js +++ b/cli/cli.js @@ -54,8 +54,6 @@ program .usage('[command] [options]') .allowUnknownOption(); -const options = getCommandOptions(packageJson, process.argv.slice(2)); - /* create commands */ Object.keys(SUB_GENERATORS).forEach(key => { const opts = SUB_GENERATORS[key]; @@ -67,6 +65,7 @@ Object.keys(SUB_GENERATORS).forEach(key => { .allowUnknownOption() .description(opts.desc) .action(args => { + const options = getCommandOptions(packageJson, process.argv.slice(2)); if (opts.cliOnly) { logger.debug('Executing CLI only script'); /* eslint-disable global-require, import/no-dynamic-require */ From 6ce9eb3112be427ffc4399c9c13baa1499058ae3 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sun, 30 Jun 2019 18:22:30 +0200 Subject: [PATCH 237/298] Fix packaging with just git init --- generators/server/templates/pom.xml.ejs | 1 + 1 file changed, 1 insertion(+) diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 65da996ec4a9..13c6e7ea7093 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -933,6 +933,7 @@ false + false true ^git.commit.id.abbrev$ From c18deed1fb80ad2bf16294a3415f353544e9fa27 Mon Sep 17 00:00:00 2001 From: Henri Tremblay Date: Mon, 1 Jul 2019 00:25:50 -0400 Subject: [PATCH 238/298] No need to specify the from here, it is the same as in application.yml --- .../templates/src/main/resources/config/application-dev.yml.ejs | 1 - .../templates/src/main/resources/config/application-prod.yml.ejs | 1 - 2 files changed, 2 deletions(-) diff --git a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs index 3cefe041fd02..0dec295f4aac 100644 --- a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs @@ -355,7 +355,6 @@ jhipster: key: <%= rememberMeKey %> <%_ } _%> mail: # specific JHipster mail property, for standard properties see MailProperties - from: <%= baseName %>@localhost base-url: http://127.0.0.1:<%= applicationType !== 'uaa' ? serverPort : 8080 %> metrics: logs: # Reports metrics in the logs diff --git a/generators/server/templates/src/main/resources/config/application-prod.yml.ejs b/generators/server/templates/src/main/resources/config/application-prod.yml.ejs index 08995cb1b8fd..41fc17ee8c84 100644 --- a/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application-prod.yml.ejs @@ -339,7 +339,6 @@ jhipster: key: <%= rememberMeKey %> <%_ } _%> mail: # specific JHipster mail property, for standard properties see MailProperties - from: <%= baseName %>@localhost base-url: http://my-server-url-to-change # Modify according to your server's URL metrics: logs: # Reports metrics in the logs From 4798939dcb6f214ad53b97ceb554ef9bd3e29618 Mon Sep 17 00:00:00 2001 From: Henri Tremblay Date: Mon, 1 Jul 2019 00:26:51 -0400 Subject: [PATCH 239/298] In development, the email should target port 9000 to prevent bypassing the proxy when clicking in a mail --- .../templates/src/main/resources/config/application-dev.yml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs index 0dec295f4aac..20852629419a 100644 --- a/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +++ b/generators/server/templates/src/main/resources/config/application-dev.yml.ejs @@ -355,7 +355,7 @@ jhipster: key: <%= rememberMeKey %> <%_ } _%> mail: # specific JHipster mail property, for standard properties see MailProperties - base-url: http://127.0.0.1:<%= applicationType !== 'uaa' ? serverPort : 8080 %> + base-url: http://127.0.0.1:<%= applicationType !== 'uaa' ? serverPort : 9000 %> metrics: logs: # Reports metrics in the logs enabled: false From 3b8a725d61bcf77153267493dae30f85cb418d9e Mon Sep 17 00:00:00 2001 From: Henri Tremblay Date: Mon, 1 Jul 2019 00:27:21 -0400 Subject: [PATCH 240/298] Should be 6.1.2 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 3490a848f847..d083dbe1b8d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.1", + "version": "6.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { From e242e312068e2d99710ee9ec4f65571a4213ba96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 1 Jul 2019 11:55:02 +0200 Subject: [PATCH 241/298] fix audits and user management with uaa and no database --- generators/client/files-angular.js | 6 ++++-- .../angular/src/main/webapp/app/admin/admin.module.ts.ejs | 4 ++-- .../angular/src/main/webapp/app/admin/admin.route.ts.ejs | 4 ++-- .../angular/src/main/webapp/app/admin/index.ts.ejs | 2 +- .../webapp/app/layouts/navbar/navbar.component.html.ejs | 2 +- .../client/templates/angular/src/main/webapp/robots.txt.ejs | 2 +- .../test/javascript/e2e/admin/administration.spec.ts.ejs | 2 +- .../main/webapp/app/modules/administration/index.tsx.ejs | 4 ++-- .../client/templates/react/src/main/webapp/robots.txt.ejs | 2 +- .../e2e/modules/administration/administration.spec.ts.ejs | 2 +- generators/generator-base-private.js | 2 +- generators/generator-base.js | 2 +- .../templates/src/main/webapp/i18n/al/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ar-ly/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/bn/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/by/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ca/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/cs/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/da/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/de/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/el/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/en/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/es/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/et/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fa/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/gl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hu/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hy/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/in/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ko/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/mr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/my/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/nl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pt-br/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pt-pt/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ro/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ru/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sk/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sv/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ta/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/te/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/th/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/tr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ua/global.json.ejs | 2 +- .../src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs | 2 +- .../src/main/webapp/i18n/uz-Latn-uz/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/vi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/zh-cn/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/zh-tw/global.json.ejs | 2 +- generators/server/index.js | 4 +++- generators/server/prompts.js | 4 +++- package-lock.json | 2 +- 57 files changed, 67 insertions(+), 61 deletions(-) diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index 3c019364a341..82fdcc500467 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -257,7 +257,8 @@ const files = { ] }, { - condition: generator => generator.databaseType !== 'no' && generator.databaseType !== 'cassandra', + condition: generator => + (generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', path: ANGULAR_DIR, templates: [ { file: 'admin/audits/audits.route.ts', method: 'processJs' }, @@ -437,7 +438,8 @@ const files = { templates: ['spec/app/shared/login/login.component.spec.ts', 'spec/app/shared/alert/alert-error.component.spec.ts'] }, { - condition: generator => generator.databaseType !== 'no' && generator.databaseType !== 'cassandra', + condition: generator => + (generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', path: TEST_SRC_DIR, templates: ['spec/app/admin/audits/audits.component.spec.ts', 'spec/app/admin/audits/audits.service.spec.ts'] }, diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs index 9e48c0d6266c..655896050b55 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs @@ -27,7 +27,7 @@ import { <%=angularXAppName%>SharedModule } from 'app/shared'; import { adminState, - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> AuditsComponent, <%_ } _%> <%_ if (!skipUserManagement) { _%> @@ -57,7 +57,7 @@ import { RouterModule.forChild(adminState) ], declarations: [ - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> AuditsComponent, <%_ } _%> <%_ if (!skipUserManagement) { _%> diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs index b4f4b0892ed7..3d66a7d76a90 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs @@ -19,7 +19,7 @@ import { Routes } from '@angular/router'; import { - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> auditsRoute, <%_ } _%> configurationRoute, @@ -41,7 +41,7 @@ import { import { UserRouteAccessService } from 'app/core'; const ADMIN_ROUTES = [ - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> auditsRoute, <%_ } _%> configurationRoute, diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs index 95e7667f4ab7..3f07f86e9fad 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> export * from './audits/audits.component'; export * from './audits/audits.service'; export * from './audits/audits.route'; diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs index 27dfef736caf..76669cd4209c 100644 --- a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs @@ -98,7 +98,7 @@ Configuration - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%>
  • diff --git a/generators/client/templates/angular/src/main/webapp/robots.txt.ejs b/generators/client/templates/angular/src/main/webapp/robots.txt.ejs index 169720da234e..0072dcaabefd 100644 --- a/generators/client/templates/angular/src/main/webapp/robots.txt.ejs +++ b/generators/client/templates/angular/src/main/webapp/robots.txt.ejs @@ -24,7 +24,7 @@ Disallow: /api/account Disallow: /api/account/change-password Disallow: /api/account/sessions <%_ } _%> -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> Disallow: /api/audits/ <%_ } _%> Disallow: /api/logs/ diff --git a/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs index 399a1bbbf0c7..af2160a0eb97 100644 --- a/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs +++ b/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs @@ -95,7 +95,7 @@ describe('administration', () => { expect(value1).to.eq(expect1); }); -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> it('should load audits', async () => { await navBarPage.clickOnAdmin('audits'); await browser.sleep(500); diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs index 8337a18fcdbb..850f8b491a8e 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs @@ -26,7 +26,7 @@ import Logs from './logs/logs'; import Health from './health/health'; import Metrics from './metrics/metrics'; import Configuration from './configuration/configuration'; -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> import Audits from './audits/audits'; <%_ } _%> import Docs from './docs/docs'; @@ -52,7 +52,7 @@ const Routes = ({ match }) => ( -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> <%_ } _%> diff --git a/generators/client/templates/react/src/main/webapp/robots.txt.ejs b/generators/client/templates/react/src/main/webapp/robots.txt.ejs index 169720da234e..0072dcaabefd 100644 --- a/generators/client/templates/react/src/main/webapp/robots.txt.ejs +++ b/generators/client/templates/react/src/main/webapp/robots.txt.ejs @@ -24,7 +24,7 @@ Disallow: /api/account Disallow: /api/account/change-password Disallow: /api/account/sessions <%_ } _%> -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> Disallow: /api/audits/ <%_ } _%> Disallow: /api/logs/ diff --git a/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs b/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs index a78dcaae2dd8..88199c6ce704 100644 --- a/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs +++ b/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs @@ -72,7 +72,7 @@ describe('Administration', () => { expect(await element(by.id('configuration-page-heading')).getText()).to.eq('Configuration'); }); -<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> it('should load audits', async () => { await navBarPage.clickOnAdminMenuItem('audits'); expect(await element(by.id('audits-page-heading')).getText()).to.eq('Audits'); diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index fc3c10e14462..29af32de5a67 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -67,7 +67,7 @@ module.exports = class extends Generator { installI18nClientFilesByLanguage(_this, webappDir, lang) { const generator = _this || this; const prefix = this.fetchFromInstalledJHipster('languages/templates'); - if (generator.databaseType !== 'no' && generator.databaseType !== 'cassandra') { + if ((generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra') { generator.copyI18nFilesByName(generator, webappDir, 'audits.json', lang); } if (generator.applicationType === 'gateway' && generator.serviceDiscoveryType) { diff --git a/generators/generator-base.js b/generators/generator-base.js index ba474403c96d..d1d97097621b 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -1917,7 +1917,7 @@ module.exports = class extends PrivateBase { generator.getDBTypeFromDBValue(dest.prodDatabaseType) || context.configOptions.databaseType || context.config.get('databaseType'); - if (dest.authenticationType === 'oauth2' || dest.databaseType === 'no') { + if (dest.authenticationType === 'oauth2' || (dest.databaseType === 'no' && dest.authenticationType !== 'uaa')) { dest.skipUserManagement = true; } dest.searchEngine = context.config.get('searchEngine'); diff --git a/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs index 296340da3415..24495f10e347 100644 --- a/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs @@ -47,7 +47,7 @@ "health": "Shëndeti", "configuration": "Konfigurimi", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditet", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs index 9cc932805d89..526804c44e95 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs @@ -47,7 +47,7 @@ "health": "الصحة", "configuration": "الإعدادات", "logs": "السجلات", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "عمليات التدقيق", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs index 4f274c3c4e69..25d5d8920423 100644 --- a/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Configuration", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs index b5527cdbe275..c73aa9a1909e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs @@ -47,7 +47,7 @@ "health": "Стан", "configuration": "Налады", "logs": "Логі", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аўдыт", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs index 2f27aa62cc17..b964e4e4d96c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs @@ -47,7 +47,7 @@ "health": "Salud", "configuration": "Configuració", "logs": "Registres", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditories", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs index 034521955f73..adf16c9a2254 100644 --- a/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs @@ -47,7 +47,7 @@ "health": "Stav systému", "configuration": "Konfigurace", "logs": "Logy", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audity", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs index e4c34a72930b..5cbcc3acb19e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs @@ -47,7 +47,7 @@ "health": "Sundheds", "configuration": "Konfiguration", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs index 0803782d84a8..63dfd02d957d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfiguration", "logs": "Protokoll", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs index d722d2bbcd9d..cac02334d371 100644 --- a/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs @@ -47,7 +47,7 @@ "health": "Υγεία", "configuration": "Διαμόρφωση", "logs": "Καταγραφές", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "'Ελεγχει", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs index 4f274c3c4e69..25d5d8920423 100644 --- a/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Configuration", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs index 7894afc4cb07..1912fdb4eaa1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs @@ -47,7 +47,7 @@ "health": "Salud", "configuration": "Configuración", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorías", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs index a36c8d9c45be..fc95a0cf6e97 100644 --- a/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs @@ -47,7 +47,7 @@ "health": "Tervis", "configuration": "Konfiguratsioon", "logs": "Logid", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs index f822674d7e89..a7c74e6fe7c1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs @@ -47,7 +47,7 @@ "health": "سلامتی", "configuration": "پیکربندی", "logs": "وقایع ثبت شده", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "وقایع بازرسی", <%_ } _%> "apidocs": "ای‌پی‌آی", diff --git a/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs index 56c76ae469d6..e1c7fb852ff8 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs @@ -47,7 +47,7 @@ "health": "Terveys", "configuration": "Konfiguraatio", "logs": "Logit", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit logit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs index 89a79cab29a4..9f7074d2d964 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Diagnostics", "configuration": "Configuration", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs index cb053ab382d7..1a4962626ce0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Saúde", "configuration": "Configuración", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorías", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs index 1bd66cb98064..2af32aab0654 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs @@ -47,7 +47,7 @@ "health": "स्वास्थ्य", "configuration": "कॉन्फ़िगरेशन", "logs": "लॉग", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "आडिट", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs index c41106f42a47..6a79b271b749 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs @@ -47,7 +47,7 @@ "health": "Akalmazás állapota", "configuration": "Konfiguráció", "logs": "Naplók", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Nyomkövetés", <%_ } _%> "apidocs": "API dokumentáció", diff --git a/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs index 965a82bbde1e..eeac9080c3c5 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Կարգավորումներ", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Աուդիտ", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs index 7d7624eb0ab9..97ccb8dbee71 100644 --- a/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs @@ -47,7 +47,7 @@ "health": "Kesehatan Aplikasi", "configuration": "Konfigurasi", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs index ebe95e8dc15c..37602496a6c8 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs @@ -46,7 +46,7 @@ "health": "상태 확인", "configuration": "설정", "logs": "로그", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs index 7e4790e9f573..8f77ed71abe2 100644 --- a/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs @@ -47,7 +47,7 @@ "health": "आरोग्य", "configuration": "संरचना", "logs": "नोंदी", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "ऑडिट", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs index e9438fb2d58b..19ed976f8002 100644 --- a/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs @@ -47,7 +47,7 @@ "health": "စနစ်အခြေအနေ", "configuration": "Configuration များ", "logs": "Log များ", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "စာရင်းစစ်ဆေးခြင်း", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs index e494f686a314..17a4a8ce9f4d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Configuration", "logs": "Logboek", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs index 7780e8f41188..9038bfaeb8b6 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfiguracja", "logs": "Logi", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audyty", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs index 1b6527f70326..08df4ee49b3a 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs @@ -47,7 +47,7 @@ "health": "Estado do Sistema", "configuration": "Configuração", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorias", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs index 22e247b91fce..31714e085e4f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs @@ -47,7 +47,7 @@ "health": "Estado do Sistema", "configuration": "Configuração", "logs": "Logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorias", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs index 415c33136013..009d06600b63 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs @@ -50,7 +50,7 @@ "health": "Stare", "configuration": "Configurare", "logs": "Jurnal", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs index e2e32b088014..35df26efb232 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs @@ -47,7 +47,7 @@ "health": "Состояние", "configuration": "Настройки", "logs": "Логи", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs index 8793afaffe95..cae151164cf0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs @@ -47,7 +47,7 @@ "health": "Stav systému", "configuration": "Konfigurácia", "logs": "Logy", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audity", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs index 727b4e100bcb..593788d93025 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Ispravnost sistema", "configuration": "Konfiguracija", "logs": "Logovi", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Revizije", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs index 123819bfe674..65bbc09c4b2c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfigurering", "logs": "Loggar", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Granskningar", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs index 755220e75ae6..5f88acbe3ec5 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs @@ -47,7 +47,7 @@ "health": "ஆரோக்கியம்", "configuration": "கட்டமைப்பு", "logs": "பதிவுகள்", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "தணிக்கைகள்", <%_ } _%> "apidocs": "எபிஐ ", diff --git a/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs index 552273cf6710..f18c32936d6a 100644 --- a/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs @@ -47,7 +47,7 @@ "health": "పరిస్థితి", "configuration": "ఆకృతీకరణ", "logs": "లాగ్స్", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "తనిఖీలు", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs index 563d6046ddcb..13b7d3460ba0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs @@ -47,7 +47,7 @@ "health": "สถานะระบบ", "configuration": "องค์ประกอบ", "logs": "บันทึกการทำงาน", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "การตรวจสอบ", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs index 5b79b75b87d6..a22a9c4b2461 100644 --- a/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Sağlık", "configuration": "Yapılandırma", "logs": "Kayıtlar", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Denetim", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs index 0c34171d4b54..b988debd2847 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs @@ -47,7 +47,7 @@ "health": "Стан", "configuration": "Налаштування", "logs": "Логи", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs index 225b50facede..fe22452d4418 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs @@ -44,7 +44,7 @@ "health": "Ҳолат", "configuration": "Созламалар", "logs": "Логлар", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs index 32b6afa24733..b5c256983307 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs @@ -47,7 +47,7 @@ "health": "Holat", "configuration": "Sozlamalar", "logs": "Loglar", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs index fa4cff5f9cf7..4c868664f53c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs @@ -47,7 +47,7 @@ "health": "Tình trạng", "configuration": "Cấu hình", "logs": "Ghi logs", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Kiểm duyệt", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs index 53920d70c01c..cbc1118b7dbc 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs @@ -47,7 +47,7 @@ "health": "服务状态", "configuration": "配置", "logs": "日志", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "审核", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs index 8659173e5578..7f5da2c13f0d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs @@ -47,7 +47,7 @@ "health": "服務狀態", "configuration": "設定", "logs": "紀錄", - <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "稽核", <%_ } _%> "apidocs": "API", diff --git a/generators/server/index.js b/generators/server/index.js index 6fb4403a2bb1..bfa3e298343d 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -192,7 +192,9 @@ module.exports = class extends BaseBlueprintGenerator { this.devDatabaseType = 'no'; this.prodDatabaseType = 'no'; this.enableHibernateCache = false; - this.skipUserManagement = true; + if (this.authenticationType !== 'uaa') { + this.skipUserManagement = true; + } } else { // sql this.devDatabaseType = configuration.get('devDatabaseType'); diff --git a/generators/server/prompts.js b/generators/server/prompts.js index dc57010c9130..6ec11bdab1ac 100644 --- a/generators/server/prompts.js +++ b/generators/server/prompts.js @@ -323,7 +323,9 @@ function askForServerSideOpts(meta) { this.devDatabaseType = 'no'; this.prodDatabaseType = 'no'; this.enableHibernateCache = false; - this.skipUserManagement = true; + if (this.authenticationType !== 'uaa') { + this.skipUserManagement = true; + } } else if (this.databaseType === 'mongodb') { this.devDatabaseType = 'mongodb'; this.prodDatabaseType = 'mongodb'; diff --git a/package-lock.json b/package-lock.json index 3490a848f847..d083dbe1b8d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.1", + "version": "6.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { From ed74a4d9ad30c3ccaf6fce2027d53fffb0565c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Mon, 1 Jul 2019 13:43:40 +0200 Subject: [PATCH 242/298] rewrite condition to make it clearer --- generators/client/files-angular.js | 4 ++-- .../angular/src/main/webapp/app/admin/admin.module.ts.ejs | 4 ++-- .../angular/src/main/webapp/app/admin/admin.route.ts.ejs | 4 ++-- .../templates/angular/src/main/webapp/app/admin/index.ts.ejs | 2 +- .../main/webapp/app/layouts/navbar/navbar.component.html.ejs | 2 +- .../client/templates/angular/src/main/webapp/robots.txt.ejs | 2 +- .../src/test/javascript/e2e/admin/administration.spec.ts.ejs | 2 +- .../src/main/webapp/app/modules/administration/index.tsx.ejs | 4 ++-- .../client/templates/react/src/main/webapp/robots.txt.ejs | 2 +- .../e2e/modules/administration/administration.spec.ts.ejs | 2 +- generators/generator-base-private.js | 2 +- .../templates/src/main/webapp/i18n/al/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ar-ly/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/bn/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/by/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ca/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/cs/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/da/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/de/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/el/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/en/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/es/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/et/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fa/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/fr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/gl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hu/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/hy/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/in/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ko/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/mr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/my/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/nl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pl/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pt-br/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/pt-pt/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ro/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ru/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sk/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/sv/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ta/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/te/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/th/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/tr/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/ua/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/vi/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/zh-cn/global.json.ejs | 2 +- .../templates/src/main/webapp/i18n/zh-tw/global.json.ejs | 2 +- 53 files changed, 57 insertions(+), 57 deletions(-) diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index 82fdcc500467..a3ce78430f44 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -258,7 +258,7 @@ const files = { }, { condition: generator => - (generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', + (generator.databaseType !== 'no' || generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', path: ANGULAR_DIR, templates: [ { file: 'admin/audits/audits.route.ts', method: 'processJs' }, @@ -439,7 +439,7 @@ const files = { }, { condition: generator => - (generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', + (generator.databaseType !== 'no' || generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra', path: TEST_SRC_DIR, templates: ['spec/app/admin/audits/audits.component.spec.ts', 'spec/app/admin/audits/audits.service.spec.ts'] }, diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs index 655896050b55..34236fa8f257 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/admin.module.ts.ejs @@ -27,7 +27,7 @@ import { <%=angularXAppName%>SharedModule } from 'app/shared'; import { adminState, - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> AuditsComponent, <%_ } _%> <%_ if (!skipUserManagement) { _%> @@ -57,7 +57,7 @@ import { RouterModule.forChild(adminState) ], declarations: [ - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> AuditsComponent, <%_ } _%> <%_ if (!skipUserManagement) { _%> diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs index 3d66a7d76a90..b3f440121710 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/admin.route.ts.ejs @@ -19,7 +19,7 @@ import { Routes } from '@angular/router'; import { - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> auditsRoute, <%_ } _%> configurationRoute, @@ -41,7 +41,7 @@ import { import { UserRouteAccessService } from 'app/core'; const ADMIN_ROUTES = [ - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> auditsRoute, <%_ } _%> configurationRoute, diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs index 3f07f86e9fad..fb184e9368d2 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/index.ts.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> export * from './audits/audits.component'; export * from './audits/audits.service'; export * from './audits/audits.route'; diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs index 76669cd4209c..18af80d0bb6d 100644 --- a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs @@ -98,7 +98,7 @@ Configuration
  • - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%>
  • diff --git a/generators/client/templates/angular/src/main/webapp/robots.txt.ejs b/generators/client/templates/angular/src/main/webapp/robots.txt.ejs index 0072dcaabefd..e7ef976d11bf 100644 --- a/generators/client/templates/angular/src/main/webapp/robots.txt.ejs +++ b/generators/client/templates/angular/src/main/webapp/robots.txt.ejs @@ -24,7 +24,7 @@ Disallow: /api/account Disallow: /api/account/change-password Disallow: /api/account/sessions <%_ } _%> -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> Disallow: /api/audits/ <%_ } _%> Disallow: /api/logs/ diff --git a/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs index af2160a0eb97..ec12fe5430b2 100644 --- a/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs +++ b/generators/client/templates/angular/src/test/javascript/e2e/admin/administration.spec.ts.ejs @@ -95,7 +95,7 @@ describe('administration', () => { expect(value1).to.eq(expect1); }); -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> it('should load audits', async () => { await navBarPage.clickOnAdmin('audits'); await browser.sleep(500); diff --git a/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs index 850f8b491a8e..42c8a62c465d 100644 --- a/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs @@ -26,7 +26,7 @@ import Logs from './logs/logs'; import Health from './health/health'; import Metrics from './metrics/metrics'; import Configuration from './configuration/configuration'; -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> import Audits from './audits/audits'; <%_ } _%> import Docs from './docs/docs'; @@ -52,7 +52,7 @@ const Routes = ({ match }) => ( -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> <%_ } _%> diff --git a/generators/client/templates/react/src/main/webapp/robots.txt.ejs b/generators/client/templates/react/src/main/webapp/robots.txt.ejs index 0072dcaabefd..e7ef976d11bf 100644 --- a/generators/client/templates/react/src/main/webapp/robots.txt.ejs +++ b/generators/client/templates/react/src/main/webapp/robots.txt.ejs @@ -24,7 +24,7 @@ Disallow: /api/account Disallow: /api/account/change-password Disallow: /api/account/sessions <%_ } _%> -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> Disallow: /api/audits/ <%_ } _%> Disallow: /api/logs/ diff --git a/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs b/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs index 88199c6ce704..50d192d49020 100644 --- a/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs +++ b/generators/client/templates/react/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs @@ -72,7 +72,7 @@ describe('Administration', () => { expect(await element(by.id('configuration-page-heading')).getText()).to.eq('Configuration'); }); -<%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> +<%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> it('should load audits', async () => { await navBarPage.clickOnAdminMenuItem('audits'); expect(await element(by.id('audits-page-heading')).getText()).to.eq('Audits'); diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index 29af32de5a67..5b572e00258b 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -67,7 +67,7 @@ module.exports = class extends Generator { installI18nClientFilesByLanguage(_this, webappDir, lang) { const generator = _this || this; const prefix = this.fetchFromInstalledJHipster('languages/templates'); - if ((generator.databaseType !== 'no' ? true : generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra') { + if ((generator.databaseType !== 'no' || generator.authenticationType === 'uaa') && generator.databaseType !== 'cassandra') { generator.copyI18nFilesByName(generator, webappDir, 'audits.json', lang); } if (generator.applicationType === 'gateway' && generator.serviceDiscoveryType) { diff --git a/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs index 24495f10e347..18727a91fb3b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/al/global.json.ejs @@ -47,7 +47,7 @@ "health": "Shëndeti", "configuration": "Konfigurimi", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditet", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs index 526804c44e95..5c9220340fb1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ar-ly/global.json.ejs @@ -47,7 +47,7 @@ "health": "الصحة", "configuration": "الإعدادات", "logs": "السجلات", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "عمليات التدقيق", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs index 25d5d8920423..fb8887e6c993 100644 --- a/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/bn/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Configuration", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs index c73aa9a1909e..447db256df51 100644 --- a/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/by/global.json.ejs @@ -47,7 +47,7 @@ "health": "Стан", "configuration": "Налады", "logs": "Логі", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аўдыт", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs index b964e4e4d96c..d20b99c08e1c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ca/global.json.ejs @@ -47,7 +47,7 @@ "health": "Salud", "configuration": "Configuració", "logs": "Registres", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditories", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs index adf16c9a2254..df8e2ef592b0 100644 --- a/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/cs/global.json.ejs @@ -47,7 +47,7 @@ "health": "Stav systému", "configuration": "Konfigurace", "logs": "Logy", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audity", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs index 5cbcc3acb19e..5c3b8479a8e9 100644 --- a/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/da/global.json.ejs @@ -47,7 +47,7 @@ "health": "Sundheds", "configuration": "Konfiguration", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs index 63dfd02d957d..d4c55ecae092 100644 --- a/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/de/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfiguration", "logs": "Protokoll", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs index cac02334d371..39190f0aabfc 100644 --- a/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/el/global.json.ejs @@ -47,7 +47,7 @@ "health": "Υγεία", "configuration": "Διαμόρφωση", "logs": "Καταγραφές", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "'Ελεγχει", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs index 25d5d8920423..fb8887e6c993 100644 --- a/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/en/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Configuration", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs index 1912fdb4eaa1..598200c8cd24 100644 --- a/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/es/global.json.ejs @@ -47,7 +47,7 @@ "health": "Salud", "configuration": "Configuración", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorías", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs index fc95a0cf6e97..95392746f015 100644 --- a/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/et/global.json.ejs @@ -47,7 +47,7 @@ "health": "Tervis", "configuration": "Konfiguratsioon", "logs": "Logid", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs index a7c74e6fe7c1..d1cbcbb6d8b1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fa/global.json.ejs @@ -47,7 +47,7 @@ "health": "سلامتی", "configuration": "پیکربندی", "logs": "وقایع ثبت شده", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "وقایع بازرسی", <%_ } _%> "apidocs": "ای‌پی‌آی", diff --git a/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs index e1c7fb852ff8..f95f2d865b04 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fi/global.json.ejs @@ -47,7 +47,7 @@ "health": "Terveys", "configuration": "Konfiguraatio", "logs": "Logit", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit logit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs index 9f7074d2d964..1f9d5a16f48a 100644 --- a/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/fr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Diagnostics", "configuration": "Configuration", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs index 1a4962626ce0..2b8e7f9f7223 100644 --- a/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/gl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Saúde", "configuration": "Configuración", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorías", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs index 2af32aab0654..197eb898b1d3 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hi/global.json.ejs @@ -47,7 +47,7 @@ "health": "स्वास्थ्य", "configuration": "कॉन्फ़िगरेशन", "logs": "लॉग", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "आडिट", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs index 6a79b271b749..4b4cb417b263 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hu/global.json.ejs @@ -47,7 +47,7 @@ "health": "Akalmazás állapota", "configuration": "Konfiguráció", "logs": "Naplók", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Nyomkövetés", <%_ } _%> "apidocs": "API dokumentáció", diff --git a/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs index eeac9080c3c5..782247eaba7c 100644 --- a/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/hy/global.json.ejs @@ -47,7 +47,7 @@ "health": "Health", "configuration": "Կարգավորումներ", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Աուդիտ", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs index 97ccb8dbee71..72de0c853e93 100644 --- a/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/in/global.json.ejs @@ -47,7 +47,7 @@ "health": "Kesehatan Aplikasi", "configuration": "Konfigurasi", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs index 37602496a6c8..a83a81a2ef4f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ko/global.json.ejs @@ -46,7 +46,7 @@ "health": "상태 확인", "configuration": "설정", "logs": "로그", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs index 8f77ed71abe2..1b4f1bd0800e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/mr/global.json.ejs @@ -47,7 +47,7 @@ "health": "आरोग्य", "configuration": "संरचना", "logs": "नोंदी", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "ऑडिट", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs index 19ed976f8002..07c5889dc33f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/my/global.json.ejs @@ -47,7 +47,7 @@ "health": "စနစ်အခြေအနေ", "configuration": "Configuration များ", "logs": "Log များ", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "စာရင်းစစ်ဆေးခြင်း", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs index 17a4a8ce9f4d..db14cdb7d0f5 100644 --- a/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/nl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Configuration", "logs": "Logboek", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audits", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs index 9038bfaeb8b6..defcf8557317 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pl/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfiguracja", "logs": "Logi", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audyty", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs index 08df4ee49b3a..260100166abc 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pt-br/global.json.ejs @@ -47,7 +47,7 @@ "health": "Estado do Sistema", "configuration": "Configuração", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorias", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs index 31714e085e4f..60a2aeac83ab 100644 --- a/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/pt-pt/global.json.ejs @@ -47,7 +47,7 @@ "health": "Estado do Sistema", "configuration": "Configuração", "logs": "Logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Auditorias", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs index 009d06600b63..1a9a35275ab2 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ro/global.json.ejs @@ -50,7 +50,7 @@ "health": "Stare", "configuration": "Configurare", "logs": "Jurnal", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs index 35df26efb232..888d60007d43 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ru/global.json.ejs @@ -47,7 +47,7 @@ "health": "Состояние", "configuration": "Настройки", "logs": "Логи", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs index cae151164cf0..5ddfcd15fe8f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sk/global.json.ejs @@ -47,7 +47,7 @@ "health": "Stav systému", "configuration": "Konfigurácia", "logs": "Logy", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audity", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs index 593788d93025..8d54a04f822e 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Ispravnost sistema", "configuration": "Konfiguracija", "logs": "Logovi", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Revizije", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs index 65bbc09c4b2c..580f7e5d330b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/sv/global.json.ejs @@ -47,7 +47,7 @@ "health": "Status", "configuration": "Konfigurering", "logs": "Loggar", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Granskningar", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs index 5f88acbe3ec5..be4f4d64eeda 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ta/global.json.ejs @@ -47,7 +47,7 @@ "health": "ஆரோக்கியம்", "configuration": "கட்டமைப்பு", "logs": "பதிவுகள்", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "தணிக்கைகள்", <%_ } _%> "apidocs": "எபிஐ ", diff --git a/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs index f18c32936d6a..b5b3f8a21399 100644 --- a/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/te/global.json.ejs @@ -47,7 +47,7 @@ "health": "పరిస్థితి", "configuration": "ఆకృతీకరణ", "logs": "లాగ్స్", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "తనిఖీలు", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs index 13b7d3460ba0..2abd5d993fe1 100644 --- a/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/th/global.json.ejs @@ -47,7 +47,7 @@ "health": "สถานะระบบ", "configuration": "องค์ประกอบ", "logs": "บันทึกการทำงาน", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "การตรวจสอบ", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs index a22a9c4b2461..f68667449b5b 100644 --- a/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/tr/global.json.ejs @@ -47,7 +47,7 @@ "health": "Sağlık", "configuration": "Yapılandırma", "logs": "Kayıtlar", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Denetim", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs index b988debd2847..7c88d7b95a2f 100644 --- a/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/ua/global.json.ejs @@ -47,7 +47,7 @@ "health": "Стан", "configuration": "Налаштування", "logs": "Логи", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs index fe22452d4418..90ded356dc31 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Cyrl-uz/global.json.ejs @@ -44,7 +44,7 @@ "health": "Ҳолат", "configuration": "Созламалар", "logs": "Логлар", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Аудит", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs index b5c256983307..186f0771694d 100644 --- a/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/global.json.ejs @@ -47,7 +47,7 @@ "health": "Holat", "configuration": "Sozlamalar", "logs": "Loglar", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Audit", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs index 4c868664f53c..a79043d1baee 100644 --- a/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/vi/global.json.ejs @@ -47,7 +47,7 @@ "health": "Tình trạng", "configuration": "Cấu hình", "logs": "Ghi logs", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "Kiểm duyệt", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs index cbc1118b7dbc..31a13ec9f3ed 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/zh-cn/global.json.ejs @@ -47,7 +47,7 @@ "health": "服务状态", "configuration": "配置", "logs": "日志", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "审核", <%_ } _%> "apidocs": "API", diff --git a/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs b/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs index 7f5da2c13f0d..ad6674108f62 100644 --- a/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs +++ b/generators/languages/templates/src/main/webapp/i18n/zh-tw/global.json.ejs @@ -47,7 +47,7 @@ "health": "服務狀態", "configuration": "設定", "logs": "紀錄", - <%_ if ((databaseType !== 'no' ? true : authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> + <%_ if ((databaseType !== 'no' || authenticationType === 'uaa') && databaseType !== 'cassandra') { _%> "audits": "稽核", <%_ } _%> "apidocs": "API", From 9cf09ea53534b27a8c60dd98b1e0e218c261c9ba Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Mon, 1 Jul 2019 21:53:40 +0200 Subject: [PATCH 243/298] CICD: polish GitLab CI --- generators/ci-cd/templates/.gitlab-ci.yml.ejs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generators/ci-cd/templates/.gitlab-ci.yml.ejs b/generators/ci-cd/templates/.gitlab-ci.yml.ejs index 240b0eee4242..3b81dbe3e2aa 100644 --- a/generators/ci-cd/templates/.gitlab-ci.yml.ejs +++ b/generators/ci-cd/templates/.gitlab-ci.yml.ejs @@ -42,7 +42,9 @@ stages: <%_ if (buildTool === 'gradle') { _%> before_script: + <%_ if (clientFramework === 'angularX') { _%> - export NG_CLI_ANALYTICS="false" + <%_ } _%> - export GRADLE_USER_HOME=`pwd`/.gradle <%_ if (!skipClient) { _%> - ./gradlew <%= clientPackageManager %>_install -PnodeInstall --no-daemon @@ -141,10 +143,11 @@ deploy-to-production: when: manual <%_ } _%> <%_ } _%> - <%_ if (buildTool === 'maven') { _%> before_script: + <%_ if (clientFramework === 'angularX') { _%> - export NG_CLI_ANALYTICS="false" + <%_ } _%> - export MAVEN_USER_HOME=`pwd`/.maven <%_ if (!skipClient) { _%> <%_ if (clientPackageManager === 'yarn') { _%> From f06dda3a315b51e61a2615539e93688f06b47390 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Mon, 1 Jul 2019 21:56:38 +0200 Subject: [PATCH 244/298] Fix Kafka tests when using OAuth2 --- .../test/java/package/web/rest/KafkaResourceIT.java.ejs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs b/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs index fa90fc1db56b..f2f3bc42ad77 100644 --- a/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs +++ b/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs @@ -19,6 +19,9 @@ package <%= packageName %>.web.rest; import <%= packageName %>.<%= mainClass %>; +<%_ if (authenticationType === 'oauth2') { _%> +import <%=packageName%>.config.TestSecurityConfiguration; +<%_ } _%> import <%= packageName %>.service.<%= upperFirstCamelCase(baseName) %>KafkaProducer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -33,7 +36,11 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @EmbeddedKafka +<%_ if (authenticationType === 'oauth2') { _%> +@SpringBootTest(classes = {<%= mainClass %>.class, TestSecurityConfiguration.class}) +<%_ } else { _%> @SpringBootTest(classes = <%= mainClass %>.class) +<%_ } _%> public class <%= upperFirstCamelCase(baseName) %>KafkaResourceIT { @Autowired From 8f086c6da22d90107f4221aafff0f128e3e08750 Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Tue, 2 Jul 2019 09:06:47 +0300 Subject: [PATCH 245/298] Support multiple blueprints - Review fixes --- cli/commands.js | 2 +- generators/app/index.js | 2 +- generators/generator-base-blueprint.js | 36 ++++++++++++++++++++++++++ generators/generator-base-private.js | 36 -------------------------- generators/upgrade/index.js | 4 +-- generators/utils.js | 2 +- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cli/commands.js b/cli/commands.js index 296a039665f5..cd8952375e36 100644 --- a/cli/commands.js +++ b/cli/commands.js @@ -41,7 +41,7 @@ function loadBlueprintCommands() { /* eslint-disable global-require */ try { const blueprintCommands = require(`${blueprint}/cli/commands`); - result = { ...customCommands, ...blueprintCommands }; + result = { ...result, ...blueprintCommands }; } catch (e) { const msg = `No custom commands found within blueprint: ${blueprint}`; /* eslint-disable no-console */ diff --git a/generators/app/index.js b/generators/app/index.js index f0541f8dcaea..8a420c5e58de 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -158,7 +158,7 @@ module.exports = class extends BaseGenerator { // NOTE: Deprecated!!! Use --blueprints instead this.option('blueprint', { - desc: 'Specify one or more generator blueprints to use for the sub generators', + desc: 'DEPRECATED: Specify a generator blueprint to use for the sub generators', type: String }); // This adds support for a `--blueprints` flag which can be used to specify one or more blueprints to use for generation diff --git a/generators/generator-base-blueprint.js b/generators/generator-base-blueprint.js index 532bab2d3112..5f202115d5a2 100644 --- a/generators/generator-base-blueprint.js +++ b/generators/generator-base-blueprint.js @@ -17,6 +17,7 @@ * limitations under the License. */ /* eslint-disable consistent-return */ +const jhipsterUtils = require('./utils'); const BaseGenerator = require('./generator-base'); /** @@ -59,4 +60,39 @@ module.exports = class extends BaseGenerator { _end() { return {}; } + + /** + * Instantiates the blueprint generators, if any. + * @param {string} subGen - sub generator + * @param {any} extraOptions - extra options to pass to blueprint generator + * @return {true} useBlueprints - true if one or more blueprints generators have been constructed; false otherwise + */ + instantiateBlueprints(subGen, extraOptions) { + let useBlueprints = false; + + const blueprints = jhipsterUtils.parseBluePrints( + this.options.blueprints || + this.configOptions.blueprints || + this.config.get('blueprints') || + this.options.blueprint || + this.configOptions.blueprint || + this.config.get('blueprint') + ); + if (blueprints && blueprints.length > 0) { + blueprints.forEach(blueprint => { + let bpOptions = { + ...this.options, + configOptions: this.configOptions + }; + if (extraOptions) { + bpOptions = { ...bpOptions, ...extraOptions }; + } + const useBP = this.composeBlueprint(blueprint.name, subGen, bpOptions); + if (!useBlueprints && useBP) { + useBlueprints = true; + } + }); + } + return useBlueprints; + } }; diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index 2273674b86da..fc3c10e14462 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -759,42 +759,6 @@ module.exports = class extends Generator { } } - /** - * Instantiates the blueprint generators, if any. - * @param {string} subGen - sub generator - * @param {any} extraOptions - extra options to pass to blueprint generator - * @return {true} useBlueprints - true if one or more blueprints generators have been constructed; false otherwise - */ - instantiateBlueprints(subGen, extraOptions) { - let useBlueprints = false; - - const blueprints = jhipsterUtils.parseBluePrints( - this.options.blueprints || - this.configOptions.blueprints || - this.config.get('blueprints') || - this.options.blueprint || - this.configOptions.blueprint || - this.config.get('blueprint') - ); - if (blueprints && blueprints.length > 0) { - blueprints.forEach(blueprint => { - let bpOptions = { - ...this.options, - configOptions: this.configOptions - }; - if (extraOptions) { - bpOptions = { ...bpOptions, ...extraOptions }; - } - const useBP = this.composeBlueprint(blueprint.name, subGen, bpOptions); - // use global variable since getters dont have access to instance property - if (!useBlueprints && useBP) { - useBlueprints = true; - } - }); - } - return useBlueprints; - } - /** * Compose external blueprint module * @param {string} blueprint - name of the blueprint diff --git a/generators/upgrade/index.js b/generators/upgrade/index.js index 6fb25df7c40c..1bcf96b09556 100644 --- a/generators/upgrade/index.js +++ b/generators/upgrade/index.js @@ -51,7 +51,7 @@ module.exports = class extends BaseGenerator { }); // This adds support for a `--target-blueprint-versions` flag this.option('target-blueprint-versions', { - desc: 'Upgrade to specific blueprint versions instead of the latest', + desc: 'Upgrade to specific blueprint versions instead of the latest, e.g. --target-blueprint-versions foo@0.0.1,bar@1.0.2', type: String }); @@ -260,7 +260,7 @@ module.exports = class extends BaseGenerator { }); }) ).then(() => { - this.success('Done checking for new blueprint versions'); + this.success('Done checking for new version of blueprints'); done(); }); }, diff --git a/generators/utils.js b/generators/utils.js index 840e642d154a..4e4fac838849 100644 --- a/generators/utils.js +++ b/generators/utils.js @@ -496,7 +496,7 @@ function loadBlueprintsFromConfiguration(generator) { const blueprints = generator.config.get('blueprints') || []; const oldBlueprintName = generator.config.get('blueprint'); - if (oldBlueprintName) { + if (oldBlueprintName && blueprints.findIndex(e => e.name === oldBlueprintName) === -1) { const version = generator.config.get('blueprintVersion') || 'latest'; blueprints.push(parseBlueprintInfo(`${oldBlueprintName}@${version}`)); } From 1ac5fe7ae8e1880a3e5f442b1d587c48ab76abb7 Mon Sep 17 00:00:00 2001 From: charliemordant Date: Tue, 2 Jul 2019 13:28:04 +0200 Subject: [PATCH 246/298] import authorityextractor for microservices --- .../config/SecurityConfiguration.java.ejs | 2 ++ .../java/package/security/SecurityUtils.java.ejs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 21f8d9ce51b9..cc2add653d69 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -82,6 +82,8 @@ import org.springframework.security.web.csrf.CsrfFilter; <%_ if (authenticationType === 'oauth2' && applicationType !== 'microservice') { _%> import org.springframework.security.web.csrf.CookieCsrfTokenRepository; import org.springframework.security.web.csrf.CsrfFilter; + <%_ } _%> + <%_ if (authenticationType === 'oauth2') { _%> import <%=packageName%>.security.oauth2.JwtAuthorityExtractor; <%_ } _%> <%_ if (authenticationType === 'jwt' && applicationType !== 'microservice') { _%> diff --git a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs index 59ff5ebadeef..0fc30e529fc9 100644 --- a/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs +++ b/generators/server/templates/src/main/java/package/security/SecurityUtils.java.ejs @@ -144,13 +144,13 @@ public final class SecurityUtils { } /** - * If the current user has a specific authority (security role). - *

    - * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. - * - * @param authority the authority to check. - * @return true if the current user has the authority, false otherwise. - */ + * If the current user has a specific authority (security role). + *

    + * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. + * + * @param authority the authority to check. + * @return true if the current user has the authority, false otherwise. + */ public static <% if (!reactive) { %>boolean<% } else { %>Mono<% } %> isCurrentUserInRole(String authority) { <%_ if (!reactive) { _%> SecurityContext securityContext = SecurityContextHolder.getContext(); @@ -191,7 +191,7 @@ public final class SecurityUtils { private static List mapRolesToGrantedAuthorities(Collection roles) { return roles.stream() - .filter(role -> role.startsWith("ROLE_")) + .filter(role -> role.startsWith("ROLE_")) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); } <%_ } _%> From b3f2e08bc82157e2b64202d5eda44c0db0326420 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 2 Jul 2019 14:42:49 +0200 Subject: [PATCH 247/298] Polish: use single quote --- generators/generator-base-private.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js index ade090c9699b..c4bfcd9b9d01 100644 --- a/generators/generator-base-private.js +++ b/generators/generator-base-private.js @@ -1359,7 +1359,7 @@ module.exports = class extends Generator { this.warning( `Deprecated: JHipster seems to be invoked using Yeoman command. Please use the JHipster CLI. Run ${chalk.red( 'jhipster ' - )} instead of ${chalk.red(`yo jhipster:`)}` + )} instead of ${chalk.red('yo jhipster:')}` ); } } From 61d8023817ddf4e9bec40508d8fe54e8d0ef7df2 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Tue, 2 Jul 2019 15:09:14 +0200 Subject: [PATCH 248/298] Fix indentation [ci skip] --- .../security/oauth2/AuthorizationHeaderUtil.java.ejs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs index 2c5efed21b78..c593d0ab7e9f 100644 --- a/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs +++ b/generators/server/templates/src/main/java/package/security/oauth2/AuthorizationHeaderUtil.java.ejs @@ -68,11 +68,11 @@ public class AuthorizationHeaderUtil { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication instanceof OAuth2AuthenticationToken) { OAuth2AuthenticationToken oauthToken = (OAuth2AuthenticationToken) authentication; - String name = oauthToken.getName(); + String name = oauthToken.getName(); String registrationId = oauthToken.getAuthorizedClientRegistrationId(); OAuth2AuthorizedClient client = clientService.loadAuthorizedClient( - registrationId, - name); + registrationId, + name); if (null == client) { throw new OAuth2AuthorizationException(new OAuth2Error("access_denied", "The token is expired", null)); @@ -110,7 +110,7 @@ public class AuthorizationHeaderUtil { return null; } - OAuth2RefreshToken refreshToken = atr.getRefreshToken() != null? atr.getRefreshToken(): client.getRefreshToken(); + OAuth2RefreshToken refreshToken = atr.getRefreshToken() != null ? atr.getRefreshToken(): client.getRefreshToken(); OAuth2AuthorizedClient updatedClient = new OAuth2AuthorizedClient( client.getClientRegistration(), client.getPrincipalName(), @@ -122,7 +122,7 @@ public class AuthorizationHeaderUtil { return atr.getAccessToken().getTokenValue(); } - private OAuth2AccessTokenResponse refreshTokenClient(OAuth2AuthorizedClient currentClient ) { + private OAuth2AccessTokenResponse refreshTokenClient(OAuth2AuthorizedClient currentClient) { MultiValueMap formParameters = new LinkedMultiValueMap<>(); formParameters.add(OAuth2ParameterNames.GRANT_TYPE, AuthorizationGrantType.REFRESH_TOKEN.getValue()); From e5941edee34db5f123ddc814bac09b564689b8ce Mon Sep 17 00:00:00 2001 From: Panayiotis Vlissidis Date: Tue, 2 Jul 2019 18:58:07 +0300 Subject: [PATCH 249/298] Disable Hibernate cache when cacheProvider is disabled or set to memcached Fix #9933 --- generators/cloudfoundry/index.js | 4 +--- generators/entity/index.js | 3 +-- generators/gae/index.js | 4 +--- generators/generator-base.js | 4 +--- generators/heroku/index.js | 4 +--- generators/server/index.js | 6 +----- 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/generators/cloudfoundry/index.js b/generators/cloudfoundry/index.js index 0a856a7402c7..aebad8df2d33 100644 --- a/generators/cloudfoundry/index.js +++ b/generators/cloudfoundry/index.js @@ -42,9 +42,7 @@ module.exports = class extends BaseGenerator { this.packageName = this.config.get('packageName'); this.packageFolder = this.config.get('packageFolder'); this.cacheProvider = this.config.get('cacheProvider') || this.config.get('hibernateCache') || 'no'; - this.enableHibernateCache = - this.config.get('enableHibernateCache') || - (this.config.get('hibernateCache') !== undefined && this.config.get('hibernateCache') !== 'no'); + this.enableHibernateCache = this.config.get('enableHibernateCache') && !['no', 'memcached'].includes(this.cacheProvider); this.databaseType = this.config.get('databaseType'); this.devDatabaseType = this.config.get('devDatabaseType'); this.prodDatabaseType = this.config.get('prodDatabaseType'); diff --git a/generators/entity/index.js b/generators/entity/index.js index 940c5eaf9ea6..1d5f6520a997 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -159,8 +159,7 @@ class EntityGenerator extends BaseBlueprintGenerator { context.authenticationType = configuration.get('authenticationType'); context.cacheProvider = configuration.get('cacheProvider') || configuration.get('hibernateCache') || 'no'; context.enableHibernateCache = - configuration.get('enableHibernateCache') || - (configuration.get('hibernateCache') !== undefined && configuration.get('hibernateCache') !== 'no'); + configuration.get('enableHibernateCache') && !['no', 'memcached'].includes(context.cacheProvider); context.websocket = configuration.get('websocket') === 'no' ? false : configuration.get('websocket'); context.databaseType = configuration.get('databaseType') || this.getDBTypeFromDBValue(this.options.db); context.prodDatabaseType = configuration.get('prodDatabaseType') || this.options.db; diff --git a/generators/gae/index.js b/generators/gae/index.js index b78b2fc483ea..5629eaa19b34 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -84,9 +84,7 @@ module.exports = class extends BaseGenerator { this.packageName = this.config.get('packageName'); this.packageFolder = this.config.get('packageFolder'); this.cacheProvider = this.config.get('cacheProvider') || this.config.get('hibernateCache') || 'no'; - this.enableHibernateCache = - this.config.get('enableHibernateCache') || - (this.config.get('hibernateCache') !== undefined && this.config.get('hibernateCache') !== 'no'); + this.enableHibernateCache = this.config.get('enableHibernateCache') && !['no', 'memcached'].includes(this.cacheProvider); this.databaseType = this.config.get('databaseType'); this.prodDatabaseType = this.config.get('prodDatabaseType'); this.searchEngine = this.config.get('searchEngine'); diff --git a/generators/generator-base.js b/generators/generator-base.js index ba26218c51a4..5aaa07617e90 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -1922,9 +1922,7 @@ module.exports = class extends PrivateBase { } dest.searchEngine = context.config.get('searchEngine'); dest.cacheProvider = context.config.get('cacheProvider') || context.config.get('hibernateCache') || 'no'; - dest.enableHibernateCache = - context.config.get('enableHibernateCache') || - (context.config.get('hibernateCache') !== undefined && context.config.get('hibernateCache') !== 'no'); + dest.enableHibernateCache = context.config.get('enableHibernateCache') && !['no', 'memcached'].includes(dest.cacheProvider); dest.jhiPrefix = context.configOptions.jhiPrefix || context.config.get('jhiPrefix'); dest.jhiPrefixCapitalized = _.upperFirst(generator.jhiPrefix); dest.jhiPrefixDashed = _.kebabCase(generator.jhiPrefix); diff --git a/generators/heroku/index.js b/generators/heroku/index.js index 58736874127f..2074fe6f2cae 100644 --- a/generators/heroku/index.js +++ b/generators/heroku/index.js @@ -67,9 +67,7 @@ module.exports = class extends BaseGenerator { this.packageName = this.config.get('packageName'); this.packageFolder = this.config.get('packageFolder'); this.cacheProvider = this.config.get('cacheProvider') || this.config.get('hibernateCache') || 'no'; - this.enableHibernateCache = - this.config.get('enableHibernateCache') || - (this.config.get('hibernateCache') !== undefined && this.config.get('hibernateCache') !== 'no'); + this.enableHibernateCache = this.config.get('enableHibernateCache') && !['no', 'memcached'].includes(this.cacheProvider); this.databaseType = this.config.get('databaseType'); this.prodDatabaseType = this.config.get('prodDatabaseType'); this.searchEngine = this.config.get('searchEngine'); diff --git a/generators/server/index.js b/generators/server/index.js index 6fb4403a2bb1..4487a0cfe3bf 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -169,11 +169,7 @@ module.exports = class extends BaseBlueprintGenerator { } this.cacheProvider = configuration.get('cacheProvider') || configuration.get('hibernateCache') || 'no'; - this.enableHibernateCache = - configuration.get('enableHibernateCache') || - (configuration.get('hibernateCache') !== undefined && - configuration.get('hibernateCache') !== 'no' && - configuration.get('hibernateCache') !== 'memcached'); + this.enableHibernateCache = configuration.get('enableHibernateCache') && !['no', 'memcached'].includes(this.cacheProvider); this.databaseType = configuration.get('databaseType'); if (this.databaseType === 'mongodb') { From 9329e0157ae8abc7bac18c91de93f0903901146a Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:46:06 +0100 Subject: [PATCH 250/298] Update mariadb docker image to 10.4.6 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index fa2763c75b1a..04c7b797bd6e 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -21,7 +21,7 @@ const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.2'; const DOCKER_JAVA_JRE = 'adoptopenjdk:11-jre-hotspot'; const DOCKER_MYSQL = 'mysql:8.0.16'; -const DOCKER_MARIADB = 'mariadb:10.4.5'; +const DOCKER_MARIADB = 'mariadb:10.4.6'; const DOCKER_POSTGRESQL = 'postgres:11.3'; const DOCKER_MONGODB = 'mongo:4.0.10'; const DOCKER_COUCHBASE = 'couchbase:6.0.1'; From 90f42eef7f1f1bed6b5d7b17936d764fed6c1d75 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:46:41 +0100 Subject: [PATCH 251/298] Update postgres docker image to 11.4 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 04c7b797bd6e..9f62282883f3 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -22,7 +22,7 @@ const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.2'; const DOCKER_JAVA_JRE = 'adoptopenjdk:11-jre-hotspot'; const DOCKER_MYSQL = 'mysql:8.0.16'; const DOCKER_MARIADB = 'mariadb:10.4.6'; -const DOCKER_POSTGRESQL = 'postgres:11.3'; +const DOCKER_POSTGRESQL = 'postgres:11.4'; const DOCKER_MONGODB = 'mongo:4.0.10'; const DOCKER_COUCHBASE = 'couchbase:6.0.1'; const DOCKER_CASSANDRA = 'cassandra:3.11.4'; From 26845d4c7c07e7b24096159d3d9940053b87d649 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:50:09 +0100 Subject: [PATCH 252/298] Update hazelcast/management-center docker image to 3.12.1 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 9f62282883f3..037ab467ac36 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -27,7 +27,7 @@ const DOCKER_MONGODB = 'mongo:4.0.10'; const DOCKER_COUCHBASE = 'couchbase:6.0.1'; const DOCKER_CASSANDRA = 'cassandra:3.11.4'; const DOCKER_MSSQL = 'microsoft/mssql-server-linux:latest'; -const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12'; +const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12.1'; const DOCKER_MEMCACHED = 'memcached:1.5.16-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project From 5a27994de2860f237511fd2814a741672ac82a04 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:55:26 +0100 Subject: [PATCH 253/298] Update confluentinc/cp-kafka docker image to 5.2.2 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 037ab467ac36..1ba38366f0d0 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -31,7 +31,7 @@ const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12.1'; const DOCKER_MEMCACHED = 'memcached:1.5.16-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project -const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.1'; +const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.2'; const DOCKER_ZOOKEEPER = 'confluentinc/cp-zookeeper:5.2.1'; const DOCKER_SONAR = 'sonarqube:7.7-community'; const DOCKER_JHIPSTER_CONSOLE = 'jhipster/jhipster-console:v4.0.0'; From ec7b4f255115ec3df85ffd8a697602acef36623c Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:56:52 +0100 Subject: [PATCH 254/298] Update confluentinc/cp-zookeeper docker image to 5.2.2 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 1ba38366f0d0..adf2b0cc2056 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -32,7 +32,7 @@ const DOCKER_MEMCACHED = 'memcached:1.5.16-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.2'; -const DOCKER_ZOOKEEPER = 'confluentinc/cp-zookeeper:5.2.1'; +const DOCKER_ZOOKEEPER = 'confluentinc/cp-zookeeper:5.2.2'; const DOCKER_SONAR = 'sonarqube:7.7-community'; const DOCKER_JHIPSTER_CONSOLE = 'jhipster/jhipster-console:v4.0.0'; const DOCKER_JHIPSTER_CURATOR = 'jhipster/jhipster-curator:v4.0.0'; From 9afccb9012fa6a901c087aa191a720f6ddeac4cf Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 22:59:52 +0100 Subject: [PATCH 255/298] Update sonarqube docker image to 7.9-community --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index adf2b0cc2056..2ab29e386ad1 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -33,7 +33,7 @@ const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project const DOCKER_KAFKA = 'confluentinc/cp-kafka:5.2.2'; const DOCKER_ZOOKEEPER = 'confluentinc/cp-zookeeper:5.2.2'; -const DOCKER_SONAR = 'sonarqube:7.7-community'; +const DOCKER_SONAR = 'sonarqube:7.9-community'; const DOCKER_JHIPSTER_CONSOLE = 'jhipster/jhipster-console:v4.0.0'; const DOCKER_JHIPSTER_CURATOR = 'jhipster/jhipster-curator:v4.0.0'; const DOCKER_JHIPSTER_ELASTICSEARCH = 'jhipster/jhipster-elasticsearch:v4.0.0'; From b76fc79cf211bbfcc4e0e6398dc8a974d22a359b Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 23:00:30 +0100 Subject: [PATCH 256/298] Update consul docker image to 1.5.2 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 2ab29e386ad1..73e476d277ec 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -41,7 +41,7 @@ const DOCKER_JHIPSTER_LOGSTASH = 'jhipster/jhipster-logstash:v4.0.0'; const DOCKER_JHIPSTER_IMPORT_DASHBOARDS = 'jhipster/jhipster-import-dashboards:v4.0.0'; const DOCKER_JHIPSTER_ZIPKIN = 'jhipster/jhipster-zipkin:v4.0.0'; const DOCKER_TRAEFIK = 'traefik:1.7.12'; -const DOCKER_CONSUL = 'consul:1.5.1'; +const DOCKER_CONSUL = 'consul:1.5.2'; const DOCKER_CONSUL_CONFIG_LOADER = 'jhipster/consul-config-loader:v0.3.0'; const DOCKER_PROMETHEUS = 'prom/prometheus:v2.10.0'; const DOCKER_PROMETHEUS_ALERTMANAGER = 'prom/alertmanager:v0.17.0'; From 441e0092c00115487f704d85ef243b43dbb35f00 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 23:03:06 +0100 Subject: [PATCH 257/298] Update grafana/grafana docker image to 6.2.5 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 73e476d277ec..8b2060f7186e 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -45,7 +45,7 @@ const DOCKER_CONSUL = 'consul:1.5.2'; const DOCKER_CONSUL_CONFIG_LOADER = 'jhipster/consul-config-loader:v0.3.0'; const DOCKER_PROMETHEUS = 'prom/prometheus:v2.10.0'; const DOCKER_PROMETHEUS_ALERTMANAGER = 'prom/alertmanager:v0.17.0'; -const DOCKER_GRAFANA = 'grafana/grafana:6.2.2'; +const DOCKER_GRAFANA = 'grafana/grafana:6.2.5'; const DOCKER_JENKINS = 'jenkins:latest'; const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest'; const DOCKER_COMPOSE_FORMAT_VERSION = '2'; From 328989d03f248f0c1cd6e65773148474d9b34d87 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 23:04:08 +0100 Subject: [PATCH 258/298] Update quay.io/coreos/prometheus-operator docker image to v0.31.1 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index 8b2060f7186e..e75e321df3da 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -49,7 +49,7 @@ const DOCKER_GRAFANA = 'grafana/grafana:6.2.5'; const DOCKER_JENKINS = 'jenkins:latest'; const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest'; const DOCKER_COMPOSE_FORMAT_VERSION = '2'; -const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.30.1'; +const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.31.1'; const DOCKER_GRAFANA_WATCHER = 'quay.io/coreos/grafana-watcher:v0.0.8'; // Kubernetes versions From 4d81313004d7bb11cbb59d6668197e3bd1776129 Mon Sep 17 00:00:00 2001 From: William Marques Date: Wed, 3 Jul 2019 00:23:29 +0200 Subject: [PATCH 259/298] add acorn dependency and use dynamic import syntax --- generators/client/needle-api/needle-client-angular.js | 4 ++-- generators/client/templates/angular/package.json.ejs | 1 + .../angular/src/main/webapp/app/app-routing.module.ts.ejs | 2 +- generators/client/templates/angular/tsconfig-aot.json.ejs | 2 +- generators/client/templates/angular/tsconfig.json.ejs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/generators/client/needle-api/needle-client-angular.js b/generators/client/needle-api/needle-client-angular.js index ec3e19551dfe..86581d93083a 100644 --- a/generators/client/needle-api/needle-client-angular.js +++ b/generators/client/needle-api/needle-client-angular.js @@ -198,11 +198,11 @@ module.exports = class extends needleClientBase { const splicable = isAnyEntityAlreadyGenerated ? `|,{ | path: '${entityUrl}', - | loadChildren: '${modulePath}#${moduleName}' + | loadChildren: () => import('${modulePath}').then(m => m.${moduleName}) | }` : `|{ | path: '${entityUrl}', - | loadChildren: '${modulePath}#${moduleName}' + | loadChildren: () => import('${modulePath}').then(m => m.${moduleName}) | }`; const rewriteFileModel = this.generateFileModel( entityModulePath, diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 70925c3a4fed..101425eb8f6d 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -75,6 +75,7 @@ <%_ if (protractorTests) { _%> "@types/selenium-webdriver": "4.0.0", <%_ } _%> + "acorn": "^6.1.1", "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", "autoprefixer": "9.6.0", diff --git a/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs index 2c51e042519b..1b86f38f65ea 100644 --- a/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs @@ -32,7 +32,7 @@ const LAYOUT_ROUTES = [ [ { path: 'admin', - loadChildren: './admin/admin.module#<%=angularXAppName%>AdminModule' + loadChildren: () => import('./admin/admin.module').then(m => m.<%=angularXAppName%>AdminModule) }, ...LAYOUT_ROUTES ], diff --git a/generators/client/templates/angular/tsconfig-aot.json.ejs b/generators/client/templates/angular/tsconfig-aot.json.ejs index 591288f63ee9..cb79f447db4f 100644 --- a/generators/client/templates/angular/tsconfig-aot.json.ejs +++ b/generators/client/templates/angular/tsconfig-aot.json.ejs @@ -19,7 +19,7 @@ { "compilerOptions": { "target": "es6", - "module": "es2015", + "module": "esnext", "moduleResolution": "node", "sourceMap": false, "emitDecoratorMetadata": true, diff --git a/generators/client/templates/angular/tsconfig.json.ejs b/generators/client/templates/angular/tsconfig.json.ejs index 11241c940e83..6e4b0672ddaa 100644 --- a/generators/client/templates/angular/tsconfig.json.ejs +++ b/generators/client/templates/angular/tsconfig.json.ejs @@ -19,7 +19,7 @@ { "compilerOptions": { "target": "es6", - "module": "commonjs", + "module": "esnext", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, From d1a55af1c75f777cbd36adbf4fdb54ddc4a5393c Mon Sep 17 00:00:00 2001 From: DanielFran Date: Tue, 2 Jul 2019 23:37:50 +0100 Subject: [PATCH 260/298] Update npm to 6.9.2 See https://github.com/npm/cli/blob/latest/CHANGELOG.md#v692-2019-06-27 --- generators/generator-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generator-constants.js b/generators/generator-constants.js index e75e321df3da..56f82b530d31 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -67,7 +67,7 @@ const JAVA_VERSION = '1.8'; // Java version is forced to be 1.8. We keep the var // version of Node, Yarn, NPM const NODE_VERSION = '10.16.0'; const YARN_VERSION = '1.16.0'; -const NPM_VERSION = '6.9.0'; +const NPM_VERSION = '6.9.2'; // Libraries version const JIB_VERSION = '1.3.0'; From dd5f8fe271dc610a1826394270edf6d47680ce92 Mon Sep 17 00:00:00 2001 From: DanielFran Date: Wed, 3 Jul 2019 00:27:12 +0100 Subject: [PATCH 261/298] Use snapshot JHipster lib version 3.0.4-SNAPSHOT --- generators/server/templates/gradle.properties.ejs | 2 +- generators/server/templates/pom.xml.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/server/templates/gradle.properties.ejs b/generators/server/templates/gradle.properties.ejs index b0a33a325d22..33cee0c0ba96 100644 --- a/generators/server/templates/gradle.properties.ejs +++ b/generators/server/templates/gradle.properties.ejs @@ -25,7 +25,7 @@ npm_version=<%= NPM_VERSION %> yarn_version=<%= YARN_VERSION %> # Dependency versions -jhipster_dependencies_version=3.0.3 +jhipster_dependencies_version=3.0.4-SNAPSHOT # 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.1.6.RELEASE diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs index 13c6e7ea7093..521885b9b00c 100644 --- a/generators/server/templates/pom.xml.ejs +++ b/generators/server/templates/pom.xml.ejs @@ -91,7 +91,7 @@ - 3.0.3 + 3.0.4-SNAPSHOT 2.1.6.RELEASE From cb48739db661362206707ae698517952bdf59a77 Mon Sep 17 00:00:00 2001 From: Arnaud Freismuth Date: Wed, 3 Jul 2019 08:10:44 +0200 Subject: [PATCH 262/298] fix button align gateway component --- .../main/webapp/app/admin/gateway/gateway.component.html.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/gateway/gateway.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/admin/gateway/gateway.component.html.ejs index 51885eae7b75..ba1bf8f523c9 100644 --- a/generators/client/templates/angular/src/main/webapp/app/admin/gateway/gateway.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/admin/gateway/gateway.component.html.ejs @@ -19,7 +19,7 @@

    Gateway -

    From 6ffa99095cd16380faf3b495ccc5a4df02d0488d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Dessoude?= Date: Wed, 3 Jul 2019 14:59:12 +0200 Subject: [PATCH 263/298] fix use of blueprint without skip-checks flag --- generators/app/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/app/index.js b/generators/app/index.js index 8a420c5e58de..b1c71d27ca1e 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -233,7 +233,7 @@ module.exports = class extends BaseGenerator { validateBlueprint() { if (this.blueprints && !this.skipChecks) { - this.blueprints.forEach(e => this.checkBlueprint(e)); + this.blueprints.forEach(e => this.checkBlueprint(e.name)); } }, From eb64887ad14fb03cecde202e4b72a0ed9407c678 Mon Sep 17 00:00:00 2001 From: William Marques Date: Wed, 3 Jul 2019 21:57:56 +0200 Subject: [PATCH 264/298] angular: fix unit test --- test/needle-api/needle-client-angular.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/needle-api/needle-client-angular.spec.js b/test/needle-api/needle-client-angular.spec.js index fd87790f7dbc..d7105e2abddf 100644 --- a/test/needle-api/needle-client-angular.spec.js +++ b/test/needle-api/needle-client-angular.spec.js @@ -169,7 +169,7 @@ describe('needle API Angular: JHipster client generator with blueprint', () => { `${CLIENT_MAIN_SRC_DIR}app/entities/entity.module.ts`, ' {\n' + " path: 'entityUrl',\n" + - " loadChildren: './entityFolderName/entityFileName.module#MicroServiceNameentityNameModule'\n" + + " loadChildren: () => import('./entityFolderName/entityFileName.module').then(m => m.MicroServiceNameentityNameModule)\n" + ' }' ); }); From bdb39286daa6f699094cd9a4a842ee8effbb86fd Mon Sep 17 00:00:00 2001 From: William Marques Date: Wed, 3 Jul 2019 22:18:51 +0200 Subject: [PATCH 265/298] add e2e tsconfig --- generators/client/files-angular.js | 4 ++++ .../angular/src/test/javascript/protractor.conf.js.ejs | 2 +- generators/client/templates/angular/tsconfig.e2e.json.ejs | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 generators/client/templates/angular/tsconfig.e2e.json.ejs diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js index 3c019364a341..725d5c1ee957 100644 --- a/generators/client/files-angular.js +++ b/generators/client/files-angular.js @@ -478,6 +478,10 @@ const files = { 'protractor.conf.js' ] }, + { + condition: generator => generator.protractorTests, + templates: ['tsconfig.e2e.json'] + }, { condition: generator => generator.authenticationType === 'oauth2', path: TEST_SRC_DIR, diff --git a/generators/client/templates/angular/src/test/javascript/protractor.conf.js.ejs b/generators/client/templates/angular/src/test/javascript/protractor.conf.js.ejs index 9bac48c17923..d775ce4f4fa7 100644 --- a/generators/client/templates/angular/src/test/javascript/protractor.conf.js.ejs +++ b/generators/client/templates/angular/src/test/javascript/protractor.conf.js.ejs @@ -53,7 +53,7 @@ exports.config = { beforeLaunch: function() { require('ts-node').register({ - project: '' + project: 'tsconfig.e2e.json' }); }, diff --git a/generators/client/templates/angular/tsconfig.e2e.json.ejs b/generators/client/templates/angular/tsconfig.e2e.json.ejs new file mode 100644 index 000000000000..2c7b284162f4 --- /dev/null +++ b/generators/client/templates/angular/tsconfig.e2e.json.ejs @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs" + } +} From f8d5c8a8a8f19d21cf3a93a46de494aa9fef80b1 Mon Sep 17 00:00:00 2001 From: William Marques Date: Wed, 3 Jul 2019 22:19:37 +0200 Subject: [PATCH 266/298] fix acorn dependency to 6.1.1 --- generators/client/templates/angular/package.json.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 101425eb8f6d..4c5f1ede82c8 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -75,7 +75,7 @@ <%_ if (protractorTests) { _%> "@types/selenium-webdriver": "4.0.0", <%_ } _%> - "acorn": "^6.1.1", + "acorn": "6.1.1", "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", "autoprefixer": "9.6.0", From cbf4e8e8509d7867eadabeff14f9d3aa40c388a7 Mon Sep 17 00:00:00 2001 From: Vivek More Date: Wed, 3 Jul 2019 18:57:06 -0400 Subject: [PATCH 267/298] correct the jsdoc of generated has-any-authority.directive.ts --- .../webapp/app/shared/auth/has-any-authority.directive.ts.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.ts.ejs b/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.ts.ejs index faf09121a4aa..83d125769a0c 100644 --- a/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.ts.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.ts.ejs @@ -25,9 +25,9 @@ import { AccountService } from 'app/core/auth/account.service'; * * @howToUse * ``` - * ... + * HasAnyAuthority="'ROLE_ADMIN'">... * - * ... + * HasAnyAuthority="['ROLE_ADMIN', 'ROLE_USER']">... * ``` */ @Directive({ From 6d7c2d5c91544f8a19887ea79c6c0812170c5075 Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Wed, 3 Jul 2019 13:53:42 +0200 Subject: [PATCH 268/298] [ci skip] document the RFC process and add an RFC template --- CONTRIBUTING.md | 23 +++++++++++- rfcs/0-jhipster-rfc-template.md | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 rfcs/0-jhipster-rfc-template.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc2e0a119701..da61f7d8505e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,7 @@ Are you ready to contribute to JHipster? We'd love to have you on board, and we - [Issues and Bugs](#issue) - [Bug bounties](#bounties) - [Feature Requests](#feature) +- [RFCs](#rfcs) - [Submission Guidelines](#submit) - [Generator development setup](#setup) - [Coding Rules](#rules) @@ -34,9 +35,29 @@ If you submitted a Pull Request that fixes a ticket with the "\$100" tag, then y You can request a new feature by submitting a ticket to our [GitHub issues](https://github.com/jhipster/generator-jhipster/issues). If you would like to implement a new feature then consider what kind of change it is: -- **Major Changes** that you wish to contribute to the project should be discussed first. Please open a ticket which clearly states that it is a feature request in the title and explain clearly what you want to achieve in the description, and the JHipster team will discuss with you what should be done in that ticket. You can then start working on a Pull Request. +- **Major Changes** that you wish to contribute to the project should be discussed first. Please open a ticket which clearly states that it is a feature request in the title and explain clearly what you want to achieve in the description, and the JHipster team will discuss with you what should be done in that ticket. You can then start working on a Pull Request. In order to communicate major changes proposals and receive reviews from the core team, you can also submit an RFC. - **Small Changes** can be proposed without any discussion. Open up a ticket which clearly states that it is a feature request in the title. Explain your change in the description, and you can propose a Pull Request straight away. +##
    RFCs + +Sometimes, major feature requests are "complex" or "substantial". In this case, Github Issues might not be the best tool to to present them because we will need a lot of going back and forth to reach a consensus. + +So we ask that these feature request be put through a formal design process and have their specifications described in an "RFC" (request for comments) that will be validated by the team through a Pull Request Review. + +The RFC process is intended to provide a consistent and controlled path for major features and directions of the project. + +To submit an RFC follow those steps: + +1. Discuss the RFC proposal with the core team through Github issues or other channels +2. Create the initial Github issue for the Feature Request if it doesn't already exist +3. Copy the `rfcs/0-jhipster-rfc-template.md` to `rfcs/${featureRequestIssueNumber}-my-feature-request-name.md` +4. Fill in the RFC, make sure to complete every required section +5. Submit the RFC as a Pull Request with the summary of the proposal in the PR description +6. Build consensus and integrate feedback from the reviewers +7. The Pull Request is either accepted (merged), rejected (closed) or postponed (given an "on hold" status) + +Note: The JHipster RFC process is inspired by [Rust RFCs](https://rust-lang.github.io/rfcs/). + ## Submission Guidelines ### [Submitting an Issue](https://opensource.guide/how-to-contribute/#opening-an-issue) diff --git a/rfcs/0-jhipster-rfc-template.md b/rfcs/0-jhipster-rfc-template.md new file mode 100644 index 000000000000..59d006c0a2f2 --- /dev/null +++ b/rfcs/0-jhipster-rfc-template.md @@ -0,0 +1,65 @@ +// This is a RFC template based on the Rust RFC process but simplified: https://github.com/rust-lang/rfcs/ + +- Feature Name: (fill me in with a unique ident, `my_awesome_feature`) +- Start Date: (fill me in with today's date, YYYY-MM-DD) +- Issue: [jhipster/generator-jhipster#0000](https://github.com/jhipster/generator-jhipster/0000) + +# Summary +[summary]: #summary + +One paragraph explanation of the feature. + +# Motivation +[motivation]: #motivation + +Why are we doing this? What use cases does it support? What is the expected outcome? + +# Guide-level explanation +[guide-level-explanation]: #guide-level-explanation + +Explain the proposal as if it was already included in JHipster and you were teaching it to someone. That generally means: + +- Introducing new named concepts. +- Explaining the feature largely in terms of examples. + +# Reference-level explanation +[reference-level-explanation]: #reference-level-explanation + +This is the technical portion of the RFC. Explain the design in sufficient detail that: + +- Its interaction with other features is clear. +- It is reasonably clear how the feature would be implemented. +- Corner cases are dissected by example. + +The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work. + +# Drawbacks +[drawbacks]: #drawbacks + +Why should we *not* do this? + +# Rationale and alternatives +[rationale-and-alternatives]: #rationale-and-alternatives + +- Why is this design the best in the space of possible designs? +- What other designs have been considered and what is the rationale for not choosing them? +- What is the impact of not doing this? + +# Prior art +[prior-art]: #prior-art + +Discuss prior art, both the good and the bad, in relation to this proposal. + +# Unresolved questions +[unresolved-questions]: #unresolved-questions + +- What are the limits of the proposal and define what is out of scope for now. + +# Future possibilities +[future-possibilities]: #future-possibilities + +Think about what the natural extension and evolution of your proposal would +be. + +This is also a good place to "dump ideas", if they are out of scope for the +RFC you are writing but otherwise related. From c241ac234976ee8efdba2d8adb759c97fe42556e Mon Sep 17 00:00:00 2001 From: cbornet Date: Thu, 4 Jul 2019 12:20:50 +0200 Subject: [PATCH 269/298] Fix pagination link generation Fix #9690 Fix #10008 --- .../java/package/common/get_all_template.ejs | 14 +++++++------- .../java/package/common/search_template.ejs | 4 ++-- .../package/web/rest/EntityResource.java.ejs | 7 ++++++- .../package/web/rest/AuditResource.java.ejs | 17 ++++++++++++----- .../java/package/web/rest/UserResource.java.ejs | 15 ++++++++++----- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs b/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs index 5212b7169893..8b31e222ef27 100644 --- a/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +++ b/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs @@ -23,14 +23,14 @@ const entityListToDtoListReference = mapper + '.' + 'toDto'; const entityToDtoReference = mapper + '::'+ 'toDto'; if (jpaMetamodelFiltering) { %> - public ResponseEntity>> getAll<%= entityClassPlural %>(<%= entityClass %>Criteria criteria<% if (pagination != 'no') { %>, Pageable pageable, @RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder<% } %>) { + public ResponseEntity>> getAll<%= entityClassPlural %>(<%= entityClass %>Criteria criteria<% if (pagination != 'no') { %>, Pageable pageable<% if (reactive) { %>, ServerHttpRequest request<% } %><% } %>) { log.debug("REST request to get <%= entityClassPlural %> by criteria: {}", criteria); <%_ if (pagination === 'no') { _%> List<<%= instanceType %>> entityList = <%= entityInstance %>QueryService.findByCriteria(criteria); return ResponseEntity.ok().body(entityList); <%_ } else { _%> Page<<%= instanceType %>> page = <%= entityInstance %>QueryService.findByCriteria(criteria, pageable); - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); return ResponseEntity.ok().headers(headers).body(page.getContent()); <%_ } _%> } @@ -55,7 +55,7 @@ return <%= entityListToDtoListReference %>(<%= entityInstancePlural %>);<% } else { %> return <%= entityInstance %>Repository.<% if (fieldsContainOwnerManyToMany) { %>findAllWithEagerRelationships<% } else { %>findAll<% } %>();<% } %> <%_ } if (pagination !== 'no') { _%> - public ResponseEntity>> getAll<%= entityClassPlural %>(Pageable pageable, @RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder<% if (fieldsContainNoOwnerOneToOne) { %>, @RequestParam(required = false) String filter<% } %><% if (fieldsContainOwnerManyToMany) { %>, @RequestParam(required = false, defaultValue = "false") boolean eagerload<% } %>) {<%- include('get_all_stream_template', {viaService: viaService}); -%> + public ResponseEntity>> getAll<%= entityClassPlural %>(Pageable pageable<% if (reactive) { %>, ServerHttpRequest request<% } %><% if (fieldsContainNoOwnerOneToOne) { %>, @RequestParam(required = false) String filter<% } %><% if (fieldsContainOwnerManyToMany) { %>, @RequestParam(required = false, defaultValue = "false") boolean eagerload<% } %>) {<%- include('get_all_stream_template', {viaService: viaService}); -%> log.debug("REST request to get a page of <%= entityClassPlural %>"); <%_ if (viaService) { _%> <%_ if (fieldsContainOwnerManyToMany) { _%> @@ -65,10 +65,10 @@ } else { page = <%= entityInstance %>Service.findAll(pageable); } - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); <%_ } else { _%> Page<<%= instanceType %>> page = <%= entityInstance %>Service.findAll(pageable); - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); <%_ } _%> <%_ } else { _%> <%_ if (fieldsContainOwnerManyToMany) { _%> @@ -78,10 +78,10 @@ } else { page = <%= entityInstance %>Repository.findAll(pageable)<% if (dto !== 'mapstruct') { %>;<% } else { %>.map(<%= entityToDtoReference %>);<% } %> } - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); <%_ } else { _%> Page<<%= instanceType %>> page = <%= entityInstance %>Repository.findAll(pageable)<% if (dto !== 'mapstruct') { %>;<% } else { %>.map(<%= entityToDtoReference %>);<% } %> - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); <%_ } _%> <%_ } _%> return ResponseEntity.ok().headers(headers).body(page.getContent()); diff --git a/generators/entity-server/templates/src/main/java/package/common/search_template.ejs b/generators/entity-server/templates/src/main/java/package/common/search_template.ejs index 1a2faf49c3e1..a0663eb0966a 100644 --- a/generators/entity-server/templates/src/main/java/package/common/search_template.ejs +++ b/generators/entity-server/templates/src/main/java/package/common/search_template.ejs @@ -26,11 +26,11 @@ public List<<%= instanceType %>> search<%= entityClassPlural %>(@RequestParam String query) { log.debug("REST request to search <%= entityClassPlural %> for query {}", query);<%- include('search_stream_template', {viaService: viaService}); -%> <% } if (pagination !== 'no') { %> - public ResponseEntity>> search<%= entityClassPlural %>(@RequestParam String query, Pageable pageable, @RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder) { + public ResponseEntity>> search<%= entityClassPlural %>(@RequestParam String query, Pageable pageable<% if (reactive) { %>, ServerHttpRequest request<% } %>) { log.debug("REST request to search for a page of <%= entityClassPlural %> for query {}", query);<% if (viaService) { %> Page<<%= instanceType %>> page = <%= entityInstance %>Service.search(query, pageable);<% } else { %> Page<<%= asEntity(entityClass) %>> page = <%= entityInstance %>SearchRepository.search(queryStringQuery(query), pageable);<% } %> - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); return ResponseEntity.ok().headers(headers).body(<% if (!viaService && dto === 'mapstruct') { %><%= entityListToDtoListReference %>(<% } %>page.getContent()<% if (!viaService && dto === 'mapstruct') { %>)<% } %>); <% } -%> } diff --git a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs index 189aaf7c8d96..34ef08a322b2 100644 --- a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs @@ -73,8 +73,13 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; + <%_ if (reactive) { _%> +import org.springframework.http.server.reactive.ServerHttpRequest; + <%_ } _%> import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; + <%_ if (!reactive) { _%> +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + <%_ } _%> <%_ } _%> <%_ if (reactiveRepositories) { _%> import org.springframework.http.MediaType; diff --git a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs index 58d3ec82ffe5..ea8afad92342 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs @@ -28,9 +28,14 @@ import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +<%_ if (reactive) { _%> +import org.springframework.http.server.reactive.ServerHttpRequest; +<%_ } _%> import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriComponentsBuilder; +<%_ if (!reactive) { _%> +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; +<%_ } _%> import java.time.LocalDate; import java.time.ZoneId; @@ -58,9 +63,9 @@ public class AuditResource { * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of {@link AuditEvent}s in body. */ @GetMapping - public ResponseEntity> getAll(@RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder, Pageable pageable) { + public ResponseEntity> getAll(<% if (reactive) { %>ServerHttpRequest request, <% } %>Pageable pageable) { Page page = auditEventService.findAll(pageable); - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } @@ -78,14 +83,16 @@ public class AuditResource { public ResponseEntity> getByDates( @RequestParam(value = "fromDate") LocalDate fromDate, @RequestParam(value = "toDate") LocalDate toDate, - @RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder, + <%_ if (reactive) { _%> + ServerHttpRequest request, + <%_ } _%> Pageable pageable) { Page page = auditEventService.findByDates( fromDate.atStartOfDay(ZoneId.systemDefault()).toInstant(), toDate.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant(), pageable); - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(<% if (!reactive) { %>ServletUriComponentsBuilder.fromCurrentRequest()<% } else { %>UriComponentsBuilder.fromHttpRequest(request)<% } %>, page); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } diff --git a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs index b7b1f3001acf..37d4af5922b4 100644 --- a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs @@ -64,10 +64,15 @@ import org.springframework.http.HttpHeaders; <%_ } _%> import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +<%_ if (reactive) { _%> +import org.springframework.http.server.reactive.ServerHttpRequest; +<%_ } _%> import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriComponentsBuilder; +<%_ if (!reactive) { _%> +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; +<%_ } _%> <%_ if (reactive) { _%> import org.springframework.web.server.ResponseStatusException; import reactor.core.publisher.Flux; @@ -280,15 +285,15 @@ public class UserResource { @GetMapping("/users") <%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%> <%_ if (!reactive) { _%> - public ResponseEntity>> getAllUsers(@RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder, Pageable pageable) { + public ResponseEntity>> getAllUsers(Pageable pageable) { final Page<<%= asDto('User') %>> page = userService.getAllManagedUsers(pageable); - HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); <%_ } else { _%> - public Mono>>> getAllUsers(@RequestParam MultiValueMap queryParams, UriComponentsBuilder uriBuilder, Pageable pageable) { + public Mono>>> getAllUsers(ServerHttpRequest request, Pageable pageable) { return userService.countManagedUsers() .map(total -> new PageImpl<>(new ArrayList<>(), pageable, total)) - .map(page -> PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page)) + .map(page -> PaginationUtil.generatePaginationHttpHeaders(UriComponentsBuilder.fromHttpRequest(request), page)) .map(headers -> ResponseEntity.ok().headers(headers).body(userService.getAllManagedUsers(pageable))); <%_ } _%> } From 1375cfdadad531cfeaae0dc4d33dc3cdaef6d5c6 Mon Sep 17 00:00:00 2001 From: cbornet Date: Thu, 4 Jul 2019 13:07:11 +0200 Subject: [PATCH 270/298] Fix javadoc --- .../package/web/rest/EntityResource.java.ejs | 19 +++++++++++++------ .../package/web/rest/AuditResource.java.ejs | 10 ++++++---- .../package/web/rest/UserResource.java.ejs | 5 +++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs index 34ef08a322b2..d1ed4222e40d 100644 --- a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs @@ -187,10 +187,14 @@ public class <%= entityClass %>Resource { /** * {@code GET /<%= entityApiUrl %>} : get all the <%= entityInstancePlural %>. - *<% if (pagination !== 'no') { %> + * + <%_ if (pagination !== 'no') { %> * @param pageable the pagination information. - * @param queryParams a {@link MultiValueMap} query parameters. - * @param uriBuilder a {@link UriComponentsBuilder} URI builder.<% } if (!jpaMetamodelFiltering && fieldsContainOwnerManyToMany) { %> + <%_ if (reactive) { _%> + * @param request a {@link ServerHttpRequest} request. + <%_ } _%> + <%_ } _%> + <%_ if (!jpaMetamodelFiltering && fieldsContainOwnerManyToMany) { _%> * @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).<% } if (jpaMetamodelFiltering) { %> * @param criteria the criteria which the requested entities should match.<% } else if (fieldsContainNoOwnerOneToOne) { %> * @param filter the filter of the request.<% } %> @@ -250,10 +254,13 @@ public class <%= entityClass %>Resource { * {@code SEARCH /_search/<%= entityApiUrl %>?query=:query} : search for the <%= entityInstance %> corresponding * to the query. * - * @param query the query of the <%= entityInstance %> search.<% if (pagination !== 'no') { %> + * @param query the query of the <%= entityInstance %> search. + <%_ if (pagination !== 'no') { _%> * @param pageable the pagination information. - * @param queryParams a {@link MultiValueMap} query parameters. - * @param uriBuilder a {@link UriComponentsBuilder} URI builder.<% } %> + <%_ if (reactive) { _%> + * @param request a {@link ServerHttpRequest} request. + <%_ } _%> + <%_ } _%> * @return the result of the search. */ @GetMapping("/_search/<%= entityApiUrl %>")<%- include('../../common/search_template', {asEntity, asDto, viaService}); -%><% } %> diff --git a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs index ea8afad92342..718ef941ff7b 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs @@ -57,8 +57,9 @@ public class AuditResource { /** * {@code GET /audits} : get a page of {@link AuditEvent}s. * - * @param queryParams a {@link MultiValueMap} query parameters. - * @param uriBuilder a {@link UriComponentsBuilder} URI builder. + <%_ if (reactive) { _%> + * @param request a {@link ServerHttpRequest} request. + <%_ } _%> * @param pageable the pagination information. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of {@link AuditEvent}s in body. */ @@ -74,8 +75,9 @@ public class AuditResource { * * @param fromDate the start of the time period of {@link AuditEvent} to get. * @param toDate the end of the time period of {@link AuditEvent} to get. - * @param queryParams a {@link MultiValueMap} query parameters. - * @param uriBuilder a {@link UriComponentsBuilder} URI builder. + <%_ if (reactive) { _%> + * @param request a {@link ServerHttpRequest} request. + <%_ } _%> * @param pageable the pagination information. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of {@link AuditEvent} in body. */ diff --git a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs index 37d4af5922b4..50e936d14eb6 100644 --- a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs @@ -277,8 +277,9 @@ public class UserResource { /** * {@code GET /users} : get all users. *<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %> - * @param queryParams a {@link MultiValueMap} query parameters. - * @param uriBuilder a {@link UriComponentsBuilder} URI builder. + <%_ if (reactive) { _%> + * @param request a {@link ServerHttpRequest} request. + <%_ } _%> * @param pageable the pagination information.<% } %> * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body all users. */ From 1ac8c97adff4a1d0d6b0b30562f1390ddd562b30 Mon Sep 17 00:00:00 2001 From: William Marques Date: Thu, 4 Jul 2019 13:59:57 +0200 Subject: [PATCH 271/298] Add comment for acorn dependency --- generators/client/templates/angular/package.json.ejs | 5 +++++ package-lock.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 4c5f1ede82c8..4d26ea26fca8 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -75,6 +75,11 @@ <%_ if (protractorTests) { _%> "@types/selenium-webdriver": "4.0.0", <%_ } _%> +<%# +The acorn dependency is added in order to fix a webpack/NPM issue: +Please see: https://github.com/webpack/webpack/issues/8656 +Remove it once the issue is closed +-%> "acorn": "6.1.1", "angular-router-loader": "0.8.5", "angular2-template-loader": "0.6.2", diff --git a/package-lock.json b/package-lock.json index 3490a848f847..d083dbe1b8d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-jhipster", - "version": "6.1.1", + "version": "6.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { From f58497ba736eeb36fc65df78eed36c5c5f923d8a Mon Sep 17 00:00:00 2001 From: cbornet Date: Thu, 4 Jul 2019 15:37:53 +0200 Subject: [PATCH 272/298] Fix missing import for reactive --- .../src/main/java/package/web/rest/EntityResource.java.ejs | 2 ++ .../src/main/java/package/web/rest/AuditResource.java.ejs | 2 ++ .../src/main/java/package/web/rest/UserResource.java.ejs | 1 + 3 files changed, 5 insertions(+) diff --git a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs index d1ed4222e40d..9cdbb7646f86 100644 --- a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs @@ -79,6 +79,8 @@ import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.util.MultiValueMap; <%_ if (!reactive) { _%> import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + <%_ } else { _%> +import org.springframework.web.util.UriComponentsBuilder; <%_ } _%> <%_ } _%> <%_ if (reactiveRepositories) { _%> diff --git a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs index 718ef941ff7b..10cc8392cf61 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs @@ -35,6 +35,8 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; <%_ if (!reactive) { _%> import org.springframework.web.servlet.support.ServletUriComponentsBuilder; +<%_ } else { _%> +import org.springframework.web.util.UriComponentsBuilder; <%_ } _%> import java.time.LocalDate; diff --git a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs index 50e936d14eb6..7297cde946e0 100644 --- a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs @@ -75,6 +75,7 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; <%_ } _%> <%_ if (reactive) { _%> import org.springframework.web.server.ResponseStatusException; +import org.springframework.web.util.UriComponentsBuilder; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; <%_ } _%> From 1c53d40227c542897930d19d30ed5c1ba0ff3d54 Mon Sep 17 00:00:00 2001 From: Jonathan Ruddell Date: Thu, 4 Jul 2019 10:19:21 -0400 Subject: [PATCH 273/298] allow data uris as font source via csp related to #9834 --- .../src/main/java/package/config/SecurityConfiguration.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs index 6858cb182170..8e69310ca78f 100644 --- a/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +++ b/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs @@ -226,7 +226,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { <%_ } _%> .and() .headers() - .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:") + .contentSecurityPolicy("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:") .and() .referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN) .and() From cd926011ba3c58f5064bb19af38aa599512ca7a4 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 4 Jul 2019 17:37:04 +0200 Subject: [PATCH 274/298] Fix Gatling tests for OAuth2 Microservices --- .../user-files/simulations/EntityGatlingTest.scala.ejs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/entity-server/templates/src/test/gatling/user-files/simulations/EntityGatlingTest.scala.ejs b/generators/entity-server/templates/src/test/gatling/user-files/simulations/EntityGatlingTest.scala.ejs index df652155245a..78989824fbb6 100644 --- a/generators/entity-server/templates/src/test/gatling/user-files/simulations/EntityGatlingTest.scala.ejs +++ b/generators/entity-server/templates/src/test/gatling/user-files/simulations/EntityGatlingTest.scala.ejs @@ -123,7 +123,7 @@ class <%= entityClass %>GatlingTest extends Simulation { .formParam("submit", "Login") .check(headerRegex("Set-Cookie", "XSRF-TOKEN=(.*);[\\s]").saveAs("xsrf_token"))).exitHereIfFailed <%_ } else if (authenticationType === 'oauth2') { _%> - .get("/login") + .get("/oauth2/authorization/oidc") .check(status.is(302)) .check(header("Location").saveAs("loginUrl"))).exitHereIfFailed .pause(2) @@ -178,12 +178,12 @@ class <%= entityClass %>GatlingTest extends Simulation { .pause(10) .repeat(2) { exec(http("Get all <%= entityInstancePlural %>") - .get("<% if (applicationType === 'microservice') {%>/<%= baseName.toLowerCase() %><% } %>/api/<%= entityApiUrl %>") + .get("<% if (applicationType === 'microservice') {%>/services/<%= baseName.toLowerCase() %><% } %>/api/<%= entityApiUrl %>") .headers(headers_http_authenticated) .check(status.is(200))) .pause(10 seconds, 20 seconds) .exec(http("Create new <%= entityInstance %>") - .post("<% if (applicationType === 'microservice') {%>/<%= baseName.toLowerCase() %><% } %>/api/<%= entityApiUrl %>") + .post("<% if (applicationType === 'microservice') {%>/services/<%= baseName.toLowerCase() %><% } %>/api/<%= entityApiUrl %>") .headers(headers_http_authenticated) .body(StringBody("""{ "id":null @@ -196,12 +196,12 @@ class <%= entityClass %>GatlingTest extends Simulation { .pause(10) .repeat(5) { exec(http("Get created <%= entityInstance %>") - .get("<% if (applicationType === 'microservice') {%>/<%= baseName.toLowerCase() %><% } %>${new_<%= entityInstance %>_url}") + .get("<% if (applicationType === 'microservice') {%>/services/<%= baseName.toLowerCase() %><% } %>${new_<%= entityInstance %>_url}") .headers(headers_http_authenticated)) .pause(10) } .exec(http("Delete created <%= entityInstance %>") - .delete("<% if (applicationType === 'microservice') {%>/<%= baseName.toLowerCase() %><% } %>${new_<%= entityInstance %>_url}") + .delete("<% if (applicationType === 'microservice') {%>/services/<%= baseName.toLowerCase() %><% } %>${new_<%= entityInstance %>_url}") .headers(headers_http_authenticated)) .pause(10) } From 837deea2484e229f5b43efe62e64f709ac9acc2f Mon Sep 17 00:00:00 2001 From: cbornet Date: Fri, 5 Jul 2019 13:58:32 +0200 Subject: [PATCH 275/298] Remove useless MultiValueMap import --- .../src/main/java/package/web/rest/EntityResource.java.ejs | 1 - .../src/main/java/package/web/rest/AuditResource.java.ejs | 1 - .../src/main/java/package/web/rest/UserResource.java.ejs | 1 - 3 files changed, 3 deletions(-) diff --git a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs index 9cdbb7646f86..d43828e2d02b 100644 --- a/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +++ b/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs @@ -76,7 +76,6 @@ import org.springframework.http.HttpStatus; <%_ if (reactive) { _%> import org.springframework.http.server.reactive.ServerHttpRequest; <%_ } _%> -import org.springframework.util.MultiValueMap; <%_ if (!reactive) { _%> import org.springframework.web.servlet.support.ServletUriComponentsBuilder; <%_ } else { _%> diff --git a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs index 10cc8392cf61..6554d2256aa0 100644 --- a/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/AuditResource.java.ejs @@ -31,7 +31,6 @@ import org.springframework.http.ResponseEntity; <%_ if (reactive) { _%> import org.springframework.http.server.reactive.ServerHttpRequest; <%_ } _%> -import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; <%_ if (!reactive) { _%> import org.springframework.web.servlet.support.ServletUriComponentsBuilder; diff --git a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs index 7297cde946e0..c27805cfc256 100644 --- a/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +++ b/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs @@ -68,7 +68,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.server.reactive.ServerHttpRequest; <%_ } _%> import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; <%_ if (!reactive) { _%> import org.springframework.web.servlet.support.ServletUriComponentsBuilder; From 308ba91446155e67f65cd0d56655b129e8bd88f4 Mon Sep 17 00:00:00 2001 From: Arnaud Freismuth Date: Fri, 5 Jul 2019 16:06:04 +0200 Subject: [PATCH 276/298] make app.yml coherent with extends consul --- .../templates/src/main/docker/app.yml.ejs | 23 +++++-------------- .../templates/src/main/docker/consul.yml.ejs | 4 ++++ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/generators/server/templates/src/main/docker/app.yml.ejs b/generators/server/templates/src/main/docker/app.yml.ejs index 1c6a63c4134a..c9698c76e310 100644 --- a/generators/server/templates/src/main/docker/app.yml.ejs +++ b/generators/server/templates/src/main/docker/app.yml.ejs @@ -178,25 +178,14 @@ services: <%_ } _%> <%_ if (serviceDiscoveryType === 'consul') { _%> consul: - image: <%= DOCKER_CONSUL %> - command: consul agent -dev -ui -client 0.0.0.0 - ports: - - 8300:8300 - - 8500:8500 - - 8600:8600 + extends: + file: consul.yml + service: consul consul-config-loader: - image: <%= DOCKER_CONSUL_CONFIG_LOADER %> - volumes: - - ./central-server-config:/config - environment: - - INIT_SLEEP_SECONDS=5 - - CONSUL_URL=consul - - CONSUL_PORT=8500 - # Uncomment to load configuration into Consul from a Git repository - # as configured in central-server-config/git2consul.json - # Also set SPRING_CLOUD_CONSUL_CONFIG_FORMAT=files on your apps - # - CONFIG_MODE=git + extends: + file: consul.yml + service: consul-config-loader <%_ } _%> <%_ if (authenticationType === 'oauth2' && applicationType !== 'microservice') { _%> keycloak: diff --git a/generators/server/templates/src/main/docker/consul.yml.ejs b/generators/server/templates/src/main/docker/consul.yml.ejs index f537e0c4d321..06d40bc5b3c2 100644 --- a/generators/server/templates/src/main/docker/consul.yml.ejs +++ b/generators/server/templates/src/main/docker/consul.yml.ejs @@ -34,3 +34,7 @@ services: - INIT_SLEEP_SECONDS=5 - CONSUL_URL=consul - CONSUL_PORT=8500 + # Uncomment to load configuration into Consul from a Git repository + # as configured in central-server-config/git2consul.json + # Also set SPRING_CLOUD_CONSUL_CONFIG_FORMAT=files on your apps + # - CONFIG_MODE=git \ No newline at end of file From cc9161a0eb54067dd72ee5251e85e82f02c0aa57 Mon Sep 17 00:00:00 2001 From: MathieuAA Date: Fri, 5 Jul 2019 19:51:07 +0200 Subject: [PATCH 277/298] Updated JCore's dep to v4.2.0 --- package-lock.json | 21 +++++++++++++-------- package.json | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3490a848f847..9190b0a46625 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2689,25 +2689,30 @@ } }, "jhipster-core": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-4.0.2.tgz", - "integrity": "sha512-E7TEK/Jgql2f1G9SHDR2tTng4r4oo8uX1YtZ9C2VWWaYHB3YrEist2F9XTLEg0mO6jPyokLvcXKSH51WGzYTYw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/jhipster-core/-/jhipster-core-4.2.0.tgz", + "integrity": "sha512-IcppfMsIz8+5eBU8BztQ7MXNVSjflOxVCj60ugd+3CN22pcUX+tIZ9pm9DOQW4DeD3Uu2X2aY08FPj3MKD9O8A==", "requires": { "chevrotain": "4.4.0", - "fs-extra": "8.0.1", + "fs-extra": "8.1.0", "lodash": "4.17.11", "winston": "3.2.1" }, "dependencies": { "fs-extra": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz", - "integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" } } }, diff --git a/package.json b/package.json index eeb7a96431be..d4c133c2f75b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "glob": "7.1.3", "gulp-filter": "5.1.0", "insight": "0.10.1", - "jhipster-core": "4.0.2", + "jhipster-core": "4.2.0", "js-object-pretty-print": "0.3.0", "js-yaml": "3.13.1", "lodash": "4.17.11", From ac9f3cced79c692ceabd8b56e5ce76855ad6be25 Mon Sep 17 00:00:00 2001 From: MathieuAA Date: Fri, 5 Jul 2019 22:04:59 +0200 Subject: [PATCH 278/298] Updated the JDL export Now exports single & multi application/s (plus entities) --- .github/FUNDING.yml | 2 +- generators/export-jdl/index.js | 21 +++++++++------------ test/export-jdl.spec.js | 6 +++--- test/needle-api/needle-client-react.spec.js | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 7efb418ba1d5..27ad37a22cfc 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ open_collective: generator-jhipster -custom: https://www.jhipster.tech/sponsors/ \ No newline at end of file +custom: https://www.jhipster.tech/sponsors/ diff --git a/generators/export-jdl/index.js b/generators/export-jdl/index.js index 4af4f5aa291e..4728d195f987 100644 --- a/generators/export-jdl/index.js +++ b/generators/export-jdl/index.js @@ -17,7 +17,9 @@ * limitations under the License. */ const chalk = require('chalk'); +const JCore = require('jhipster-core'); const BaseGenerator = require('../generator-base'); +const { logger } = require('../utils'); const statistics = require('../statistics'); module.exports = class extends BaseGenerator { @@ -31,7 +33,6 @@ module.exports = class extends BaseGenerator { type: Boolean, defaults: false }); - this.jdlFile = this.options.jdlFile; } get default() { @@ -44,21 +45,17 @@ module.exports = class extends BaseGenerator { statistics.sendSubGenEvent('generator', 'export-jdl'); }, - parseJson() { - this.log('Parsing entities from .jhipster dir...'); - this.jdl = this.generateJDLFromEntities(); + convertToJDL() { + try { + JCore.convertToJDL(); + } catch (error) { + logger.error(`An error occurred while exporting to JDL: ${error.message}\n${error}`); + } } }; } - writing() { - const content = `// JDL definition for application '${ - this.baseName - }' generated with command 'jhipster export-jdl'\n\n${this.jdl.toString()}`; - this.fs.write(this.jdlFile, content); - } - end() { - this.log(chalk.green.bold('\nEntities successfully exported to JDL file\n')); + this.log(chalk.green.bold('\nThe JDL export is complete!\n')); } }; diff --git a/test/export-jdl.spec.js b/test/export-jdl.spec.js index 4ae34f933e20..b557e1da6634 100644 --- a/test/export-jdl.spec.js +++ b/test/export-jdl.spec.js @@ -15,7 +15,7 @@ describe('JHipster generator export jdl', () => { }); it('creates the jdl file based on app name', () => { - assert.file('standard.jh'); + assert.file('app.jdl'); }); }); @@ -26,12 +26,12 @@ describe('JHipster generator export jdl', () => { .inTmpDir(dir => { fse.copySync(path.join(__dirname, '../test/templates/export-jdl'), dir); }) - .withArguments('jdl.jdl') + .withArguments('app.jdl') .on('end', done); }); it('creates the jdl file', () => { - assert.file('jdl.jdl'); + assert.file('app.jdl'); }); }); }); diff --git a/test/needle-api/needle-client-react.spec.js b/test/needle-api/needle-client-react.spec.js index 7cb018a68544..b5ebc336a76d 100644 --- a/test/needle-api/needle-client-react.spec.js +++ b/test/needle-api/needle-client-react.spec.js @@ -101,7 +101,7 @@ describe('needle API React: JHipster client generator with blueprint', () => { const indexReducerPath = `${CLIENT_MAIN_SRC_DIR}app/shared/reducers/index.ts`; assert.fileContent(indexModulePath, "import entityName from './entityFolderName';"); - assert.fileContent(indexModulePath, ''); // eslint-disable-line + assert.fileContent(indexModulePath, ''); // eslint-disable-line assert.fileContent( indexReducerPath, From 96df01471f2bbf8e9f0f15491c52d22038d7096c Mon Sep 17 00:00:00 2001 From: Theo LEBRUN Date: Fri, 5 Jul 2019 17:48:33 -0400 Subject: [PATCH 279/298] Add validation for database name and update instance types and regions --- generators/aws/prompts.js | 56 +++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/generators/aws/prompts.js b/generators/aws/prompts.js index c2a6f14649aa..7b419e8e9a28 100644 --- a/generators/aws/prompts.js +++ b/generators/aws/prompts.js @@ -51,6 +51,12 @@ function prompting() { { type: 'input', name: 'dbName', + validate: input => { + if (!/^[a-zA-Z][a-zA-Z0-9]*$/g.test(input)) { + return 'Your database name must begin with a letter and contain only alphanumeric characters'; + } + return true; + }, message: 'Database name:', default: this.baseName }, @@ -81,22 +87,22 @@ function prompting() { 't2.micro', 't2.small', 't2.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge' + 't2.large', + 'm5.large', + 'm5.xlarge', + 'm5.2xlarge', + 'c5.large', + 'c5.xlarge', + 'c5.2xlarge', + 'c5.4xlarge', + 'c5.8xlarge', + 'i3.xlarge', + 'i3.2xlarge', + 'i3.4xlarge', + 'i3.8xlarge', + 'r5.large', + 'r5.xlarge', + 'r5.2xlarge' ], default: 0 }, @@ -105,14 +111,6 @@ function prompting() { name: 'dbInstanceClass', message: 'On which RDS instance class do you want to deploy?', choices: [ - 'db.t1.micro', - 'db.m1.small', - 'db.m1.medium', - 'db.m1.large', - 'db.m1.xlarge', - 'db.m2.xlarge ', - 'db.m2.2xlarge', - 'db.m2.4xlarge', 'db.m3.medium', 'db.m3.large', 'db.m3.xlarge', @@ -126,7 +124,7 @@ function prompting() { 'db.t2.small', 'db.t2.medium' ], - default: 17 + default: 9 }, { type: 'list', @@ -134,17 +132,23 @@ function prompting() { message: 'On which region do you want to deploy?', choices: [ 'ap-northeast-1', + 'ap-northeast-2', + 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', + 'ca-central-1', 'eu-central-1', + 'eu-north-1', 'eu-west-1', 'eu-west-2', + 'eu-west-3', 'sa-east-1', 'us-east-1', + 'us-east-2', 'us-west-1', 'us-west-2' ], - default: 3 + default: 6 } ]; From 316f5e37f5f8508643df0796c9b429a40ff0e7de Mon Sep 17 00:00:00 2001 From: Theo LEBRUN Date: Fri, 5 Jul 2019 17:50:07 -0400 Subject: [PATCH 280/298] Deploy a War instead of a Jar with Elastic Beanstalk --- generators/aws/index.js | 14 +++++++------- generators/aws/lib/eb.js | 10 +++++----- generators/aws/lib/s3.js | 24 +++++++++++------------- generators/cloudfoundry/index.js | 2 +- generators/generator-base.js | 13 +++++++++++-- generators/heroku/index.js | 2 +- 6 files changed, 36 insertions(+), 29 deletions(-) diff --git a/generators/aws/index.js b/generators/aws/index.js index d769415ec7d2..54aea44b7de5 100644 --- a/generators/aws/index.js +++ b/generators/aws/index.js @@ -114,7 +114,7 @@ module.exports = class extends BaseGenerator { const cb = this.async(); this.log(chalk.bold('Building application')); - const child = this.buildApplication(this.buildTool, 'prod', err => { + const child = this.buildApplication(this.buildTool, 'prod', true, err => { if (err) { this.error(err); } else { @@ -123,7 +123,7 @@ module.exports = class extends BaseGenerator { }); child.stdout.on('data', data => { - this.log(data.toString()); + process.stdout.write(data.toString()); }); }, createBucket() { @@ -146,10 +146,10 @@ module.exports = class extends BaseGenerator { } }); }, - uploadJar() { + uploadWar() { const cb = this.async(); this.log(); - this.log(chalk.bold('Upload JAR to S3')); + this.log(chalk.bold('Upload WAR to S3')); const s3 = this.awsFactory.getS3(); @@ -158,11 +158,11 @@ module.exports = class extends BaseGenerator { buildTool: this.buildTool }; - s3.uploadJar(params, (err, data) => { + s3.uploadWar(params, (err, data) => { if (err) { this.error(err.message); } else { - this.jarKey = data.jarKey; + this.warKey = data.warKey; this.log(data.message); cb(); } @@ -241,7 +241,7 @@ module.exports = class extends BaseGenerator { const params = { applicationName: this.applicationName, bucketName: this.bucketName, - jarKey: this.jarKey, + warKey: this.warKey, environmentName: this.environmentName, dbUrl: this.dbUrl, dbUsername: this.dbUsername, diff --git a/generators/aws/lib/eb.js b/generators/aws/lib/eb.js index 6d9f2f3422f8..fc7dd09c7aeb 100644 --- a/generators/aws/lib/eb.js +++ b/generators/aws/lib/eb.js @@ -31,8 +31,8 @@ const Eb = (module.exports = function Eb(Aws, generator) { Eb.prototype.createApplication = function createApplication(params, callback) { const applicationName = params.applicationName; const bucketName = params.bucketName; - const jarKey = params.jarKey; - const versionLabel = `${this.jarKey}-${uuidV4()}`; + const warKey = params.warKey; + const versionLabel = `${this.warKey}-${uuidV4()}`; const environmentName = params.environmentName; const dbUrl = params.dbUrl; const dbUsername = params.dbUsername; @@ -43,7 +43,7 @@ Eb.prototype.createApplication = function createApplication(params, callback) { applicationName, versionLabel, bucketName, - jarKey + warKey }; createApplicationVersion(applicationParams, err => { @@ -89,7 +89,7 @@ function createApplicationVersion(params, callback) { const applicationName = params.applicationName; const versionLabel = params.versionLabel; const bucketName = params.bucketName; - const jarKey = params.jarKey; + const warKey = params.warKey; const elasticbeanstalk = new aws.ElasticBeanstalk(); @@ -99,7 +99,7 @@ function createApplicationVersion(params, callback) { AutoCreateApplication: true, SourceBundle: { S3Bucket: bucketName, - S3Key: jarKey + S3Key: warKey } }; diff --git a/generators/aws/lib/s3.js b/generators/aws/lib/s3.js index 86d2e4787b98..353d96bd07d3 100644 --- a/generators/aws/lib/s3.js +++ b/generators/aws/lib/s3.js @@ -18,7 +18,7 @@ */ const fs = require('fs'); -const FILE_EXTENSION = '.original'; +const FILE_EXTENSION = '.war'; const S3_STANDARD_REGION = 'us-east-1'; let Progressbar; @@ -69,7 +69,7 @@ S3.prototype.createBucket = function createBucket(params, callback) { }); }; -S3.prototype.uploadJar = function uploadJar(params, callback) { +S3.prototype.uploadWar = function uploadWar(params, callback) { const bucket = params.bucket; const buildTool = params.buildTool; let buildFolder; @@ -80,43 +80,41 @@ S3.prototype.uploadJar = function uploadJar(params, callback) { buildFolder = 'target/'; } - findJarFilename(buildFolder, (err, jarFilename) => { + findWarFilename(buildFolder, (err, warKey) => { if (err) { error(err, callback); } else { - const jarKey = jarFilename.slice(0, -FILE_EXTENSION.length); - const s3 = new this.Aws.S3({ params: { Bucket: bucket, - Key: jarKey + Key: warKey }, signatureVersion: 'v4', httpOptions: { timeout: 600000 } }); - const filePath = buildFolder + jarFilename; + const filePath = buildFolder + warKey; const body = fs.createReadStream(filePath); uploadToS3(s3, body, (err, message) => { if (err) { error(err.message, callback); } else { - callback(null, { message, jarKey }); + callback(null, { message, warKey }); } }); } }); }; -function findJarFilename(buildFolder, callback) { - let jarFilename = ''; +function findWarFilename(buildFolder, callback) { + let warFilename = ''; fs.readdir(buildFolder, (err, files) => { if (err) { error(err, callback); } - files.filter(file => file.substr(-FILE_EXTENSION.length) === FILE_EXTENSION).forEach(file => (jarFilename = file)); // eslint-disable-line - callback(null, jarFilename); + files.filter(file => file.substr(-FILE_EXTENSION.length) === FILE_EXTENSION).forEach(file => (warFilename = file)); // eslint-disable-line + callback(null, warFilename); }); } @@ -147,7 +145,7 @@ function uploadToS3(s3, body, callback) { if (err) { callback(err, null); } else { - callback(null, 'Jar uploaded successful'); + callback(null, 'War uploaded successful'); } }); } diff --git a/generators/cloudfoundry/index.js b/generators/cloudfoundry/index.js index 0a856a7402c7..ce8a758a94a9 100644 --- a/generators/cloudfoundry/index.js +++ b/generators/cloudfoundry/index.js @@ -134,7 +134,7 @@ module.exports = class extends BaseGenerator { this.log(chalk.bold(`\nBuilding the application with the ${this.cloudfoundryProfile} profile`)); - const child = this.buildApplication(this.buildTool, this.cloudfoundryProfile, err => { + const child = this.buildApplication(this.buildTool, this.cloudfoundryProfile, false, err => { if (err) { this.log.error(err); } diff --git a/generators/generator-base.js b/generators/generator-base.js index a0c65cc7420e..406accad0fca 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -1779,13 +1779,22 @@ module.exports = class extends PrivateBase { * * @param {String} buildTool - maven | gradle * @param {String} profile - dev | prod + * @param {Boolean} buildWar - build a war instead of a jar * @param {Function} cb - callback when build is complete */ - buildApplication(buildTool, profile, cb) { + buildApplication(buildTool, profile, buildWar, cb) { let buildCmd = 'mvnw verify -DskipTests=true -B'; if (buildTool === 'gradle') { - buildCmd = 'gradlew bootJar -x test'; + buildCmd = 'gradlew -x test'; + if (buildWar) { + buildCmd += ' bootWar'; + } else { + buildCmd += ' bootJar'; + } + } + if (buildWar) { + buildCmd += ' -Pwar'; } if (os.platform() !== 'win32') { diff --git a/generators/heroku/index.js b/generators/heroku/index.js index 58736874127f..795a50204b65 100644 --- a/generators/heroku/index.js +++ b/generators/heroku/index.js @@ -501,7 +501,7 @@ module.exports = class extends BaseGenerator { const done = this.async(); this.log(chalk.bold('\nBuilding application')); - const child = this.buildApplication(this.buildTool, 'prod', err => { + const child = this.buildApplication(this.buildTool, 'prod', false, err => { if (err) { this.abort = true; this.log.error(err); From 2f0e5fcffa1bc54cdadac1af86e385d5a9921409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Tamisier?= Date: Mon, 8 Jul 2019 22:33:11 +0200 Subject: [PATCH 281/298] Position ngbDropdown dynamically --- .../webapp/app/layouts/navbar/navbar.component.html.ejs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs index 18af80d0bb6d..3e0765684f5e 100644 --- a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +++ b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs @@ -35,7 +35,7 @@
  • - -
  • HasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"> +
  • HasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" display="dynamic" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"> @@ -130,7 +130,7 @@
  • <%_ if (enableTranslation) { _%> - <%_ } _%> -