generator-jhipster 7.9.0 → 7.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/environment-builder.js +15 -1
- package/cli/jhipster.js +0 -0
- package/generators/app/index.js +12 -1
- package/generators/bootstrap/index.js +33 -1
- package/generators/ci-cd/templates/circle.yml.ejs +3 -13
- package/generators/client/files-angular.js +1 -1
- package/generators/client/files-react.js +5 -2
- package/generators/client/files-vue.js +3 -2
- package/generators/client/templates/angular/jest.conf.js.ejs +6 -3
- package/generators/client/templates/angular/package.json +18 -18
- package/generators/client/templates/angular/package.json.ejs +3 -7
- package/generators/client/templates/angular/src/main/webapp/app/admin/admin-routing.module.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.model.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.ts.ejs +17 -15
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.model.ts.ejs +2 -2
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.route.ts.ejs +4 -4
- package/generators/client/templates/angular/src/main/webapp/app/core/request/request-util.ts.ejs +4 -2
- package/generators/client/templates/angular/src/main/webapp/app/core/util/data-util.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/core/util/parse-links.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.html.ejs +8 -6
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.ts.ejs +6 -11
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.spec.ts.ejs +227 -25
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.ts.ejs +104 -43
- package/generators/client/templates/angular/src/main/webapp/content/scss/global.scss.ejs +8 -0
- package/generators/client/templates/angular/tsconfig.json.ejs +0 -1
- package/generators/client/templates/angular/tsconfig.spec.json.ejs +2 -3
- package/generators/client/templates/angular/webpack/webpack.microfrontend.js.ejs +0 -3
- package/generators/client/templates/common/package.json +4 -4
- package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +1 -1
- package/generators/client/templates/react/jest.conf.js.ejs +2 -2
- package/generators/client/templates/react/package.json +24 -24
- package/generators/client/templates/react/package.json.ejs +3 -7
- package/generators/client/templates/react/src/main/webapp/app/config/store.ts.ejs +0 -6
- package/generators/client/templates/react/src/main/webapp/app/index.tsx.ejs +4 -5
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs +6 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +17 -8
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.ts.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs +176 -19
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.ts.ejs +46 -13
- package/generators/client/templates/react/webpack/webpack.microfrontend.js.jhi.react.ejs +1 -1
- package/generators/client/templates/vue/package.json +17 -17
- package/generators/client/templates/vue/package.json.ejs +3 -7
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +2 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +2 -2
- package/generators/client/templates/vue/src/main/webapp/app/router/admin.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/administration-page.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/navbar-page.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +5 -6
- package/generators/client/templates/vue/src/test/javascript/spec/app/account/account.service.spec.ts.ejs +4 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/alert/alert.service.spec.ts.ejs +106 -3
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +12 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/formatter.spec.ts.ejs +6 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/sort/sorts.spec.ts.ejs +10 -0
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +1 -1
- package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +2 -2
- package/generators/common/files.js +5 -4
- package/generators/common/templates/.husky/pre-commit.ejs +0 -0
- package/generators/common/templates/package.json +1 -1
- package/generators/common/templates/sonar-project.properties.ejs +19 -11
- package/generators/cypress/index.js +1 -1
- package/generators/docker-compose/templates/README-DOCKER-COMPOSE.md.ejs +3 -3
- package/generators/docker-compose/templates/docker-compose.yml.ejs +1 -1
- package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/entity/index.js +4 -3
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +18 -6
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +23 -19
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +3 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts.ejs +1 -1
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/common/delete_template.ejs +7 -3
- package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +15 -5
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_persistable.ejs +8 -1
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +5 -0
- package/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs +4 -4
- package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs +6 -4
- package/generators/entity-server/templates/src/main/java/package/service/criteria/EntityCriteria.java.ejs +3 -26
- package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +1 -0
- package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +1 -1
- package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +33 -28
- package/generators/generate-blueprint/constants.mjs +46 -6
- package/generators/generate-blueprint/esm.mjs +0 -0
- package/generators/generate-blueprint/files.mjs +7 -5
- package/generators/generate-blueprint/generator.mjs +73 -19
- package/generators/generate-blueprint/templates/cli/cli.mjs.ejs +0 -0
- package/generators/generate-blueprint/templates/generators/generator/generator.spec.mjs.ejs +1 -1
- package/generators/generate-blueprint/templates/generators/generator/templates/template-file.ejs +0 -0
- package/generators/generator-base-blueprint.js +23 -1
- package/generators/generator-base-entities.cjs +5 -1
- package/generators/generator-base.js +82 -15
- package/generators/generator-constants.js +17 -23
- package/generators/init/templates/.husky/pre-commit +0 -0
- package/generators/kubernetes/templates/deployment.yml.ejs +1 -1
- package/generators/kubernetes/templates/ingress.yml.ejs +1 -1
- package/generators/kubernetes/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes/templates/kubectl-apply.sh.ejs +0 -0
- package/generators/kubernetes/templates/kustomize/kustomization.yml.ejs +1 -1
- package/generators/kubernetes/templates/service.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/kubectl-apply.sh.ejs +0 -0
- package/generators/kubernetes-knative/templates/service.yml.ejs +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/al/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ar-ly/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bg/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/by/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ca/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/cs/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/da/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/de/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/activate.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/password.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/register.json +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/el/tracker.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/user-management.json +9 -9
- package/generators/languages/templates/src/main/webapp/i18n/en/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/es/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/et/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/gl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hu/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hy/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/in/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/it/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ja/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ko/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/mr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/my/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/nl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-br/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-pt/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ro/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ru/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/si/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sk/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sv/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ta/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/te/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/th/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/tr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ua/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/vi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-cn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-tw/health.json.ejs +1 -1
- package/generators/maven/templates/mvnw +0 -0
- package/generators/openshift/templates/deployment.yml.ejs +2 -2
- package/generators/server/cleanup-elasticsearch.js +5 -0
- package/generators/server/files.js +17 -8
- package/generators/server/index.js +0 -2
- package/generators/server/templates/build.gradle.ejs +6 -14
- package/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -1
- package/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -1
- package/generators/server/templates/gradle.properties.ejs +6 -4
- package/generators/server/templates/gradlew +0 -0
- package/generators/server/templates/mvnw +0 -0
- package/generators/server/templates/npmw +0 -0
- package/generators/server/templates/npmw.cmd +31 -29
- package/generators/server/templates/package.json.ejs +2 -2
- package/generators/server/templates/pom.xml.ejs +12 -23
- package/generators/server/templates/sql/common/src/test/java/package/config/MsSqlTestContainer.java.ejs +2 -3
- package/generators/server/templates/src/main/docker/app.yml.ejs +7 -1
- package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/server/templates/src/main/docker/jhipster-control-center.yml.ejs +1 -1
- package/generators/server/templates/src/main/docker/prometheus/prometheus.yml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/Application.java.ejs +11 -4
- package/generators/server/templates/src/main/java/package/config/CRLFLogConverter.java.ejs +57 -0
- package/generators/server/templates/src/main/java/package/config/EurekaWorkaroundConfiguration.java.ejs +49 -0
- package/generators/server/templates/src/main/java/package/config/LoggingConfiguration.java.ejs +4 -4
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +17 -18
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +13 -5
- package/generators/server/templates/src/main/java/package/domain/AbstractAuditingEntity.java.ejs +5 -6
- package/generators/server/templates/src/main/java/package/domain/User.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +13 -6
- package/generators/server/templates/src/main/java/package/service/dto/AdminUserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/service/dto/PasswordChangeDTO.java.ejs +5 -1
- package/generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +15 -42
- package/generators/server/templates/src/main/java/package/web/rest/errors/BadRequestAlertException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/EmailAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/InvalidPasswordException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/LoginAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
- package/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +3 -3
- package/generators/server/templates/src/main/resources/config/application.yml.ejs +4 -2
- package/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +3 -8
- package/generators/server/templates/src/main/resources/logback-spring.xml.ejs +5 -0
- package/generators/server/templates/src/test/java/package/config/{ElasticsearchReactiveTestConfiguration.java.ejs → ElasticsearchTestConfiguration.java.ejs} +3 -3
- package/generators/server/templates/src/test/java/package/config/ElasticsearchTestContainer.java.ejs +1 -0
- package/generators/server/templates/src/test/java/package/config/JHipsterBlockHoundIntegration.java.ejs +3 -0
- package/generators/server/templates/src/test/java/package/config/TestContainersSpringContextCustomizerFactory.java.ejs +2 -2
- package/generators/sql-constants.js +5 -2
- package/generators/utils.js +43 -3
- package/generators/workspaces/index.js +2 -1
- package/jdl/exporters/jdl-exporter.js +6 -1
- package/jdl/jhipster/application-options.js +2 -1
- package/jdl/jhipster/binary-options.js +2 -2
- package/jdl/jhipster/default-application-options.js +11 -8
- package/jdl/jhipster/entity-options.js +1 -0
- package/jdl/jhipster/search-engine-types.js +1 -0
- package/lib/constants/priorities.cjs +16 -0
- package/lib/constants/priorities.mjs +1 -0
- package/lib/index.js +2 -0
- package/lib/support/base.cjs +2 -1
- package/package.json +7 -6
- package/utils/blueprint.js +10 -0
- package/utils/field.js +9 -9
- package/generators/client/templates/react/src/main/webapp/app/config/translation-middleware.ts.ejs +0 -58
- package/generators/server/templates/.npmrc.ejs +0 -1
package/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs
CHANGED
|
@@ -78,7 +78,7 @@ public class <%= serviceClassName %> extends QueryService<<%= persistClass %>> {
|
|
|
78
78
|
*/
|
|
79
79
|
@Transactional(readOnly = true)
|
|
80
80
|
public List<<%= instanceType %>> findByCriteria(<%= criteria %> criteria) {
|
|
81
|
-
log.debug("find by criteria : {}", criteria
|
|
81
|
+
log.debug("find by criteria : {}", criteria);
|
|
82
82
|
final Specification<<%= persistClass %>> specification = createSpecification(criteria);
|
|
83
83
|
<%_ if (dtoMapstruct) { _%>
|
|
84
84
|
return <%= entityListToDto %>(<%= repository %>.findAll(specification));
|
|
@@ -95,7 +95,7 @@ public class <%= serviceClassName %> extends QueryService<<%= persistClass %>> {
|
|
|
95
95
|
*/
|
|
96
96
|
@Transactional(readOnly = true)
|
|
97
97
|
public Page<<%= instanceType %>> findByCriteria(<%= criteria %> criteria, Pageable page) {
|
|
98
|
-
log.debug("find by criteria : {}, page: {}", criteria
|
|
98
|
+
log.debug("find by criteria : {}, page: {}", criteria, page);
|
|
99
99
|
final Specification<<%= persistClass %>> specification = createSpecification(criteria);
|
|
100
100
|
<%_ if (dtoMapstruct) { _%>
|
|
101
101
|
return <%= repository %>.findAll(specification, page)
|
|
@@ -112,7 +112,7 @@ public class <%= serviceClassName %> extends QueryService<<%= persistClass %>> {
|
|
|
112
112
|
*/
|
|
113
113
|
@Transactional(readOnly = true)
|
|
114
114
|
public long countByCriteria(<%= criteria %> criteria) {
|
|
115
|
-
log.debug("count by criteria : {}", criteria
|
|
115
|
+
log.debug("count by criteria : {}", criteria);
|
|
116
116
|
final Specification<<%= persistClass %>> specification = createSpecification(criteria);
|
|
117
117
|
return <%= repository %>.count(specification);
|
|
118
118
|
}
|
|
@@ -134,7 +134,7 @@ public class <%= serviceClassName %> extends QueryService<<%= persistClass %>> {
|
|
|
134
134
|
}
|
|
135
135
|
<%_
|
|
136
136
|
fields.forEach((field) => {
|
|
137
|
-
if (field.id) return;
|
|
137
|
+
if (field.id || field.transient) return;
|
|
138
138
|
if (isFilterableType(field.fieldType)) { _%>
|
|
139
139
|
if (criteria.get<%= field.fieldInJavaBeanMethod %>() != null) {
|
|
140
140
|
specification = specification.and(<%= getSpecificationBuilder(field.fieldType) %>(criteria.get<%= field.fieldInJavaBeanMethod %>(), <%= persistClass %>_.<%= field.fieldName %>));
|
package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs
CHANGED
|
@@ -142,17 +142,19 @@ public interface <%= entityClass %>Service {
|
|
|
142
142
|
* @return a Mono to signal the deletion
|
|
143
143
|
<%_ } _%>
|
|
144
144
|
*/
|
|
145
|
-
<%- reactive ? 'Mono<Void>' : 'void' %> delete(<%= primaryKey.type %> id)
|
|
145
|
+
<%- reactive ? 'Mono<Void>' : 'void' %> delete(<%= primaryKey.type %> id);
|
|
146
|
+
<%_ if (searchEngine) { _%>
|
|
146
147
|
|
|
147
148
|
/**
|
|
148
149
|
* Search for the <%= entityInstance %> corresponding to the query.
|
|
149
150
|
*
|
|
150
151
|
* @param query the query of the search.
|
|
151
|
-
<%_ if (!paginationNo) { _%>
|
|
152
|
+
<%_ if (!paginationNo) { _%>
|
|
152
153
|
*
|
|
153
154
|
* @param pageable the pagination information.
|
|
154
|
-
<%_ } _%>
|
|
155
|
+
<%_ } _%>
|
|
155
156
|
* @return the list of entities.
|
|
156
157
|
*/
|
|
157
|
-
<% if (!paginationNo) { %><%= pageOrFlux %><<%= instanceType %><% } else { %><%= listOrFlux %><<%= instanceType %><% } %>> search(String query<% if (!paginationNo) { %>, Pageable pageable<% } %>)
|
|
158
|
+
<% if (!paginationNo) { %><%= pageOrFlux %><<%= instanceType %><% } else { %><%= listOrFlux %><<%= instanceType %><% } %>> search(String query<% if (!paginationNo) { %>, Pageable pageable<% } %>);
|
|
159
|
+
<%_ } _%>
|
|
158
160
|
}
|
|
@@ -7,36 +7,12 @@ import tech.jhipster.service.Criteria;
|
|
|
7
7
|
<%_ for (const field of fields) { if (field.fieldIsEnum === true) { _%>
|
|
8
8
|
import <%= entityAbsolutePackage %>.domain.enumeration.<%= field.fieldType %>;
|
|
9
9
|
<%_ } } _%>
|
|
10
|
-
import tech.jhipster.service.filter
|
|
11
|
-
import tech.jhipster.service.filter.DoubleFilter;
|
|
12
|
-
import tech.jhipster.service.filter.Filter;
|
|
13
|
-
import tech.jhipster.service.filter.FloatFilter;
|
|
14
|
-
import tech.jhipster.service.filter.IntegerFilter;
|
|
15
|
-
import tech.jhipster.service.filter.LongFilter;
|
|
16
|
-
import tech.jhipster.service.filter.StringFilter;
|
|
17
|
-
<%_ if (fieldsContainBigDecimal) { _%>
|
|
18
|
-
import tech.jhipster.service.filter.BigDecimalFilter;
|
|
19
|
-
<%_ } _%>
|
|
20
|
-
<%_ if (fieldsContainDuration) { _%>
|
|
21
|
-
import tech.jhipster.service.filter.DurationFilter;
|
|
22
|
-
<%_ } _%>
|
|
23
|
-
<%_ if (fieldsContainInstant) { _%>
|
|
24
|
-
import tech.jhipster.service.filter.InstantFilter;
|
|
25
|
-
<%_ } _%>
|
|
26
|
-
<%_ if (fieldsContainLocalDate) { _%>
|
|
27
|
-
import tech.jhipster.service.filter.LocalDateFilter;
|
|
28
|
-
<%_ } _%>
|
|
29
|
-
<%_ if (fieldsContainUUID || otherEntityPrimaryKeyTypesIncludesUUID) { _%>
|
|
30
|
-
import tech.jhipster.service.filter.UUIDFilter;
|
|
31
|
-
<%_ } _%>
|
|
32
|
-
<%_ if (fieldsContainZonedDateTime) { _%>
|
|
33
|
-
import tech.jhipster.service.filter.ZonedDateTimeFilter;
|
|
34
|
-
<%_ } _%>
|
|
10
|
+
import tech.jhipster.service.filter.*;
|
|
35
11
|
|
|
36
12
|
<%_
|
|
37
13
|
var filterVariables = [];
|
|
38
14
|
var extraFilters = {};
|
|
39
|
-
fields.forEach((field) => {
|
|
15
|
+
fields.filter(field => !field.transient).forEach((field) => {
|
|
40
16
|
const fieldType = field.fieldType;
|
|
41
17
|
if (isFilterableType(fieldType)) {
|
|
42
18
|
var filterType;
|
|
@@ -78,6 +54,7 @@ _%>
|
|
|
78
54
|
* fix type specific filters.
|
|
79
55
|
*/
|
|
80
56
|
@ParameterObject
|
|
57
|
+
@SuppressWarnings("common-java:DuplicatedBlocks")
|
|
81
58
|
public class <%= entityClass %>Criteria implements Serializable, Criteria {
|
|
82
59
|
<%_ Object.keys(extraFilters).forEach((key) => {
|
|
83
60
|
extraFilter = extraFilters[key]; _%>
|
package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs
CHANGED
|
@@ -68,6 +68,7 @@ import <%= `${otherEntity.entityAbsolutePackage}.service.dto.${otherEntity.dtoCl
|
|
|
68
68
|
<%_ if (typeof javadoc !== 'undefined') { _%>
|
|
69
69
|
@Schema(description = "<%- formatAsApiDescription(javadoc) %>")
|
|
70
70
|
<%_ } _%>
|
|
71
|
+
@SuppressWarnings("common-java:DuplicatedBlocks")
|
|
71
72
|
public class <%= dtoClass %> implements Serializable {
|
|
72
73
|
|
|
73
74
|
<%_ for (reference of dtoReferences) {
|
|
@@ -127,7 +127,7 @@ public class <%= serviceClassName %><% if (serviceImpl) { %> implements <%= enti
|
|
|
127
127
|
@Override
|
|
128
128
|
<%_ } _%>
|
|
129
129
|
public <% if (reactive) { %>Mono<<% } %><%= instanceType %><% if (reactive) { %>><% } %> update(<%= instanceType %> <%= instanceName %>) {
|
|
130
|
-
log.debug("Request to
|
|
130
|
+
log.debug("Request to update <%= entityClass %> : {}", <%= instanceName %>);
|
|
131
131
|
<%- include('/partials/update_template', {updatableEntity, viaService: false, returnDirectly: true, isUsingMapsId: isUsingMapsId, mapsIdAssoc: mapsIdAssoc, isController: false, isPersisted: requiresPersistableImplementation}); -%>
|
|
132
132
|
}
|
|
133
133
|
|
package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
package <%= entityAbsolutePackage %>.web.rest;
|
|
20
20
|
|
|
21
21
|
<%_
|
|
22
|
-
|
|
22
|
+
const fieldsToTest = fields.filter(field => !field.id && !field.autoGenerate && !field.transient);
|
|
23
23
|
let mapsIdEntity;
|
|
24
24
|
let mapsIdEntityInstance;
|
|
25
25
|
let mapsIdRepoInstance;
|
|
@@ -104,7 +104,7 @@ import org.assertj.core.util.IterableUtil;
|
|
|
104
104
|
import org.apache.commons.collections4.IterableUtils;
|
|
105
105
|
import java.util.concurrent.TimeUnit;
|
|
106
106
|
<%_ } _%>
|
|
107
|
-
<%_ if (databaseTypeSql && reactive) { _%>
|
|
107
|
+
<%_ if ((databaseTypeSql && reactive) || searchEngineElasticsearch) { _%>
|
|
108
108
|
import org.junit.jupiter.api.AfterEach;
|
|
109
109
|
<%_ } _%>
|
|
110
110
|
import org.junit.jupiter.api.BeforeEach;
|
|
@@ -246,7 +246,7 @@ import <%= entityAbsolutePackage %>.domain.enumeration.<%= field.fieldType %>;
|
|
|
246
246
|
@WithMockUser
|
|
247
247
|
class <%= entityClass %>ResourceIT {
|
|
248
248
|
<%_
|
|
249
|
-
for (field of
|
|
249
|
+
for (field of fieldsToTest) {
|
|
250
250
|
const defaultValueName = 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase();
|
|
251
251
|
const updatedValueName = 'UPDATED_' + field.fieldNameUnderscored.toUpperCase();
|
|
252
252
|
const smallerValueName = 'SMALLER_' + field.fieldNameUnderscored.toUpperCase();
|
|
@@ -487,7 +487,7 @@ if (field.fieldTypeString || field.blobContentTypeText) {
|
|
|
487
487
|
<%_ if (fluentMethods) { _%>
|
|
488
488
|
<%= persistClass %> <%= persistInstance %> = new <%= persistClass %>()<%_ if (reactive && databaseTypeSql && primaryKey.typeUUID && !isUsingMapsId) { _%>
|
|
489
489
|
.<%= primaryKey.name %>(UUID.randomUUID())
|
|
490
|
-
<%_ } _%><% for (field of
|
|
490
|
+
<%_ } _%><% for (field of fieldsToTest) { %>
|
|
491
491
|
.<%= field.fieldName %>(<%= fieldStatus + field.fieldNameUnderscored.toUpperCase() %>)<% if (field.fieldTypeBinary && !field.blobContentTypeText) { %>
|
|
492
492
|
.<%= field.fieldName %>ContentType(<%= fieldStatus + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE)<% } %><% } %>;
|
|
493
493
|
<%_ } else { _%>
|
|
@@ -495,7 +495,7 @@ if (field.fieldTypeString || field.blobContentTypeText) {
|
|
|
495
495
|
<%_ if (reactive && databaseTypeSql && primaryKey.typeUUID && !isUsingMapsId) { _%>
|
|
496
496
|
<%= persistInstance %>.set<%= primaryKey.fields[0].fieldInJavaBeanMethod %>(UUID.randomUUID());
|
|
497
497
|
<%_ } _%>
|
|
498
|
-
<%_ for (field of
|
|
498
|
+
<%_ for (field of fieldsToTest) { _%>
|
|
499
499
|
<%= persistInstance %>.set<%= field.fieldInJavaBeanMethod %>(<%= fieldStatus + field.fieldNameUnderscored.toUpperCase() %>);
|
|
500
500
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
501
501
|
<%= persistInstance %>.set<%= field.fieldInJavaBeanMethod %>ContentType(<%= fieldStatus + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE);
|
|
@@ -584,6 +584,14 @@ _%>
|
|
|
584
584
|
deleteEntities(em);
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
+
<%_ } _%>
|
|
588
|
+
<%_ if (searchEngineElasticsearch) { _%>
|
|
589
|
+
@AfterEach
|
|
590
|
+
public void cleanupElasticSearchRepository() {
|
|
591
|
+
<%= entityInstance %>SearchRepository.deleteAll()<%= callBlock %>;
|
|
592
|
+
assertThat(<%= entityInstance %>SearchRepository.count()<%= callBlock %>).isEqualTo(0);
|
|
593
|
+
}
|
|
594
|
+
|
|
587
595
|
<%_ } _%>
|
|
588
596
|
<%_ if (reactive && testsNeedCsrf) { _%>
|
|
589
597
|
@BeforeEach
|
|
@@ -598,9 +606,6 @@ _%>
|
|
|
598
606
|
<%= entityInstance %>Repository.deleteAll()<%= callBlock %>;
|
|
599
607
|
<%_ } else if (databaseTypeSql && reactive) { _%>
|
|
600
608
|
deleteEntities(em);
|
|
601
|
-
<%_ } _%>
|
|
602
|
-
<%_ if (searchEngineElasticsearch) { _%>
|
|
603
|
-
<%= entityInstance %>SearchRepository.deleteAll()<%= callBlock %>;
|
|
604
609
|
<%_ } _%>
|
|
605
610
|
<%= persistInstance %> = createEntity(<% if (databaseTypeSql) { %>em<% } %>);
|
|
606
611
|
}
|
|
@@ -649,7 +654,7 @@ _%>
|
|
|
649
654
|
});
|
|
650
655
|
<%_ } _%>
|
|
651
656
|
<%= persistClass %> test<%= entityClass %> = <%= entityInstance %>List.get(<%= entityInstance %>List.size() - 1);
|
|
652
|
-
<%_ for (const field of
|
|
657
|
+
<%_ for (const field of fieldsToTest) {
|
|
653
658
|
if (field.fieldTypeZonedDateTime) { _%>
|
|
654
659
|
assertThat(test<%= entityClass %>.get<%= field.fieldInJavaBeanMethod %>()).isEqualTo(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>);
|
|
655
660
|
<%_ } else if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
@@ -785,7 +790,7 @@ _%>
|
|
|
785
790
|
<%_ } _%>
|
|
786
791
|
}
|
|
787
792
|
<%_ } _%>
|
|
788
|
-
<%_ for (field of
|
|
793
|
+
<%_ for (field of fieldsToTest) { _%>
|
|
789
794
|
<%_ if (field.fieldValidate) {
|
|
790
795
|
let required = false;
|
|
791
796
|
if (!field.fieldTypeBytes && field.fieldValidate && field.fieldValidationRequired) {
|
|
@@ -863,7 +868,7 @@ _%>
|
|
|
863
868
|
assertThat(<%= entityInstance %>List).isNotNull();
|
|
864
869
|
assertThat(<%= entityInstance %>List).hasSize(1);
|
|
865
870
|
<%= persistClass %> test<%= entityClass %> = <%= entityInstance %>List.get(0);
|
|
866
|
-
<%_ for (const field of
|
|
871
|
+
<%_ for (const field of fieldsToTest) {
|
|
867
872
|
if (field.fieldTypeZonedDateTime) { _%>
|
|
868
873
|
assertThat(test<%= entityClass %>.get<%= field.fieldInJavaBeanMethod %>()).isEqualTo(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>);
|
|
869
874
|
<%_ } else if ((field.fieldTypeBinary) && !field.blobContentTypeText) { _%>
|
|
@@ -902,7 +907,7 @@ _%>
|
|
|
902
907
|
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
|
|
903
908
|
<%_ } _%>
|
|
904
909
|
<%_ if (databaseTypeSql || databaseTypeMongodb || databaseTypeCouchbase || databaseTypeCassandra) { _%>
|
|
905
|
-
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<%= !reactive ? ')' : '' %><%_ } _%><% for (field of
|
|
910
|
+
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<%= !reactive ? ')' : '' %><%_ } _%><% for (field of fieldsToTest) { %>
|
|
906
911
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
907
912
|
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= field.fieldName %>ContentType").value(hasItem(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE))<%= !reactive ? ')' : '' %>
|
|
908
913
|
<%_ } _%>
|
|
@@ -989,7 +994,7 @@ _%>
|
|
|
989
994
|
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
|
|
990
995
|
<%_ } _%>
|
|
991
996
|
<%_ if (databaseTypeSql || databaseTypeMongodb || databaseTypeCouchbase || databaseTypeCassandra) { _%>
|
|
992
|
-
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.<%= primaryKey.name %>").value(<%= reactive ? 'is(' : '' %><%= idValue %>))<%_ } _%><% for (field of
|
|
997
|
+
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.<%= primaryKey.name %>").value(<%= reactive ? 'is(' : '' %><%= idValue %>))<%_ } _%><% for (field of fieldsToTest) { %>
|
|
993
998
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
994
999
|
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.<%= field.fieldName %>ContentType").value(<%= reactive ? 'is(' : '' %><%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE))
|
|
995
1000
|
<%_ } _%>
|
|
@@ -1028,7 +1033,7 @@ _%>
|
|
|
1028
1033
|
<%_ } _%>
|
|
1029
1034
|
}
|
|
1030
1035
|
|
|
1031
|
-
<%_
|
|
1036
|
+
<%_ fieldsToTest.forEach((searchBy) => { /* we can't filter by all the fields. */_%>
|
|
1032
1037
|
<%_ if (isFilterableType(searchBy.fieldType)) { _%>
|
|
1033
1038
|
|
|
1034
1039
|
@Test<%= transactionalAnnotation %>
|
|
@@ -1219,7 +1224,7 @@ _%>
|
|
|
1219
1224
|
.expectStatus().isOk()
|
|
1220
1225
|
.expectHeader().contentType(MediaType.APPLICATION_JSON)
|
|
1221
1226
|
.expectBody()
|
|
1222
|
-
.jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<% for (field of
|
|
1227
|
+
.jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<% for (field of fieldsToTest) { %>
|
|
1223
1228
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
1224
1229
|
.jsonPath("$.[*].<%= field.fieldName %>ContentType").value(hasItem(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE))
|
|
1225
1230
|
<%_ } _%>
|
|
@@ -1255,7 +1260,7 @@ _%>
|
|
|
1255
1260
|
'UUID' : '.toString()'
|
|
1256
1261
|
}[primaryKey.type] || '';
|
|
1257
1262
|
_%>
|
|
1258
|
-
.andExpect(jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= persistInstance %>.get<%= primaryKey.nameCapitalized %>()<%= primaryKeyConversion %>)))<%
|
|
1263
|
+
.andExpect(jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= persistInstance %>.get<%= primaryKey.nameCapitalized %>()<%= primaryKeyConversion %>)))<% fieldsToTest.forEach((field) => { %>
|
|
1259
1264
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
1260
1265
|
.andExpect(jsonPath("$.[*].<%= field.fieldName %>ContentType").value(hasItem(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE)))
|
|
1261
1266
|
<%_ } _%>
|
|
@@ -1336,7 +1341,7 @@ _%>
|
|
|
1336
1341
|
<%_ if (!readOnly) { _%>
|
|
1337
1342
|
|
|
1338
1343
|
@Test<%= transactionalAnnotation %>
|
|
1339
|
-
void
|
|
1344
|
+
void putExisting<%= entityClass %>() throws Exception {
|
|
1340
1345
|
// Initialize the database
|
|
1341
1346
|
<%_ if (!primaryKey.derived) { _%>
|
|
1342
1347
|
<%_ for (field of primaryKey.fields.filter(f => !f.autoGenerateByRepository)) { _%>
|
|
@@ -1357,12 +1362,12 @@ _%>
|
|
|
1357
1362
|
// Disconnect from session so that the updates on updated<%= persistClass %> are not directly saved in db
|
|
1358
1363
|
em.detach(updated<%= persistClass %>);
|
|
1359
1364
|
<%_ } _%>
|
|
1360
|
-
<%_ if (fluentMethods &&
|
|
1361
|
-
updated<%= persistClass %><% for (field of
|
|
1365
|
+
<%_ if (fluentMethods && fieldsToTest.length > 0) { _%>
|
|
1366
|
+
updated<%= persistClass %><% for (field of fieldsToTest) { %>
|
|
1362
1367
|
.<%= field.fieldName %>(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>)<% if (field.fieldTypeBinary && !field.blobContentTypeText) { %>
|
|
1363
1368
|
.<%= field.fieldName %>ContentType(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE)<% } %><% } %>;
|
|
1364
1369
|
<%_ } else { _%>
|
|
1365
|
-
<%_ for (field of
|
|
1370
|
+
<%_ for (field of fieldsToTest) { _%>
|
|
1366
1371
|
updated<%= persistClass %>.set<%= field.fieldInJavaBeanMethod %>(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>);
|
|
1367
1372
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
1368
1373
|
updated<%= persistClass %>.set<%= field.fieldInJavaBeanMethod %>ContentType(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE);
|
|
@@ -1393,7 +1398,7 @@ _%>
|
|
|
1393
1398
|
List<<%= persistClass %>> <%= entityInstance %>List = <%= entityInstance %>Repository.findAll()<%= callListBlock %>;
|
|
1394
1399
|
assertThat(<%= entityInstance %>List).hasSize(databaseSizeBeforeUpdate);
|
|
1395
1400
|
<%= persistClass %> test<%= entityClass %> = <%= entityInstance %>List.get(<%= entityInstance %>List.size() - 1);
|
|
1396
|
-
<%_ for (const field of
|
|
1401
|
+
<%_ for (const field of fieldsToTest) { _%>
|
|
1397
1402
|
<%_ if (field.fieldTypeZonedDateTime) { _%>
|
|
1398
1403
|
assertThat(test<%= entityClass %>.get<%= field.fieldInJavaBeanMethod %>()).isEqualTo(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>);
|
|
1399
1404
|
<%_ } else if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
@@ -1411,7 +1416,7 @@ _%>
|
|
|
1411
1416
|
assertThat(searchDatabaseSizeAfter).isEqualTo(searchDatabaseSizeBefore);
|
|
1412
1417
|
List<<%= persistClass %>> <%= entityInstance %>SearchList = IterableUtils.toList(<%= entityInstance %>SearchRepository.findAll()<%= callListBlock %>);
|
|
1413
1418
|
<%= persistClass %> test<%= entityClass %>Search = <%= entityInstance %>SearchList.get(searchDatabaseSizeAfter - 1);
|
|
1414
|
-
<%_ for (const field of
|
|
1419
|
+
<%_ for (const field of fieldsToTest) { _%>
|
|
1415
1420
|
<%_ if (field.fieldTypeZonedDateTime) { _%>
|
|
1416
1421
|
assertThat(test<%= entityClass %>Search.get<%= field.fieldInJavaBeanMethod %>()).isEqualTo(<%= 'UPDATED_' + field.fieldNameUnderscored.toUpperCase() %>);
|
|
1417
1422
|
<%_ } else if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
@@ -1545,7 +1550,7 @@ _%>
|
|
|
1545
1550
|
<%_ } _%>
|
|
1546
1551
|
}
|
|
1547
1552
|
|
|
1548
|
-
<%
|
|
1553
|
+
<%_
|
|
1549
1554
|
const prepareFieldForPatchTest = (field, includeCb) => {
|
|
1550
1555
|
const includeField = includeCb();
|
|
1551
1556
|
const fieldNameUnderscoreUppercased = field.fieldNameUnderscored.toUpperCase();
|
|
@@ -1553,7 +1558,7 @@ _%>
|
|
|
1553
1558
|
const testWithConstant = includeField ? `UPDATED_${fieldNameUnderscoreUppercased}` : `DEFAULT_${fieldNameUnderscoreUppercased}`;
|
|
1554
1559
|
return { includeField, updateWithValue, testWithConstant, ...field};
|
|
1555
1560
|
};
|
|
1556
|
-
%>
|
|
1561
|
+
_%>
|
|
1557
1562
|
@Test<%= transactionalAnnotation %>
|
|
1558
1563
|
void partialUpdate<%= entityClass %>WithPatch() throws Exception {
|
|
1559
1564
|
// Initialize the database
|
|
@@ -1564,7 +1569,7 @@ _%>
|
|
|
1564
1569
|
<%_ } _%>
|
|
1565
1570
|
<%= entityInstance %>Repository.<%= saveMethod %>(<%= persistInstance %>)<%= callBlock %>;
|
|
1566
1571
|
|
|
1567
|
-
<% const fieldsToIncludeInPartialPatchTest =
|
|
1572
|
+
<%_ const fieldsToIncludeInPartialPatchTest = fieldsToTest.map(field => prepareFieldForPatchTest(field, () => faker.datatype.boolean())); _%>
|
|
1568
1573
|
<%- include('/partials/it_patch_update.partial.java.ejs', {fields: fieldsToIncludeInPartialPatchTest, saveMethod, asEntity, callBlock, callListBlock}); -%>
|
|
1569
1574
|
}
|
|
1570
1575
|
|
|
@@ -1578,7 +1583,7 @@ _%>
|
|
|
1578
1583
|
<%_ } _%>
|
|
1579
1584
|
<%= entityInstance %>Repository.<%= saveMethod %>(<%= persistInstance %>)<%= callBlock %>;
|
|
1580
1585
|
|
|
1581
|
-
<% const fieldsToIncludeInFullPatchTest =
|
|
1586
|
+
<% const fieldsToIncludeInFullPatchTest = fieldsToTest.map(field => prepareFieldForPatchTest(field, () => true)); %>
|
|
1582
1587
|
<%- include('/partials/it_patch_update.partial.java.ejs', {fields: fieldsToIncludeInFullPatchTest, saveMethod, asEntity, callBlock, callListBlock}); -%>
|
|
1583
1588
|
}
|
|
1584
1589
|
|
|
@@ -1714,7 +1719,7 @@ _%>
|
|
|
1714
1719
|
<%= entityInstance %>SearchRepository.save(<%= persistInstance %>)<%= callBlock %>;
|
|
1715
1720
|
<%_ } _%>
|
|
1716
1721
|
|
|
1717
|
-
|
|
1722
|
+
int databaseSizeBeforeDelete = <%= entityInstance %>Repository.findAll()<%= callListBlock %>.size();
|
|
1718
1723
|
<%_ if (searchEngineElasticsearch) { _%>
|
|
1719
1724
|
int searchDatabaseSizeBefore = IterableUtil.sizeOf(<%= entityInstance %>SearchRepository.findAll()<%= callListBlock %>);
|
|
1720
1725
|
assertThat(searchDatabaseSizeBefore).isEqualTo(databaseSizeBeforeDelete);
|
|
@@ -1779,7 +1784,7 @@ _%>
|
|
|
1779
1784
|
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
|
|
1780
1785
|
<%_ } _%>
|
|
1781
1786
|
<%_ if (databaseTypeSql || databaseTypeMongodb || databaseTypeCouchbase || databaseTypeCassandra) { _%>
|
|
1782
|
-
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<%= !reactive ? ')' : '' %><%_ } _%><% for (field of
|
|
1787
|
+
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= primaryKey.name %>").value(hasItem(<%= idValue %>))<%= !reactive ? ')' : '' %><%_ } _%><% for (field of fieldsToTest) { %>
|
|
1783
1788
|
<%_ if (field.fieldTypeBinary && !field.blobContentTypeText) { _%>
|
|
1784
1789
|
<%= !reactive ? '.andExpect(' : '.' %>jsonPath("$.[*].<%= field.fieldName %>ContentType").value(hasItem(<%= 'DEFAULT_' + field.fieldNameUnderscored.toUpperCase() %>_CONTENT_TYPE))<%= !reactive ? ')' : '' %>
|
|
1785
1790
|
<%_ } _%>
|
|
@@ -23,22 +23,36 @@ import { BASE_PRIORITY_NAMES, ENTITY_PRIORITY_NAMES } from '../../lib/constants/
|
|
|
23
23
|
|
|
24
24
|
const prioritiesForSub = subGenerator => (subGenerator.startsWith('entit') ? ENTITY_PRIORITY_NAMES : BASE_PRIORITY_NAMES);
|
|
25
25
|
|
|
26
|
+
export const GENERATE_SNAPSHOTS = 'generateSnapshots';
|
|
27
|
+
export const LINK_JHIPSTER_DEPENDENCY = 'linkJhipsterDependency';
|
|
26
28
|
export const GENERATORS = 'generators';
|
|
27
29
|
export const SUB_GENERATORS = 'subGenerators';
|
|
28
30
|
export const ADDITIONAL_SUB_GENERATORS = 'additionalSubGenerators';
|
|
29
31
|
export const DYNAMIC = 'dynamic';
|
|
30
32
|
export const JS = 'js';
|
|
33
|
+
export const LOCAL_BLUEPRINT_OPTION = 'localBlueprint';
|
|
34
|
+
export const CLI_OPTION = 'cli';
|
|
31
35
|
|
|
32
36
|
export const SBS = 'sbs';
|
|
33
37
|
export const COMMAND = 'command';
|
|
34
38
|
export const PRIORITIES = 'priorities';
|
|
35
39
|
export const ALL_GENERATORS = 'allGenerators';
|
|
40
|
+
export const ALL_PRIORITIES = 'allPriorities';
|
|
36
41
|
export const WRITTEN = 'written';
|
|
37
42
|
|
|
38
43
|
/**
|
|
39
44
|
* Options exposed to cli
|
|
40
45
|
*/
|
|
41
46
|
export const options = () => ({
|
|
47
|
+
[GENERATE_SNAPSHOTS]: {
|
|
48
|
+
desc: 'Generate test snapshots',
|
|
49
|
+
type: Boolean,
|
|
50
|
+
},
|
|
51
|
+
[LINK_JHIPSTER_DEPENDENCY]: {
|
|
52
|
+
desc: 'Link JHipster dependency for testing',
|
|
53
|
+
type: Boolean,
|
|
54
|
+
hide: true,
|
|
55
|
+
},
|
|
42
56
|
[SUB_GENERATORS]: {
|
|
43
57
|
desc: 'Sub generators to generate',
|
|
44
58
|
type: Array,
|
|
@@ -59,11 +73,25 @@ export const options = () => ({
|
|
|
59
73
|
type: Boolean,
|
|
60
74
|
scope: 'storage',
|
|
61
75
|
},
|
|
76
|
+
[LOCAL_BLUEPRINT_OPTION]: {
|
|
77
|
+
desc: 'Generate a local blueprint',
|
|
78
|
+
type: Boolean,
|
|
79
|
+
scope: 'storage',
|
|
80
|
+
},
|
|
81
|
+
[CLI_OPTION]: {
|
|
82
|
+
desc: 'Generate a cli for the blueprint',
|
|
83
|
+
type: Boolean,
|
|
84
|
+
scope: 'storage',
|
|
85
|
+
},
|
|
62
86
|
[ALL_GENERATORS]: {
|
|
63
|
-
desc: '
|
|
87
|
+
desc: 'Generate every sub generator',
|
|
64
88
|
type: Boolean,
|
|
65
89
|
scope: 'generator',
|
|
66
90
|
},
|
|
91
|
+
[ALL_PRIORITIES]: {
|
|
92
|
+
desc: 'Generate every priority',
|
|
93
|
+
type: Boolean,
|
|
94
|
+
},
|
|
67
95
|
});
|
|
68
96
|
|
|
69
97
|
/**
|
|
@@ -74,10 +102,12 @@ export const requiredConfig = () => ({});
|
|
|
74
102
|
/**
|
|
75
103
|
* Default config that will be used for templates
|
|
76
104
|
*/
|
|
77
|
-
export const defaultConfig = () => ({
|
|
105
|
+
export const defaultConfig = ({ config = {} } = {}) => ({
|
|
78
106
|
...requiredConfig,
|
|
79
107
|
[DYNAMIC]: false,
|
|
80
108
|
[JS]: false,
|
|
109
|
+
[LOCAL_BLUEPRINT_OPTION]: false,
|
|
110
|
+
[CLI_OPTION]: !config[LOCAL_BLUEPRINT_OPTION],
|
|
81
111
|
[SUB_GENERATORS]: [],
|
|
82
112
|
[ADDITIONAL_SUB_GENERATORS]: '',
|
|
83
113
|
});
|
|
@@ -109,7 +139,14 @@ export const allGeneratorsConfig = () => ({
|
|
|
109
139
|
});
|
|
110
140
|
|
|
111
141
|
export const prompts = () => {
|
|
142
|
+
const { [LOCAL_BLUEPRINT_OPTION]: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE, [CLI_OPTION]: CLI_OPTION_DEFAULT_VALUE } = defaultConfig();
|
|
112
143
|
return [
|
|
144
|
+
{
|
|
145
|
+
type: 'confirm',
|
|
146
|
+
name: LOCAL_BLUEPRINT_OPTION,
|
|
147
|
+
message: 'Do you want to generate a local blueprint inside your application?',
|
|
148
|
+
default: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE,
|
|
149
|
+
},
|
|
113
150
|
{
|
|
114
151
|
type: 'checkbox',
|
|
115
152
|
name: SUB_GENERATORS,
|
|
@@ -130,24 +167,27 @@ export const prompts = () => {
|
|
|
130
167
|
},
|
|
131
168
|
},
|
|
132
169
|
{
|
|
170
|
+
when: answers => !answers[LOCAL_BLUEPRINT_OPTION],
|
|
133
171
|
type: 'confirm',
|
|
134
|
-
name:
|
|
172
|
+
name: CLI_OPTION,
|
|
135
173
|
message: 'Add a cli?',
|
|
136
|
-
default:
|
|
174
|
+
default: CLI_OPTION_DEFAULT_VALUE,
|
|
137
175
|
},
|
|
138
176
|
];
|
|
139
177
|
};
|
|
140
178
|
|
|
141
|
-
export const subGeneratorPrompts = (subGenerator, additionalSubGenerator) => {
|
|
179
|
+
export const subGeneratorPrompts = ({ subGenerator, additionalSubGenerator, localBlueprint }) => {
|
|
180
|
+
const { [SBS]: SBS_DEFAULT_VALUE } = defaultSubGeneratorConfig();
|
|
142
181
|
return [
|
|
143
182
|
{
|
|
144
183
|
type: 'confirm',
|
|
145
184
|
name: SBS,
|
|
146
185
|
when: !additionalSubGenerator,
|
|
147
186
|
message: `Is ${chalk.yellow(subGenerator)} generator a side-by-side blueprint?`,
|
|
148
|
-
default:
|
|
187
|
+
default: SBS_DEFAULT_VALUE,
|
|
149
188
|
},
|
|
150
189
|
{
|
|
190
|
+
when: !localBlueprint,
|
|
151
191
|
type: 'confirm',
|
|
152
192
|
name: COMMAND,
|
|
153
193
|
message: `Is ${chalk.yellow(subGenerator)} generator a cli command?`,
|
|
File without changes
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
+
import { LOCAL_BLUEPRINT_OPTION } from './constants.mjs';
|
|
19
20
|
|
|
20
21
|
export const files = {
|
|
21
22
|
baseFiles: [
|
|
22
23
|
{
|
|
24
|
+
condition: ctx => !ctx[LOCAL_BLUEPRINT_OPTION],
|
|
23
25
|
templates: [
|
|
24
26
|
'.github/workflows/generator.yml',
|
|
25
27
|
'.eslintrc.json',
|
|
@@ -44,18 +46,18 @@ export const generatorFiles = {
|
|
|
44
46
|
generator: [
|
|
45
47
|
{
|
|
46
48
|
path: 'generators/generator',
|
|
47
|
-
to: ctx =>
|
|
49
|
+
to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`,
|
|
48
50
|
templates: [{ file: 'generator.mjs.jhi', renameTo: ctx => (ctx.js ? 'generator.js.jhi' : 'generator.mjs.jhi') }],
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
53
|
path: 'generators/generator',
|
|
52
|
-
to: ctx =>
|
|
54
|
+
to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`,
|
|
53
55
|
templates: [{ file: 'index.mjs', renameTo: ctx => (ctx.js ? 'index.js' : 'index.mjs') }],
|
|
54
56
|
},
|
|
55
57
|
{
|
|
56
58
|
path: 'generators/generator',
|
|
57
|
-
to: ctx =>
|
|
58
|
-
condition: ctx => !ctx.generator.startsWith('entity'),
|
|
59
|
+
to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`,
|
|
60
|
+
condition: ctx => !ctx.generator.startsWith('entity') && !ctx.application[LOCAL_BLUEPRINT_OPTION],
|
|
59
61
|
templates: [
|
|
60
62
|
{
|
|
61
63
|
file: 'generator.spec.mjs',
|
|
@@ -65,7 +67,7 @@ export const generatorFiles = {
|
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
path: 'generators/generator',
|
|
68
|
-
to: ctx =>
|
|
70
|
+
to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`,
|
|
69
71
|
condition(ctx) {
|
|
70
72
|
return (this.options.force || !ctx.written) && ctx.priorities.find(priority => priority.name === 'writing');
|
|
71
73
|
},
|